Skip to content

Commit

Permalink
deps,build: refactor v8 gypfiles
Browse files Browse the repository at this point in the history
* make `generate_snapshot` into a target with no debug symbols on XCode
* cleanup

PR-URL: #26685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
refack committed Mar 28, 2019
1 parent 95e779a commit 4507246
Show file tree
Hide file tree
Showing 4 changed files with 277 additions and 319 deletions.
44 changes: 44 additions & 0 deletions deps/v8/gypfiles/extras-libraries.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2011 Google Inc. All Rights Reserved.

// This file was generated from .js source files by GYP. If you
// want to make changes to this file you should either change the
// javascript source files or the GYP script.

#include "src/v8.h"
#include "src/snapshot/natives.h"
#include "src/utils.h"

namespace v8 {
namespace internal {

static const char sources[] = { 40, 102, 117, 110, 99, 116, 105, 111, 110, 40, 41, 32, 123, 125, 41 };

template <>
int NativesCollection<EXTRAS>::GetBuiltinsCount() {
return 1;
}

template <>
int NativesCollection<EXTRAS>::GetIndex(const char* name) {
if (strcmp(name, "dummy") == 0) return 0;
return -1;
}

template <>
Vector<const char> NativesCollection<EXTRAS>::GetScriptSource(int index) {
if (index == 0) return Vector<const char>(sources + 0, 15);
return Vector<const char>("", 0);
}

template <>
Vector<const char> NativesCollection<EXTRAS>::GetScriptName(int index) {
if (index == 0) return Vector<const char>("native dummy.js", 15);
return Vector<const char>("", 0);
}

template <>
Vector<const char> NativesCollection<EXTRAS>::GetScriptsSource() {
return Vector<const char>(sources, 15);
}
} // internal
} // v8
125 changes: 64 additions & 61 deletions deps/v8/gypfiles/inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

{
'variables': {
'protocol_path': '../third_party/inspector_protocol',
'inspector_protocol_path': '../third_party/inspector_protocol',
'inspector_path': '../src/inspector',

'inspector_generated_output_root': '<(SHARED_INTERMEDIATE_DIR)/inspector-generated-output-root',
'inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Console.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Console.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Debugger.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/HeapProfiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/HeapProfiler.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Profiler.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Profiler.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Runtime.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Runtime.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Schema.cpp',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Schema.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Debugger.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Runtime.h',
'<(SHARED_INTERMEDIATE_DIR)/include/inspector/Schema.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Forward.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Protocol.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/Protocol.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Console.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/Console.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Debugger.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/Debugger.h',
'<(inspector_generated_output_root)/src/inspector/protocol/HeapProfiler.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/HeapProfiler.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Profiler.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/Profiler.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Runtime.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/Runtime.h',
'<(inspector_generated_output_root)/src/inspector/protocol/Schema.cpp',
'<(inspector_generated_output_root)/src/inspector/protocol/Schema.h',
'<(inspector_generated_output_root)/include/inspector/Debugger.h',
'<(inspector_generated_output_root)/include/inspector/Runtime.h',
'<(inspector_generated_output_root)/include/inspector/Schema.h',
],

'inspector_all_sources': [
Expand Down Expand Up @@ -83,45 +83,48 @@
'../src/inspector/wasm-translation.h',
]
},
'includes': [
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.pdl',
],
'outputs': [
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
],
'action': [
'python',
'<(protocol_path)/check_protocol_compatibility.py',
'--stamp', '<@(_outputs)',
'<@(_inputs)',
],
'message': 'Checking inspector protocol compatibility',
},
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.pdl',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
'<@(inspector_generated_sources)',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(protocol_path)/code_generator.py',
'--jinja_dir', '../third_party',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
],
'includes': [
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'include_dirs': [
'<(inspector_generated_output_root)',
],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.pdl',
],
'outputs': [
'<@(inspector_generated_output_root)/src/js_protocol.stamp',
],
'action': [
'python',
'<(inspector_protocol_path)/check_protocol_compatibility.py',
'--stamp', '<@(_outputs)',
'<@(_inputs)',
],
'message': 'Checking inspector protocol compatibility',
},
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.pdl',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
'<@(inspector_generated_sources)',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(inspector_protocol_path)/code_generator.py',
'--jinja_dir', '../third_party',
'--output_base', '<(inspector_generated_output_root)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
],
}
6 changes: 6 additions & 0 deletions deps/v8/gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@
}],
],
'target_defaults': {
'include_dirs': [
'..',
'../include',
],
'conditions': [
['v8_target_arch=="arm"', {
'defines': [
Expand Down Expand Up @@ -1399,6 +1403,8 @@
4245, # Conversion with signed/unsigned mismatch.
4267, # Conversion with possible loss of data.
4324, # Padding structure due to alignment.
4351,
4355,
4701, # Potentially uninitialized local variable.
4702, # Unreachable code.
4703, # Potentially uninitialized local pointer variable.
Expand Down
Loading

0 comments on commit 4507246

Please sign in to comment.