diff --git a/tools/msvs/pch/v8_pch.h b/tools/msvs/pch/v8_pch.h index d2e66f8c552..ac4835908d1 100644 --- a/tools/msvs/pch/v8_pch.h +++ b/tools/msvs/pch/v8_pch.h @@ -1,14 +1,13 @@ -#include "src/api-inl.h" +#include "src/api/api-inl.h" #include "src/ast/ast.h" #include "src/builtins/builtins-definitions.h" -#include "src/code-stub-assembler.h" -#include "src/globals.h" -#include "src/objects-inl.h" +#include "src/common/globals.h" +#include "src/objects/objects-inl.h" #include "src/objects/dictionary-inl.h" #include "src/objects/js-objects-inl.h" #include "src/objects/fixed-array-inl.h" -#include "src/utils.h" -#include "src/vector.h" +#include "src/utils/utils.h" +#include "src/utils/vector.h" #include diff --git a/tools/v8_gypfiles/GN-scraper.py b/tools/v8_gypfiles/GN-scraper.py new file mode 100644 index 00000000000..59818ad7373 --- /dev/null +++ b/tools/v8_gypfiles/GN-scraper.py @@ -0,0 +1,24 @@ +# Copyright (c) 2019 Refael Ackeramnn. All rights reserved. +# Use of this source code is governed by an MIT-style license. +import re +import os + +PLAIN_SOURCE_RE = re.compile('\s*"([^/$].+)"\s*') +def DoMain(args): + gn_filename, pattern = args + src_root = os.path.dirname(gn_filename) + with open(gn_filename, 'r') as gn_file: + gn_content = gn_file.read().encode('utf-8') + + scraper_re = re.compile(pattern + r'\[([^\]]+)', re.DOTALL) + matches = scraper_re.search(gn_content) + match = matches.group(1) + files = [] + for l in match.splitlines(): + m2 = PLAIN_SOURCE_RE.match(l) + if not m2: + continue + files.append(m2.group(1)) + # always use `/` since GYP will process paths further downstream + rel_files = ['"%s/%s"' % (src_root, f) for f in files] + return ' '.join(rel_files) diff --git a/tools/v8_gypfiles/d8.gyp b/tools/v8_gypfiles/d8.gyp index e995c3cf560..7e7e426cbfc 100644 --- a/tools/v8_gypfiles/d8.gyp +++ b/tools/v8_gypfiles/d8.gyp @@ -26,15 +26,15 @@ '<(SHARED_INTERMEDIATE_DIR)', ], 'sources': [ - '<(V8_ROOT)/src/async-hooks-wrapper.cc', - '<(V8_ROOT)/src/async-hooks-wrapper.h', - '<(V8_ROOT)/src/d8-console.cc', - '<(V8_ROOT)/src/d8-console.h', - '<(V8_ROOT)/src/d8-js.cc', - '<(V8_ROOT)/src/d8-platforms.cc', - '<(V8_ROOT)/src/d8-platforms.h', - '<(V8_ROOT)/src/d8.cc', - '<(V8_ROOT)/src/d8.h', + '<(V8_ROOT)/src/d8/async-hooks-wrapper.cc', + '<(V8_ROOT)/src/d8/async-hooks-wrapper.h', + '<(V8_ROOT)/src/d8/d8-console.cc', + '<(V8_ROOT)/src/d8/d8-console.h', + '<(V8_ROOT)/src/d8/d8-js.cc', + '<(V8_ROOT)/src/d8/d8-platforms.cc', + '<(V8_ROOT)/src/d8/d8-platforms.h', + '<(V8_ROOT)/src/d8/d8.cc', + '<(V8_ROOT)/src/d8/d8.h', ], 'conditions': [ [ 'want_separate_host_toolset==1', { @@ -46,10 +46,10 @@ ['(OS=="linux" or OS=="mac" or OS=="freebsd" or OS=="netbsd" \ or OS=="openbsd" or OS=="solaris" or OS=="android" \ or OS=="qnx" or OS=="aix")', { - 'sources': [ '<(V8_ROOT)/src/d8-posix.cc', ] + 'sources': [ '<(V8_ROOT)/src/d8/d8-posix.cc', ] }], [ 'OS=="win"', { - 'sources': [ '<(V8_ROOT)/src/d8-windows.cc', ] + 'sources': [ '<(V8_ROOT)/src/d8/d8-windows.cc', ] }], [ 'component!="shared_library"', { 'conditions': [ diff --git a/tools/v8_gypfiles/extras-libraries.cc b/tools/v8_gypfiles/extras-libraries.cc index b23aa403b90..90449302a3d 100644 --- a/tools/v8_gypfiles/extras-libraries.cc +++ b/tools/v8_gypfiles/extras-libraries.cc @@ -4,9 +4,9 @@ // 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/init/v8.h" #include "src/snapshot/natives.h" -#include "src/utils.h" +#include "src/utils/utils.h" namespace v8 { namespace internal { diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index 570c6ace907..a670f3bc806 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -113,7 +113,7 @@ 'v8_enable_embedded_builtins%': 1, # Enable the registration of unwinding info for Windows/x64. - 'v8_win64_unwinding_info%': 0, + 'v8_win64_unwinding_info%': 1, # Enable code comments for builtins in the snapshot (impacts performance). 'v8_enable_snapshot_code_comments%': 0, diff --git a/tools/v8_gypfiles/inspector.gypi b/tools/v8_gypfiles/inspector.gypi index 79e582cea9e..5e89f400ab8 100644 --- a/tools/v8_gypfiles/inspector.gypi +++ b/tools/v8_gypfiles/inspector.gypi @@ -66,6 +66,8 @@ '<(V8_ROOT)/src/inspector/v8-heap-profiler-agent-impl.h', '<(V8_ROOT)/src/inspector/v8-inspector-impl.cc', '<(V8_ROOT)/src/inspector/v8-inspector-impl.h', + '<(V8_ROOT)/src/inspector/v8-inspector-protocol-encoding.cc', + '<(V8_ROOT)/src/inspector/v8-inspector-protocol-encoding.h', '<(V8_ROOT)/src/inspector/v8-inspector-session-impl.cc', '<(V8_ROOT)/src/inspector/v8-inspector-session-impl.h', '<(V8_ROOT)/src/inspector/v8-profiler-agent-impl.cc', @@ -84,6 +86,12 @@ '<(V8_ROOT)/src/inspector/value-mirror.h', '<(V8_ROOT)/src/inspector/wasm-translation.cc', '<(V8_ROOT)/src/inspector/wasm-translation.h', + # Flat merge `third_party/inspector_protocol:inspector_string_conversions` + '<(inspector_path)/v8-string-conversions.cc', + '<(inspector_path)/v8-string-conversions.h', + # Flat merge `third_party/inspector_protocol:encoding` + '<(inspector_protocol_path)/encoding/encoding.cc', + '<(inspector_protocol_path)/encoding/encoding.h', ] }, 'include_dirs': [ diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 37364adc11b..ce33b8cd53a 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -13,11 +13,7 @@ 'generate_bytecode_output_root': '<(SHARED_INTERMEDIATE_DIR)/generate-bytecode-output-root', 'generate_bytecode_builtins_list_output': '<(generate_bytecode_output_root)/builtins-generated/bytecodes-builtins-list.h', 'torque_files': [ - "<(V8_ROOT)/src/builtins/base.tq", - "<(V8_ROOT)/src/builtins/growable-fixed-array.tq", - "<(V8_ROOT)/src/builtins/frames.tq", "<(V8_ROOT)/src/builtins/arguments.tq", - "<(V8_ROOT)/src/builtins/array.tq", "<(V8_ROOT)/src/builtins/array-copywithin.tq", "<(V8_ROOT)/src/builtins/array-every.tq", "<(V8_ROOT)/src/builtins/array-filter.tq", @@ -26,32 +22,45 @@ "<(V8_ROOT)/src/builtins/array-foreach.tq", "<(V8_ROOT)/src/builtins/array-join.tq", "<(V8_ROOT)/src/builtins/array-lastindexof.tq", - "<(V8_ROOT)/src/builtins/array-of.tq", "<(V8_ROOT)/src/builtins/array-map.tq", - "<(V8_ROOT)/src/builtins/array-reduce.tq", + "<(V8_ROOT)/src/builtins/array-of.tq", "<(V8_ROOT)/src/builtins/array-reduce-right.tq", + "<(V8_ROOT)/src/builtins/array-reduce.tq", "<(V8_ROOT)/src/builtins/array-reverse.tq", "<(V8_ROOT)/src/builtins/array-shift.tq", "<(V8_ROOT)/src/builtins/array-slice.tq", "<(V8_ROOT)/src/builtins/array-some.tq", "<(V8_ROOT)/src/builtins/array-splice.tq", "<(V8_ROOT)/src/builtins/array-unshift.tq", + "<(V8_ROOT)/src/builtins/array.tq", + "<(V8_ROOT)/src/builtins/base.tq", + "<(V8_ROOT)/src/builtins/boolean.tq", "<(V8_ROOT)/src/builtins/collections.tq", "<(V8_ROOT)/src/builtins/data-view.tq", "<(V8_ROOT)/src/builtins/extras-utils.tq", + "<(V8_ROOT)/src/builtins/frames.tq", + "<(V8_ROOT)/src/builtins/growable-fixed-array.tq", + "<(V8_ROOT)/src/builtins/internal-coverage.tq", "<(V8_ROOT)/src/builtins/iterator.tq", + "<(V8_ROOT)/src/builtins/math.tq", "<(V8_ROOT)/src/builtins/object-fromentries.tq", - "<(V8_ROOT)/src/builtins/proxy.tq", "<(V8_ROOT)/src/builtins/proxy-constructor.tq", + "<(V8_ROOT)/src/builtins/proxy-get-property.tq", + "<(V8_ROOT)/src/builtins/proxy-has-property.tq", "<(V8_ROOT)/src/builtins/proxy-revocable.tq", "<(V8_ROOT)/src/builtins/proxy-revoke.tq", - "<(V8_ROOT)/src/builtins/regexp.tq", + "<(V8_ROOT)/src/builtins/proxy-set-property.tq", + "<(V8_ROOT)/src/builtins/proxy.tq", "<(V8_ROOT)/src/builtins/regexp-replace.tq", + "<(V8_ROOT)/src/builtins/regexp.tq", + "<(V8_ROOT)/src/builtins/string.tq", "<(V8_ROOT)/src/builtins/string-endswith.tq", "<(V8_ROOT)/src/builtins/string-html.tq", + "<(V8_ROOT)/src/builtins/string-iterator.tq", "<(V8_ROOT)/src/builtins/string-repeat.tq", + "<(V8_ROOT)/src/builtins/string-slice.tq", "<(V8_ROOT)/src/builtins/string-startswith.tq", - "<(V8_ROOT)/src/builtins/typed-array.tq", + "<(V8_ROOT)/src/builtins/string-substring.tq", "<(V8_ROOT)/src/builtins/typed-array-createtypedarray.tq", "<(V8_ROOT)/src/builtins/typed-array-every.tq", "<(V8_ROOT)/src/builtins/typed-array-filter.tq", @@ -63,6 +72,7 @@ "<(V8_ROOT)/src/builtins/typed-array-slice.tq", "<(V8_ROOT)/src/builtins/typed-array-some.tq", "<(V8_ROOT)/src/builtins/typed-array-subarray.tq", + "<(V8_ROOT)/src/builtins/typed-array.tq", "<(V8_ROOT)/third_party/v8/builtins/array-sort.tq", ], 'torque_namespaces': [ @@ -83,18 +93,24 @@ "array-unshift", "array-lastindexof", "base", + "boolean", "collections", "data-view", "extras-utils", "growable-fixed-array", + "internal-coverage", "iterator", + "math", "object", "proxy", "regexp", "regexp-replace", "string", "string-html", + "string-iterator", "string-repeat", + "string-slice", + "string-substring", "typed-array", "typed-array-createtypedarray", "typed-array-every", @@ -112,230 +128,21 @@ # Since there is no foreach in GYP we use `ForEachFormat` to unroll the following: # foreach(namespace, torque_namespaces) { # outputs += [ - # "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.cc", - # "$target_gen_dir/torque-generated/builtins-$namespace-from-dsl-gen.h", + # "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.cc", + # "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.h", # ] # } - 'torque_outputs': ['