From 269328b7b13705cd488f1ecc1e3de8d7831e01b2 Mon Sep 17 00:00:00 2001 From: Vasili Skurydzin Date: Wed, 10 Oct 2018 17:19:33 -0400 Subject: [PATCH 1/2] Back-port v8 changes for ppc64, Aix platform --- deps/v8/infra/mb/mb_config.pyl | 68 ++++++++++++++++--- .../v8/src/compiler/bytecode-graph-builder.cc | 2 +- deps/v8/src/compiler/bytecode-graph-builder.h | 2 +- deps/v8/src/compiler/js-inlining.cc | 3 +- deps/v8/src/compiler/js-operator.cc | 7 +- deps/v8/src/compiler/js-operator.h | 8 +-- deps/v8/src/compiler/pipeline.cc | 3 +- deps/v8/src/torque/file-visitor.h | 4 ++ deps/v8/test/cctest/cctest.status | 1 + deps/v8/third_party/antlr4/BUILD.gn | 3 + deps/v8/tools/mb/mb.py | 8 ++- 11 files changed, 89 insertions(+), 20 deletions(-) diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index 23b00624557606..47be873e45eea2 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -30,15 +30,27 @@ 'ppc.debug': 'default_debug_ppc', 'ppc.optdebug': 'default_optdebug_ppc', 'ppc.release': 'default_release_ppc', + 'ppc.debug.sim': 'default_debug_ppc_sim', + 'ppc.optdebug.sim': 'default_optdebug_ppc_sim', + 'ppc.release.sim': 'default_release_ppc_sim', 'ppc64.debug': 'default_debug_ppc64', 'ppc64.optdebug': 'default_optdebug_ppc64', 'ppc64.release': 'default_release_ppc64', + 'ppc64.debug.sim': 'default_debug_ppc64_sim', + 'ppc64.optdebug.sim': 'default_optdebug_ppc64_sim', + 'ppc64.release.sim': 'default_release_ppc64_sim', 's390.debug': 'default_debug_s390', 's390.optdebug': 'default_optdebug_s390', 's390.release': 'default_release_s390', + 's390.debug.sim': 'default_debug_s390_sim', + 's390.optdebug.sim': 'default_optdebug_s390_sim', + 's390.release.sim': 'default_release_s390_sim', 's390x.debug': 'default_debug_s390x', 's390x.optdebug': 'default_optdebug_s390x', 's390x.release': 'default_release_s390x', + 's390x.debug.sim': 'default_debug_s390x_sim', + 's390x.optdebug.sim': 'default_optdebug_s390x_sim', + 's390x.release.sim': 'default_release_s390x_sim', 'x64.debug': 'default_debug_x64', 'x64.optdebug': 'default_optdebug_x64', 'x64.release': 'default_release_x64', @@ -285,28 +297,52 @@ 'default_release_mips64el': [ 'release', 'simulate_mips64el'], 'default_debug_ppc': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc': [ - 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks'], + 'debug', 'ppc', 'v8_enable_slow_dchecks'], 'default_release_ppc': [ + 'release', 'ppc'], + 'default_debug_ppc_sim': [ + 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_ppc_sim': [ + 'debug', 'simulate_ppc', 'v8_enable_slow_dchecks'], + 'default_release_ppc_sim': [ 'release', 'simulate_ppc'], 'default_debug_ppc64': [ - 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 'ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_ppc64': [ - 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], + 'debug', 'ppc64', 'v8_enable_slow_dchecks'], 'default_release_ppc64': [ + 'release', 'ppc64'], + 'default_debug_ppc64_sim': [ + 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_ppc64_sim': [ + 'debug', 'simulate_ppc64', 'v8_enable_slow_dchecks'], + 'default_release_ppc64_sim': [ 'release', 'simulate_ppc64'], 'default_debug_s390': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 's390', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390': [ - 'debug', 'simulate_s390', 'v8_enable_slow_dchecks'], + 'debug', 's390', 'v8_enable_slow_dchecks'], 'default_release_s390': [ + 'release', 's390'], + 'default_debug_s390_sim': [ + 'debug', 'simulate_s390', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_s390_sim': [ + 'debug', 'simulate_s390', 'v8_enable_slow_dchecks'], + 'default_release_s390_sim': [ 'release', 'simulate_s390'], 'default_debug_s390x': [ - 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'debug', 's390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], 'default_optdebug_s390x': [ - 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks'], + 'debug', 's390x', 'v8_enable_slow_dchecks'], 'default_release_s390x': [ + 'release', 's390x'], + 'default_debug_s390x_sim': [ + 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks', 'v8_full_debug'], + 'default_optdebug_s390x_sim': [ + 'debug', 'simulate_s390x', 'v8_enable_slow_dchecks'], + 'default_release_s390x_sim': [ 'release', 'simulate_s390x'], 'default_debug_x64': [ 'debug', 'x64', 'v8_enable_slow_dchecks', 'v8_full_debug'], @@ -816,6 +852,22 @@ 'gn_args': 'v8_enable_verify_csa=true', }, + 's390': { + 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390"', + }, + + 's390x': { + 'gn_args': 'target_cpu="s390x" v8_target_cpu="s390x"', + }, + + 'ppc': { + 'gn_args': 'target_cpu="ppc"', + }, + + 'ppc64': { + 'gn_args': 'target_cpu="ppc64" use_custom_libcxx=false', + }, + 'x64': { 'gn_args': 'target_cpu="x64"', }, diff --git a/deps/v8/src/compiler/bytecode-graph-builder.cc b/deps/v8/src/compiler/bytecode-graph-builder.cc index ade917de476ef7..8a60d680332e61 100644 --- a/deps/v8/src/compiler/bytecode-graph-builder.cc +++ b/deps/v8/src/compiler/bytecode-graph-builder.cc @@ -514,7 +514,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint( BytecodeGraphBuilder::BytecodeGraphBuilder( Zone* local_zone, Handle shared_info, Handle feedback_vector, BailoutId osr_offset, - JSGraph* jsgraph, CallFrequency invocation_frequency, + JSGraph* jsgraph, CallFrequency& invocation_frequency, SourcePositionTable* source_positions, Handle native_context, int inlining_id, JSTypeHintLowering::Flags flags, bool stack_check, bool analyze_environment_liveness) diff --git a/deps/v8/src/compiler/bytecode-graph-builder.h b/deps/v8/src/compiler/bytecode-graph-builder.h index 9025d477d57fe3..15eef5d844e140 100644 --- a/deps/v8/src/compiler/bytecode-graph-builder.h +++ b/deps/v8/src/compiler/bytecode-graph-builder.h @@ -31,7 +31,7 @@ class BytecodeGraphBuilder { BytecodeGraphBuilder( Zone* local_zone, Handle shared, Handle feedback_vector, BailoutId osr_offset, - JSGraph* jsgraph, CallFrequency invocation_frequency, + JSGraph* jsgraph, CallFrequency& invocation_frequency, SourcePositionTable* source_positions, Handle native_context, int inlining_id = SourcePosition::kNotInlined, JSTypeHintLowering::Flags flags = JSTypeHintLowering::kNoFlags, diff --git a/deps/v8/src/compiler/js-inlining.cc b/deps/v8/src/compiler/js-inlining.cc index 08917ab78bd93d..075155c2496ba7 100644 --- a/deps/v8/src/compiler/js-inlining.cc +++ b/deps/v8/src/compiler/js-inlining.cc @@ -484,9 +484,10 @@ Reduction JSInliner::ReduceJSCall(Node* node) { if (info_->is_bailout_on_uninitialized()) { flags |= JSTypeHintLowering::kBailoutOnUninitialized; } + CallFrequency frequency = call.frequency(); BytecodeGraphBuilder graph_builder( zone(), shared_info, feedback_vector, BailoutId::None(), jsgraph(), - call.frequency(), source_positions_, native_context(), inlining_id, + frequency, source_positions_, native_context(), inlining_id, flags, false, info_->is_analyze_environment_liveness()); graph_builder.CreateGraph(); diff --git a/deps/v8/src/compiler/js-operator.cc b/deps/v8/src/compiler/js-operator.cc index 8fe10bb36a83d7..04feec6827aad0 100644 --- a/deps/v8/src/compiler/js-operator.cc +++ b/deps/v8/src/compiler/js-operator.cc @@ -794,7 +794,8 @@ const Operator* JSOperatorBuilder::CallForwardVarargs(size_t arity, parameters); // parameter } -const Operator* JSOperatorBuilder::Call(size_t arity, CallFrequency frequency, +const Operator* JSOperatorBuilder::Call(size_t arity, + CallFrequency const& frequency, VectorSlotPair const& feedback, ConvertReceiverMode convert_mode, SpeculationMode speculation_mode) { @@ -818,8 +819,8 @@ const Operator* JSOperatorBuilder::CallWithArrayLike(CallFrequency frequency) { } const Operator* JSOperatorBuilder::CallWithSpread( - uint32_t arity, CallFrequency frequency, VectorSlotPair const& feedback, - SpeculationMode speculation_mode) { + uint32_t arity, CallFrequency const& frequency, + VectorSlotPair const& feedback, SpeculationMode speculation_mode) { DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation, feedback.IsValid()); CallParameters parameters(arity, frequency, feedback, diff --git a/deps/v8/src/compiler/js-operator.h b/deps/v8/src/compiler/js-operator.h index 6d89e5ac09a9de..ac09ed229bd7b2 100644 --- a/deps/v8/src/compiler/js-operator.h +++ b/deps/v8/src/compiler/js-operator.h @@ -160,7 +160,7 @@ CallForwardVarargsParameters const& CallForwardVarargsParametersOf( // used as a parameter by JSCall and JSCallWithSpread operators. class CallParameters final { public: - CallParameters(size_t arity, CallFrequency frequency, + CallParameters(size_t arity, CallFrequency const& frequency, VectorSlotPair const& feedback, ConvertReceiverMode convert_mode, SpeculationMode speculation_mode) @@ -171,7 +171,7 @@ class CallParameters final { feedback_(feedback) {} size_t arity() const { return ArityField::decode(bit_field_); } - CallFrequency frequency() const { return frequency_; } + CallFrequency const& frequency() const { return frequency_; } ConvertReceiverMode convert_mode() const { return ConvertReceiverModeField::decode(bit_field_); } @@ -721,13 +721,13 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final const Operator* CallForwardVarargs(size_t arity, uint32_t start_index); const Operator* Call( - size_t arity, CallFrequency frequency = CallFrequency(), + size_t arity, CallFrequency const& frequency = CallFrequency(), VectorSlotPair const& feedback = VectorSlotPair(), ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny, SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation); const Operator* CallWithArrayLike(CallFrequency frequency); const Operator* CallWithSpread( - uint32_t arity, CallFrequency frequency = CallFrequency(), + uint32_t arity, CallFrequency const& frequency = CallFrequency(), VectorSlotPair const& feedback = VectorSlotPair(), SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation); const Operator* CallRuntime(Runtime::FunctionId id); diff --git a/deps/v8/src/compiler/pipeline.cc b/deps/v8/src/compiler/pipeline.cc index 779457bcf76c34..0bc4bdd41428e2 100644 --- a/deps/v8/src/compiler/pipeline.cc +++ b/deps/v8/src/compiler/pipeline.cc @@ -1059,10 +1059,11 @@ struct GraphBuilderPhase { if (data->info()->is_bailout_on_uninitialized()) { flags |= JSTypeHintLowering::kBailoutOnUninitialized; } + CallFrequency frequency = CallFrequency(1.0f); BytecodeGraphBuilder graph_builder( temp_zone, data->info()->shared_info(), handle(data->info()->closure()->feedback_vector()), - data->info()->osr_offset(), data->jsgraph(), CallFrequency(1.0f), + data->info()->osr_offset(), data->jsgraph(), frequency, data->source_positions(), data->native_context(), SourcePosition::kNotInlined, flags, true, data->info()->is_analyze_environment_liveness()); diff --git a/deps/v8/src/torque/file-visitor.h b/deps/v8/src/torque/file-visitor.h index 5aac1bad46d6a4..45820c5b6bf8ef 100644 --- a/deps/v8/src/torque/file-visitor.h +++ b/deps/v8/src/torque/file-visitor.h @@ -21,6 +21,10 @@ namespace torque { class FileVisitor { public: +#if defined(__GNUC__) && V8_OS_AIX + // prevent non-virtual-dtor gcc error on Aix + virtual ~FileVisitor() = default; +#endif explicit FileVisitor(GlobalContext& global_context) : global_context_(global_context), declarations_(global_context.declarations()), diff --git a/deps/v8/test/cctest/cctest.status b/deps/v8/test/cctest/cctest.status index da069e0a269386..85e2554f5ec77f 100644 --- a/deps/v8/test/cctest/cctest.status +++ b/deps/v8/test/cctest/cctest.status @@ -390,6 +390,7 @@ # TODO(ppc): Implement load/store reverse byte instructions 'test-run-wasm-simd/RunWasmCompiled_SimdLoadStoreLoad': [SKIP], 'test-run-wasm-simd/RunWasm_SimdLoadStoreLoad': [SKIP], + 'test-run-wasm-simd/RunWasm_SimdLoadStoreLoad_turbofan': [SKIP], }], # 'system == aix or (arch == ppc64 and byteorder == big)' diff --git a/deps/v8/third_party/antlr4/BUILD.gn b/deps/v8/third_party/antlr4/BUILD.gn index bd58a1804d1558..8d3d98a399f0f6 100644 --- a/deps/v8/third_party/antlr4/BUILD.gn +++ b/deps/v8/third_party/antlr4/BUILD.gn @@ -9,6 +9,9 @@ config("antlr-compatibility") { "-Wno-unused-but-set-variable", ] } + if (current_os == "aix") { + cflags += [ "-fdollars-in-identifiers" ] + } } source_set("antlr4") { diff --git a/deps/v8/tools/mb/mb.py b/deps/v8/tools/mb/mb.py index b2ae0c763f6a15..65e5e2c74c6400 100755 --- a/deps/v8/tools/mb/mb.py +++ b/deps/v8/tools/mb/mb.py @@ -835,7 +835,13 @@ def GNCmd(self, subcommand, path, *args): else: subdir, exe = 'win', 'gn.exe' - gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe) + arch = platform.machine() + if self.platform.startswith('aix') or (self.platform == 'linux2' and + (arch.startswith('s390') or arch.startswith('ppc'))): + # use gn in PATH + gn_path = 'gn' + else: + gn_path = self.PathJoin(self.chromium_src_dir, 'buildtools', subdir, exe) return [gn_path, subcommand, path] + list(args) From 98f9b2b9fcda296802eeea41c125e7b46fe99a33 Mon Sep 17 00:00:00 2001 From: Vasili Skurydzin Date: Thu, 11 Oct 2018 15:30:36 -0400 Subject: [PATCH 2/2] bumping the v8_embedder_string number in common.gypi --- common.gypi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index c235f07712c74f..14c6b5ae9f8463 100644 --- a/common.gypi +++ b/common.gypi @@ -33,7 +33,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.35', + 'v8_embedder_string': '-node.36', # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1,