diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-07-14 11:30:07 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-07-20 15:24:51 +0200 |
commit | 6cdd310275bb0f8056aa0ae6d95614e9ca5b70c7 (patch) | |
tree | 9ed37b19cd668894854b7f469010f7621e63ef81 /deps/v8/src/interpreter | |
parent | c0f10006c82d2d9896a552de98ed146f9542720d (diff) | |
download | node-new-6cdd310275bb0f8056aa0ae6d95614e9ca5b70c7.tar.gz |
deps: update V8 to 9.2.230.21
PR-URL: https://github.com/nodejs/node/pull/38990
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/interpreter')
20 files changed, 177 insertions, 200 deletions
diff --git a/deps/v8/src/interpreter/bytecode-array-builder.cc b/deps/v8/src/interpreter/bytecode-array-builder.cc index 63c07683e6..23c622b033 100644 --- a/deps/v8/src/interpreter/bytecode-array-builder.cc +++ b/deps/v8/src/interpreter/bytecode-array-builder.cc @@ -81,9 +81,8 @@ Register BytecodeArrayBuilder::Local(int index) const { return Register(index); } -template <typename LocalIsolate> -Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray( - LocalIsolate* isolate) { +template <typename IsolateT> +Handle<BytecodeArray> BytecodeArrayBuilder::ToBytecodeArray(IsolateT* isolate) { DCHECK(RemainderOfBlockIsDead()); DCHECK(!bytecode_generated_); bytecode_generated_ = true; @@ -115,9 +114,9 @@ int BytecodeArrayBuilder::CheckBytecodeMatches(BytecodeArray bytecode) { } #endif -template <typename LocalIsolate> +template <typename IsolateT> Handle<ByteArray> BytecodeArrayBuilder::ToSourcePositionTable( - LocalIsolate* isolate) { + IsolateT* isolate) { DCHECK(RemainderOfBlockIsDead()); return bytecode_array_writer_.ToSourcePositionTable(isolate); @@ -726,11 +725,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(const AstRawString* name, DCHECK_EQ(GetTypeofModeFromSlotKind(feedback_vector_spec()->GetKind( FeedbackVector::ToSlot(feedback_slot))), typeof_mode); - if (typeof_mode == INSIDE_TYPEOF) { - OutputLdaGlobalInsideTypeof(name_index, feedback_slot); - } else { - DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF); - OutputLdaGlobal(name_index, feedback_slot); + switch (typeof_mode) { + case TypeofMode::kInside: + OutputLdaGlobalInsideTypeof(name_index, feedback_slot); + break; + case TypeofMode::kNotInside: + OutputLdaGlobal(name_index, feedback_slot); + break; } return *this; } @@ -775,11 +776,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::StoreContextSlot(Register context, BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupSlot( const AstRawString* name, TypeofMode typeof_mode) { size_t name_index = GetConstantPoolEntry(name); - if (typeof_mode == INSIDE_TYPEOF) { - OutputLdaLookupSlotInsideTypeof(name_index); - } else { - DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF); - OutputLdaLookupSlot(name_index); + switch (typeof_mode) { + case TypeofMode::kInside: + OutputLdaLookupSlotInsideTypeof(name_index); + break; + case TypeofMode::kNotInside: + OutputLdaLookupSlot(name_index); + break; } return *this; } @@ -788,11 +791,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupContextSlot( const AstRawString* name, TypeofMode typeof_mode, int slot_index, int depth) { size_t name_index = GetConstantPoolEntry(name); - if (typeof_mode == INSIDE_TYPEOF) { - OutputLdaLookupContextSlotInsideTypeof(name_index, slot_index, depth); - } else { - DCHECK(typeof_mode == NOT_INSIDE_TYPEOF); - OutputLdaLookupContextSlot(name_index, slot_index, depth); + switch (typeof_mode) { + case TypeofMode::kInside: + OutputLdaLookupContextSlotInsideTypeof(name_index, slot_index, depth); + break; + case TypeofMode::kNotInside: + OutputLdaLookupContextSlot(name_index, slot_index, depth); + break; } return *this; } @@ -801,11 +806,13 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::LoadLookupGlobalSlot( const AstRawString* name, TypeofMode typeof_mode, int feedback_slot, int depth) { size_t name_index = GetConstantPoolEntry(name); - if (typeof_mode == INSIDE_TYPEOF) { - OutputLdaLookupGlobalSlotInsideTypeof(name_index, feedback_slot, depth); - } else { - DCHECK(typeof_mode == NOT_INSIDE_TYPEOF); - OutputLdaLookupGlobalSlot(name_index, feedback_slot, depth); + switch (typeof_mode) { + case TypeofMode::kInside: + OutputLdaLookupGlobalSlotInsideTypeof(name_index, feedback_slot, depth); + break; + case TypeofMode::kNotInside: + OutputLdaLookupGlobalSlot(name_index, feedback_slot, depth); + break; } return *this; } diff --git a/deps/v8/src/interpreter/bytecode-array-builder.h b/deps/v8/src/interpreter/bytecode-array-builder.h index 28716b401b..3d72777c5a 100644 --- a/deps/v8/src/interpreter/bytecode-array-builder.h +++ b/deps/v8/src/interpreter/bytecode-array-builder.h @@ -46,12 +46,12 @@ class V8_EXPORT_PRIVATE BytecodeArrayBuilder final { BytecodeArrayBuilder(const BytecodeArrayBuilder&) = delete; BytecodeArrayBuilder& operator=(const BytecodeArrayBuilder&) = delete; - template <typename LocalIsolate> + template <typename IsolateT> EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) - Handle<BytecodeArray> ToBytecodeArray(LocalIsolate* isolate); - template <typename LocalIsolate> + Handle<BytecodeArray> ToBytecodeArray(IsolateT* isolate); + template <typename IsolateT> EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) - Handle<ByteArray> ToSourcePositionTable(LocalIsolate* isolate); + Handle<ByteArray> ToSourcePositionTable(IsolateT* isolate); #ifdef DEBUG int CheckBytecodeMatches(BytecodeArray bytecode); diff --git a/deps/v8/src/interpreter/bytecode-array-iterator.cc b/deps/v8/src/interpreter/bytecode-array-iterator.cc index 2579f5d378..bb1fdcb95f 100644 --- a/deps/v8/src/interpreter/bytecode-array-iterator.cc +++ b/deps/v8/src/interpreter/bytecode-array-iterator.cc @@ -207,9 +207,9 @@ Runtime::FunctionId BytecodeArrayIterator::GetIntrinsicIdOperand( static_cast<IntrinsicsHelper::IntrinsicId>(raw_id)); } -template <typename LocalIsolate> +template <typename IsolateT> Handle<Object> BytecodeArrayIterator::GetConstantAtIndex( - int index, LocalIsolate* isolate) const { + int index, IsolateT* isolate) const { return handle(bytecode_array()->constant_pool().get(index), isolate); } @@ -221,9 +221,9 @@ Smi BytecodeArrayIterator::GetConstantAtIndexAsSmi(int index) const { return Smi::cast(bytecode_array()->constant_pool().get(index)); } -template <typename LocalIsolate> +template <typename IsolateT> Handle<Object> BytecodeArrayIterator::GetConstantForIndexOperand( - int operand_index, LocalIsolate* isolate) const { + int operand_index, IsolateT* isolate) const { return GetConstantAtIndex(GetIndexOperand(operand_index), isolate); } diff --git a/deps/v8/src/interpreter/bytecode-array-iterator.h b/deps/v8/src/interpreter/bytecode-array-iterator.h index d0c676d2a3..5e93cbccb8 100644 --- a/deps/v8/src/interpreter/bytecode-array-iterator.h +++ b/deps/v8/src/interpreter/bytecode-array-iterator.h @@ -115,13 +115,13 @@ class V8_EXPORT_PRIVATE BytecodeArrayIterator { Runtime::FunctionId GetRuntimeIdOperand(int operand_index) const; Runtime::FunctionId GetIntrinsicIdOperand(int operand_index) const; uint32_t GetNativeContextIndexOperand(int operand_index) const; - template <typename LocalIsolate> - Handle<Object> GetConstantAtIndex(int offset, LocalIsolate* isolate) const; + template <typename IsolateT> + Handle<Object> GetConstantAtIndex(int offset, IsolateT* isolate) const; bool IsConstantAtIndexSmi(int offset) const; Smi GetConstantAtIndexAsSmi(int offset) const; - template <typename LocalIsolate> + template <typename IsolateT> Handle<Object> GetConstantForIndexOperand(int operand_index, - LocalIsolate* isolate) const; + IsolateT* isolate) const; // Returns the relative offset of the branch target at the current bytecode. // It is an error to call this method if the bytecode is not for a jump or diff --git a/deps/v8/src/interpreter/bytecode-array-writer.cc b/deps/v8/src/interpreter/bytecode-array-writer.cc index 0172d3626b..2ed8e614bb 100644 --- a/deps/v8/src/interpreter/bytecode-array-writer.cc +++ b/deps/v8/src/interpreter/bytecode-array-writer.cc @@ -37,9 +37,9 @@ BytecodeArrayWriter::BytecodeArrayWriter( bytecodes_.reserve(512); // Derived via experimentation. } -template <typename LocalIsolate> +template <typename IsolateT> Handle<BytecodeArray> BytecodeArrayWriter::ToBytecodeArray( - LocalIsolate* isolate, int register_count, int parameter_count, + IsolateT* isolate, int register_count, int parameter_count, Handle<ByteArray> handler_table) { DCHECK_EQ(0, unbound_jumps_); @@ -63,9 +63,9 @@ template EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE) LocalIsolate* isolate, int register_count, int parameter_count, Handle<ByteArray> handler_table); -template <typename LocalIsolate> +template <typename IsolateT> Handle<ByteArray> BytecodeArrayWriter::ToSourcePositionTable( - LocalIsolate* isolate) { + IsolateT* isolate) { DCHECK(!source_position_table_builder_.Lazy()); Handle<ByteArray> source_position_table = source_position_table_builder_.Omit() diff --git a/deps/v8/src/interpreter/bytecode-array-writer.h b/deps/v8/src/interpreter/bytecode-array-writer.h index 6517ad9f5e..9976f59c23 100644 --- a/deps/v8/src/interpreter/bytecode-array-writer.h +++ b/deps/v8/src/interpreter/bytecode-array-writer.h @@ -55,15 +55,15 @@ class V8_EXPORT_PRIVATE BytecodeArrayWriter final { void SetFunctionEntrySourcePosition(int position); - template <typename LocalIsolate> + template <typename IsolateT> EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) - Handle<BytecodeArray> ToBytecodeArray(LocalIsolate* isolate, - int register_count, int parameter_count, + Handle<BytecodeArray> ToBytecodeArray(IsolateT* isolate, int register_count, + int parameter_count, Handle<ByteArray> handler_table); - template <typename LocalIsolate> + template <typename IsolateT> EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) - Handle<ByteArray> ToSourcePositionTable(LocalIsolate* isolate); + Handle<ByteArray> ToSourcePositionTable(IsolateT* isolate); #ifdef DEBUG // Returns -1 if they match or the offset of the first mismatching byte. diff --git a/deps/v8/src/interpreter/bytecode-generator.cc b/deps/v8/src/interpreter/bytecode-generator.cc index 76686a9d62..a08c42126b 100644 --- a/deps/v8/src/interpreter/bytecode-generator.cc +++ b/deps/v8/src/interpreter/bytecode-generator.cc @@ -740,11 +740,11 @@ class V8_NODISCARD BytecodeGenerator::TestResultScope final // Used to build a list of toplevel declaration data. class BytecodeGenerator::TopLevelDeclarationsBuilder final : public ZoneObject { public: - template <typename LocalIsolate> + template <typename IsolateT> Handle<FixedArray> AllocateDeclarations(UnoptimizedCompilationInfo* info, BytecodeGenerator* generator, Handle<Script> script, - LocalIsolate* isolate) { + IsolateT* isolate) { DCHECK(has_constant_pool_entry_); Handle<FixedArray> data = @@ -1187,14 +1187,14 @@ using NullContextScopeFor = typename NullContextScopeHelper<Isolate>::Type; } // namespace -template <typename LocalIsolate> +template <typename IsolateT> Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode( - LocalIsolate* isolate, Handle<Script> script) { + IsolateT* isolate, Handle<Script> script) { DCHECK_EQ(ThreadId::Current(), isolate->thread_id()); #ifdef DEBUG // Unoptimized compilation should be context-independent. Verify that we don't // access the native context by nulling it out during finalization. - NullContextScopeFor<LocalIsolate> null_context_scope(isolate); + NullContextScopeFor<IsolateT> null_context_scope(isolate); #endif AllocateDeferredConstants(isolate, script); @@ -1225,14 +1225,14 @@ template Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode( template Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode( LocalIsolate* isolate, Handle<Script> script); -template <typename LocalIsolate> +template <typename IsolateT> Handle<ByteArray> BytecodeGenerator::FinalizeSourcePositionTable( - LocalIsolate* isolate) { + IsolateT* isolate) { DCHECK_EQ(ThreadId::Current(), isolate->thread_id()); #ifdef DEBUG // Unoptimized compilation should be context-independent. Verify that we don't // access the native context by nulling it out during finalization. - NullContextScopeFor<LocalIsolate> null_context_scope(isolate); + NullContextScopeFor<IsolateT> null_context_scope(isolate); #endif Handle<ByteArray> source_position_table = @@ -1257,8 +1257,8 @@ int BytecodeGenerator::CheckBytecodeMatches(BytecodeArray bytecode) { } #endif -template <typename LocalIsolate> -void BytecodeGenerator::AllocateDeferredConstants(LocalIsolate* isolate, +template <typename IsolateT> +void BytecodeGenerator::AllocateDeferredConstants(IsolateT* isolate, Handle<Script> script) { if (top_level_builder()->has_top_level_declaration()) { // Build global declaration pair array. @@ -3289,7 +3289,7 @@ void BytecodeGenerator::BuildVariableLoad(Variable* variable, break; } case VariableLocation::REPL_GLOBAL: { - DCHECK(variable->IsReplGlobalLet()); + DCHECK(variable->IsReplGlobal()); FeedbackSlot slot = GetCachedLoadGlobalICSlot(typeof_mode, variable); builder()->LoadGlobal(variable->raw_name(), feedback_index(slot), typeof_mode); @@ -3478,7 +3478,8 @@ void BytecodeGenerator::BuildVariableAssignment( break; } case VariableLocation::REPL_GLOBAL: { - // A let declaration like 'let x = 7' is effectively translated to: + // A let or const declaration like 'let x = 7' is effectively translated + // to: // <top of the script>: // ScriptContext.x = TheHole; // ... @@ -3488,19 +3489,23 @@ void BytecodeGenerator::BuildVariableAssignment( // The ScriptContext slot for 'x' that we store to here is not // necessarily the ScriptContext of this script, but rather the // first ScriptContext that has a slot for name 'x'. - DCHECK(variable->IsReplGlobalLet()); + DCHECK(variable->IsReplGlobal()); if (op == Token::INIT) { RegisterList store_args = register_allocator()->NewRegisterList(2); builder() ->StoreAccumulatorInRegister(store_args[1]) .LoadLiteral(variable->raw_name()) .StoreAccumulatorInRegister(store_args[0]); - builder()->CallRuntime(Runtime::kStoreGlobalNoHoleCheckForReplLet, - store_args); + builder()->CallRuntime( + Runtime::kStoreGlobalNoHoleCheckForReplLetOrConst, store_args); } else { - FeedbackSlot slot = - GetCachedStoreGlobalICSlot(language_mode(), variable); - builder()->StoreGlobal(variable->raw_name(), feedback_index(slot)); + if (mode == VariableMode::kConst) { + builder()->CallRuntime(Runtime::kThrowConstAssignError); + } else { + FeedbackSlot slot = + GetCachedStoreGlobalICSlot(language_mode(), variable); + builder()->StoreGlobal(variable->raw_name(), feedback_index(slot)); + } } break; } @@ -5420,7 +5425,7 @@ void BytecodeGenerator::VisitForTypeOfValue(Expression* expr) { // perform a non-contextual load in case the operand is a variable proxy. VariableProxy* proxy = expr->AsVariableProxy(); BuildVariableLoadForAccumulatorValue(proxy->var(), proxy->hole_check_mode(), - INSIDE_TYPEOF); + TypeofMode::kInside); } else { VisitForAccumulatorValue(expr); } @@ -6850,7 +6855,7 @@ int BytecodeGenerator::feedback_index(FeedbackSlot slot) const { FeedbackSlot BytecodeGenerator::GetCachedLoadGlobalICSlot( TypeofMode typeof_mode, Variable* variable) { FeedbackSlotCache::SlotKind slot_kind = - typeof_mode == INSIDE_TYPEOF + typeof_mode == TypeofMode::kInside ? FeedbackSlotCache::SlotKind::kLoadGlobalInsideTypeof : FeedbackSlotCache::SlotKind::kLoadGlobalNotInsideTypeof; FeedbackSlot slot(feedback_slot_cache()->Get(slot_kind, variable)); diff --git a/deps/v8/src/interpreter/bytecode-generator.h b/deps/v8/src/interpreter/bytecode-generator.h index 69d5bf8957..f3b048d52d 100644 --- a/deps/v8/src/interpreter/bytecode-generator.h +++ b/deps/v8/src/interpreter/bytecode-generator.h @@ -37,11 +37,11 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { std::vector<FunctionLiteral*>* eager_inner_literals); void GenerateBytecode(uintptr_t stack_limit); - template <typename LocalIsolate> - Handle<BytecodeArray> FinalizeBytecode(LocalIsolate* isolate, + template <typename IsolateT> + Handle<BytecodeArray> FinalizeBytecode(IsolateT* isolate, Handle<Script> script); - template <typename LocalIsolate> - Handle<ByteArray> FinalizeSourcePositionTable(LocalIsolate* isolate); + template <typename IsolateT> + Handle<ByteArray> FinalizeSourcePositionTable(IsolateT* isolate); #ifdef DEBUG int CheckBytecodeMatches(BytecodeArray bytecode); @@ -165,8 +165,8 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { }; void GenerateBytecodeBody(); - template <typename LocalIsolate> - void AllocateDeferredConstants(LocalIsolate* isolate, Handle<Script> script); + template <typename IsolateT> + void AllocateDeferredConstants(IsolateT* isolate, Handle<Script> script); DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); @@ -243,10 +243,10 @@ class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { const AstRawString* name); void BuildVariableLoad(Variable* variable, HoleCheckMode hole_check_mode, - TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); + TypeofMode typeof_mode = TypeofMode::kNotInside); void BuildVariableLoadForAccumulatorValue( Variable* variable, HoleCheckMode hole_check_mode, - TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); + TypeofMode typeof_mode = TypeofMode::kNotInside); void BuildVariableAssignment( Variable* variable, Token::Value op, HoleCheckMode hole_check_mode, LookupHoistingMode lookup_hoisting_mode = LookupHoistingMode::kNormal); diff --git a/deps/v8/src/interpreter/bytecode-operands.h b/deps/v8/src/interpreter/bytecode-operands.h index c9cca226ab..4032980fe8 100644 --- a/deps/v8/src/interpreter/bytecode-operands.h +++ b/deps/v8/src/interpreter/bytecode-operands.h @@ -151,7 +151,6 @@ class BytecodeOperands : public AllStatic { #undef OPERAND_SCALE_COUNT static constexpr int OperandScaleAsIndex(OperandScale operand_scale) { -#if V8_HAS_CXX14_CONSTEXPR #ifdef DEBUG int result = static_cast<int>(operand_scale) >> 1; switch (operand_scale) { @@ -168,7 +167,6 @@ class BytecodeOperands : public AllStatic { UNREACHABLE(); } #endif -#endif return static_cast<int>(operand_scale) >> 1; } diff --git a/deps/v8/src/interpreter/bytecodes.h b/deps/v8/src/interpreter/bytecodes.h index 56d9d5af0d..e4589918b6 100644 --- a/deps/v8/src/interpreter/bytecodes.h +++ b/deps/v8/src/interpreter/bytecodes.h @@ -68,7 +68,9 @@ namespace interpreter { OperandType::kRuntimeId, OperandType::kReg, OperandType::kReg, \ OperandType::kReg) \ \ - /* Loading the accumulator */ \ + /* Side-effect-free bytecodes -- carefully ordered for efficient checks */ \ + /* - [Loading the accumulator] */ \ + V(Ldar, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg) \ V(LdaZero, ImplicitRegisterUse::kWriteAccumulator) \ V(LdaSmi, ImplicitRegisterUse::kWriteAccumulator, OperandType::kImm) \ V(LdaUndefined, ImplicitRegisterUse::kWriteAccumulator) \ @@ -77,6 +79,27 @@ namespace interpreter { V(LdaTrue, ImplicitRegisterUse::kWriteAccumulator) \ V(LdaFalse, ImplicitRegisterUse::kWriteAccumulator) \ V(LdaConstant, ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx) \ + V(LdaContextSlot, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \ + OperandType::kIdx, OperandType::kUImm) \ + V(LdaImmutableContextSlot, ImplicitRegisterUse::kWriteAccumulator, \ + OperandType::kReg, OperandType::kIdx, OperandType::kUImm) \ + V(LdaCurrentContextSlot, ImplicitRegisterUse::kWriteAccumulator, \ + OperandType::kIdx) \ + V(LdaImmutableCurrentContextSlot, ImplicitRegisterUse::kWriteAccumulator, \ + OperandType::kIdx) \ + /* - [Register Loads ] */ \ + V(Star, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \ + V(Mov, ImplicitRegisterUse::kNone, OperandType::kReg, OperandType::kRegOut) \ + V(PushContext, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \ + V(PopContext, ImplicitRegisterUse::kNone, OperandType::kReg) \ + /* - [Test Operations ] */ \ + V(TestReferenceEqual, ImplicitRegisterUse::kReadWriteAccumulator, \ + OperandType::kReg) \ + V(TestUndetectable, ImplicitRegisterUse::kReadWriteAccumulator) \ + V(TestNull, ImplicitRegisterUse::kReadWriteAccumulator) \ + V(TestUndefined, ImplicitRegisterUse::kReadWriteAccumulator) \ + V(TestTypeOf, ImplicitRegisterUse::kReadWriteAccumulator, \ + OperandType::kFlag8) \ \ /* Globals */ \ V(LdaGlobal, ImplicitRegisterUse::kWriteAccumulator, OperandType::kIdx, \ @@ -87,16 +110,6 @@ namespace interpreter { OperandType::kIdx) \ \ /* Context operations */ \ - V(PushContext, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \ - V(PopContext, ImplicitRegisterUse::kNone, OperandType::kReg) \ - V(LdaContextSlot, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg, \ - OperandType::kIdx, OperandType::kUImm) \ - V(LdaImmutableContextSlot, ImplicitRegisterUse::kWriteAccumulator, \ - OperandType::kReg, OperandType::kIdx, OperandType::kUImm) \ - V(LdaCurrentContextSlot, ImplicitRegisterUse::kWriteAccumulator, \ - OperandType::kIdx) \ - V(LdaImmutableCurrentContextSlot, ImplicitRegisterUse::kWriteAccumulator, \ - OperandType::kIdx) \ V(StaContextSlot, ImplicitRegisterUse::kReadAccumulator, OperandType::kReg, \ OperandType::kIdx, OperandType::kUImm) \ V(StaCurrentContextSlot, ImplicitRegisterUse::kReadAccumulator, \ @@ -117,13 +130,6 @@ namespace interpreter { V(StaLookupSlot, ImplicitRegisterUse::kReadWriteAccumulator, \ OperandType::kIdx, OperandType::kFlag8) \ \ - /* Register-accumulator transfers */ \ - V(Ldar, ImplicitRegisterUse::kWriteAccumulator, OperandType::kReg) \ - V(Star, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \ - \ - /* Register-register transfers */ \ - V(Mov, ImplicitRegisterUse::kNone, OperandType::kReg, OperandType::kRegOut) \ - \ /* Property loads (LoadIC) operations */ \ V(LdaNamedProperty, ImplicitRegisterUse::kWriteAccumulator, \ OperandType::kReg, OperandType::kIdx, OperandType::kIdx) \ @@ -272,7 +278,7 @@ namespace interpreter { OperandType::kReg, OperandType::kRegList, OperandType::kRegCount, \ OperandType::kIdx) \ \ - /* Test Operators */ \ + /* Effectful Test Operators */ \ V(TestEqual, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \ OperandType::kIdx) \ V(TestEqualStrict, ImplicitRegisterUse::kReadWriteAccumulator, \ @@ -285,17 +291,10 @@ namespace interpreter { OperandType::kReg, OperandType::kIdx) \ V(TestGreaterThanOrEqual, ImplicitRegisterUse::kReadWriteAccumulator, \ OperandType::kReg, OperandType::kIdx) \ - V(TestReferenceEqual, ImplicitRegisterUse::kReadWriteAccumulator, \ - OperandType::kReg) \ V(TestInstanceOf, ImplicitRegisterUse::kReadWriteAccumulator, \ OperandType::kReg, OperandType::kIdx) \ V(TestIn, ImplicitRegisterUse::kReadWriteAccumulator, OperandType::kReg, \ OperandType::kIdx) \ - V(TestUndetectable, ImplicitRegisterUse::kReadWriteAccumulator) \ - V(TestNull, ImplicitRegisterUse::kReadWriteAccumulator) \ - V(TestUndefined, ImplicitRegisterUse::kReadWriteAccumulator) \ - V(TestTypeOf, ImplicitRegisterUse::kReadWriteAccumulator, \ - OperandType::kFlag8) \ \ /* Cast operators */ \ V(ToName, ImplicitRegisterUse::kReadAccumulator, OperandType::kRegOut) \ @@ -650,25 +649,17 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic { // Return true if |bytecode| is an accumulator load without effects, // e.g. LdaConstant, LdaTrue, Ldar. static constexpr bool IsAccumulatorLoadWithoutEffects(Bytecode bytecode) { - return bytecode == Bytecode::kLdar || bytecode == Bytecode::kLdaZero || - bytecode == Bytecode::kLdaSmi || bytecode == Bytecode::kLdaNull || - bytecode == Bytecode::kLdaTrue || bytecode == Bytecode::kLdaFalse || - bytecode == Bytecode::kLdaUndefined || - bytecode == Bytecode::kLdaTheHole || - bytecode == Bytecode::kLdaConstant || - bytecode == Bytecode::kLdaContextSlot || - bytecode == Bytecode::kLdaCurrentContextSlot || - bytecode == Bytecode::kLdaImmutableContextSlot || - bytecode == Bytecode::kLdaImmutableCurrentContextSlot; + STATIC_ASSERT(Bytecode::kLdar < Bytecode::kLdaImmutableCurrentContextSlot); + return bytecode >= Bytecode::kLdar && + bytecode <= Bytecode::kLdaImmutableCurrentContextSlot; } // Returns true if |bytecode| is a compare operation without external effects // (e.g., Type cooersion). static constexpr bool IsCompareWithoutEffects(Bytecode bytecode) { - return bytecode == Bytecode::kTestUndetectable || - bytecode == Bytecode::kTestNull || - bytecode == Bytecode::kTestUndefined || - bytecode == Bytecode::kTestTypeOf; + STATIC_ASSERT(Bytecode::kTestReferenceEqual < Bytecode::kTestTypeOf); + return bytecode >= Bytecode::kTestReferenceEqual && + bytecode <= Bytecode::kTestTypeOf; } static constexpr bool IsShortStar(Bytecode bytecode) { @@ -683,8 +674,8 @@ class V8_EXPORT_PRIVATE Bytecodes final : public AllStatic { // Return true if |bytecode| is a register load without effects, // e.g. Mov, Star. static constexpr bool IsRegisterLoadWithoutEffects(Bytecode bytecode) { - return bytecode == Bytecode::kMov || bytecode == Bytecode::kPopContext || - bytecode == Bytecode::kPushContext || IsAnyStar(bytecode); + return IsShortStar(bytecode) || + (bytecode >= Bytecode::kStar && bytecode <= Bytecode::kPopContext); } // Returns true if the bytecode is a conditional jump taking diff --git a/deps/v8/src/interpreter/constant-array-builder.cc b/deps/v8/src/interpreter/constant-array-builder.cc index 4142d3a7ca..260a75448d 100644 --- a/deps/v8/src/interpreter/constant-array-builder.cc +++ b/deps/v8/src/interpreter/constant-array-builder.cc @@ -65,9 +65,9 @@ const ConstantArrayBuilder::Entry& ConstantArrayBuilder::ConstantArraySlice::At( } #if DEBUG -template <typename LocalIsolate> +template <typename IsolateT> void ConstantArrayBuilder::ConstantArraySlice::CheckAllElementsAreUnique( - LocalIsolate* isolate) const { + IsolateT* isolate) const { std::set<Smi> smis; std::set<double> heap_numbers; std::set<const AstRawString*> strings; @@ -164,9 +164,9 @@ ConstantArrayBuilder::ConstantArraySlice* ConstantArrayBuilder::IndexToSlice( UNREACHABLE(); } -template <typename LocalIsolate> +template <typename IsolateT> MaybeHandle<Object> ConstantArrayBuilder::At(size_t index, - LocalIsolate* isolate) const { + IsolateT* isolate) const { const ConstantArraySlice* slice = IndexToSlice(index); DCHECK_LT(index, slice->capacity()); if (index < slice->start_index() + slice->size()) { @@ -183,8 +183,8 @@ template EXPORT_TEMPLATE_DEFINE(V8_EXPORT_PRIVATE) MaybeHandle<Object> ConstantArrayBuilder::At(size_t index, LocalIsolate* isolate) const; -template <typename LocalIsolate> -Handle<FixedArray> ConstantArrayBuilder::ToFixedArray(LocalIsolate* isolate) { +template <typename IsolateT> +Handle<FixedArray> ConstantArrayBuilder::ToFixedArray(IsolateT* isolate) { Handle<FixedArray> fixed_array = isolate->factory()->NewFixedArrayWithHoles( static_cast<int>(size()), AllocationType::kOld); int array_index = 0; @@ -372,9 +372,8 @@ void ConstantArrayBuilder::DiscardReservedEntry(OperandSize operand_size) { OperandSizeToSlice(operand_size)->Unreserve(); } -template <typename LocalIsolate> -Handle<Object> ConstantArrayBuilder::Entry::ToHandle( - LocalIsolate* isolate) const { +template <typename IsolateT> +Handle<Object> ConstantArrayBuilder::Entry::ToHandle(IsolateT* isolate) const { switch (tag_) { case Tag::kDeferred: // We shouldn't have any deferred entries by now. diff --git a/deps/v8/src/interpreter/constant-array-builder.h b/deps/v8/src/interpreter/constant-array-builder.h index b17995f0a1..2120142a12 100644 --- a/deps/v8/src/interpreter/constant-array-builder.h +++ b/deps/v8/src/interpreter/constant-array-builder.h @@ -52,16 +52,16 @@ class V8_EXPORT_PRIVATE ConstantArrayBuilder final { explicit ConstantArrayBuilder(Zone* zone); // Generate a fixed array of constant handles based on inserted objects. - template <typename LocalIsolate> + template <typename IsolateT> EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) - Handle<FixedArray> ToFixedArray(LocalIsolate* isolate); + Handle<FixedArray> ToFixedArray(IsolateT* isolate); // Returns the object, as a handle in |isolate|, that is in the constant pool // array at index |index|. Returns null if there is no handle at this index. // Only expected to be used in tests. - template <typename LocalIsolate> + template <typename IsolateT> EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) - MaybeHandle<Object> At(size_t index, LocalIsolate* isolate) const; + MaybeHandle<Object> At(size_t index, IsolateT* isolate) const; // Returns the number of elements in the array. size_t size() const; @@ -154,8 +154,8 @@ class V8_EXPORT_PRIVATE ConstantArrayBuilder final { smi_ = smi; } - template <typename LocalIsolate> - Handle<Object> ToHandle(LocalIsolate* isolate) const; + template <typename IsolateT> + Handle<Object> ToHandle(IsolateT* isolate) const; private: explicit Entry(Tag tag) : tag_(tag) {} @@ -207,8 +207,8 @@ class V8_EXPORT_PRIVATE ConstantArrayBuilder final { const Entry& At(size_t index) const; #if DEBUG - template <typename LocalIsolate> - void CheckAllElementsAreUnique(LocalIsolate* isolate) const; + template <typename IsolateT> + void CheckAllElementsAreUnique(IsolateT* isolate) const; #endif inline size_t available() const { return capacity() - reserved() - size(); } diff --git a/deps/v8/src/interpreter/handler-table-builder.cc b/deps/v8/src/interpreter/handler-table-builder.cc index 56f5b849dc..1a88b2ab07 100644 --- a/deps/v8/src/interpreter/handler-table-builder.cc +++ b/deps/v8/src/interpreter/handler-table-builder.cc @@ -15,8 +15,8 @@ namespace interpreter { HandlerTableBuilder::HandlerTableBuilder(Zone* zone) : entries_(zone) {} -template <typename LocalIsolate> -Handle<ByteArray> HandlerTableBuilder::ToHandlerTable(LocalIsolate* isolate) { +template <typename IsolateT> +Handle<ByteArray> HandlerTableBuilder::ToHandlerTable(IsolateT* isolate) { int handler_table_size = static_cast<int>(entries_.size()); Handle<ByteArray> table_byte_array = isolate->factory()->NewByteArray( HandlerTable::LengthForRange(handler_table_size), AllocationType::kOld); diff --git a/deps/v8/src/interpreter/handler-table-builder.h b/deps/v8/src/interpreter/handler-table-builder.h index f5f264d7c7..8670fc0492 100644 --- a/deps/v8/src/interpreter/handler-table-builder.h +++ b/deps/v8/src/interpreter/handler-table-builder.h @@ -30,8 +30,8 @@ class V8_EXPORT_PRIVATE HandlerTableBuilder final { // Builds the actual handler table by copying the current values into a heap // object. Any further mutations to the builder won't be reflected. - template <typename LocalIsolate> - Handle<ByteArray> ToHandlerTable(LocalIsolate* isolate); + template <typename IsolateT> + Handle<ByteArray> ToHandlerTable(IsolateT* isolate); // Creates a new handler table entry and returns a {hander_id} identifying the // entry, so that it can be referenced by below setter functions. diff --git a/deps/v8/src/interpreter/interpreter-assembler.cc b/deps/v8/src/interpreter/interpreter-assembler.cc index df5b525877..f6733def8e 100644 --- a/deps/v8/src/interpreter/interpreter-assembler.cc +++ b/deps/v8/src/interpreter/interpreter-assembler.cc @@ -8,7 +8,7 @@ #include <ostream> #include "src/codegen/code-factory.h" -#include "src/codegen/interface-descriptors.h" +#include "src/codegen/interface-descriptors-inl.h" #include "src/codegen/machine-type.h" #include "src/execution/frames.h" #include "src/interpreter/bytecodes.h" @@ -803,7 +803,9 @@ void InterpreterAssembler::CallJSWithSpreadAndDispatch( TNode<UintPtrT> slot_id, TNode<HeapObject> maybe_feedback_vector) { DCHECK(Bytecodes::MakesCallAlongCriticalPath(bytecode_)); DCHECK_EQ(Bytecodes::GetReceiverMode(bytecode_), ConvertReceiverMode::kAny); - CollectCallFeedback(function, context, maybe_feedback_vector, slot_id); + LazyNode<Object> receiver = [=] { return LoadRegisterAtOperandIndex(1); }; + CollectCallFeedback(function, receiver, context, maybe_feedback_vector, + slot_id); Comment("call using CallWithSpread builtin"); Callable callable = CodeFactory::InterpreterPushArgsThenCall( isolate(), ConvertReceiverMode::kAny, @@ -1310,26 +1312,6 @@ void InterpreterAssembler::AbortIfWordNotEqual(TNode<WordT> lhs, BIND(&ok); } -void InterpreterAssembler::MaybeDropFrames(TNode<Context> context) { - TNode<ExternalReference> restart_fp_address = - ExternalConstant(ExternalReference::debug_restart_fp_address(isolate())); - - TNode<IntPtrT> restart_fp = Load<IntPtrT>(restart_fp_address); - TNode<IntPtrT> null = IntPtrConstant(0); - - Label ok(this), drop_frames(this); - Branch(IntPtrEqual(restart_fp, null), &ok, &drop_frames); - - BIND(&drop_frames); - // We don't expect this call to return since the frame dropper tears down - // the stack and jumps into the function on the target frame to restart it. - CallStub(CodeFactory::FrameDropperTrampoline(isolate()), context, restart_fp); - Abort(AbortReason::kUnexpectedReturnFromFrameDropper); - Goto(&ok); - - BIND(&ok); -} - void InterpreterAssembler::OnStackReplacement(TNode<Context> context, TNode<IntPtrT> relative_jump) { TNode<JSFunction> function = CAST(LoadRegister(Register::function_closure())); diff --git a/deps/v8/src/interpreter/interpreter-assembler.h b/deps/v8/src/interpreter/interpreter-assembler.h index 019fd40f3b..bf4641200b 100644 --- a/deps/v8/src/interpreter/interpreter-assembler.h +++ b/deps/v8/src/interpreter/interpreter-assembler.h @@ -241,9 +241,6 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler { TNode<FixedArrayBase> parameters_and_registers, TNode<IntPtrT> formal_parameter_count, TNode<UintPtrT> register_count); - // Dispatch to frame dropper trampoline if necessary. - void MaybeDropFrames(TNode<Context> context); - // Perform OnStackReplacement. void OnStackReplacement(TNode<Context> context, TNode<IntPtrT> relative_jump); diff --git a/deps/v8/src/interpreter/interpreter-generator.cc b/deps/v8/src/interpreter/interpreter-generator.cc index cb01348a35..75027b96b7 100644 --- a/deps/v8/src/interpreter/interpreter-generator.cc +++ b/deps/v8/src/interpreter/interpreter-generator.cc @@ -209,7 +209,7 @@ IGNITION_HANDLER(LdaGlobal, InterpreterLoadGlobalAssembler) { static const int kNameOperandIndex = 0; static const int kSlotOperandIndex = 1; - LdaGlobal(kSlotOperandIndex, kNameOperandIndex, NOT_INSIDE_TYPEOF); + LdaGlobal(kSlotOperandIndex, kNameOperandIndex, TypeofMode::kNotInside); } // LdaGlobalInsideTypeof <name_index> <slot> @@ -220,7 +220,7 @@ IGNITION_HANDLER(LdaGlobalInsideTypeof, InterpreterLoadGlobalAssembler) { static const int kNameOperandIndex = 0; static const int kSlotOperandIndex = 1; - LdaGlobal(kSlotOperandIndex, kNameOperandIndex, INSIDE_TYPEOF); + LdaGlobal(kSlotOperandIndex, kNameOperandIndex, TypeofMode::kInside); } // StaGlobal <name_index> <slot> @@ -418,8 +418,8 @@ class InterpreterLookupGlobalAssembler : public InterpreterLoadGlobalAssembler { TypeofMode typeof_mode = function_id == Runtime::kLoadLookupSlotInsideTypeof - ? INSIDE_TYPEOF - : NOT_INSIDE_TYPEOF; + ? TypeofMode::kInside + : TypeofMode::kNotInside; LdaGlobal(kSlotOperandIndex, kNameOperandIndex, typeof_mode); } @@ -1365,13 +1365,19 @@ class InterpreterJSCallAssembler : public InterpreterAssembler { // Generates code to perform a JS call that collects type feedback. void JSCall(ConvertReceiverMode receiver_mode) { TNode<Object> function = LoadRegisterAtOperandIndex(0); + LazyNode<Object> receiver = [=] { + return receiver_mode == ConvertReceiverMode::kNullOrUndefined + ? UndefinedConstant() + : LoadRegisterAtOperandIndex(1); + }; RegListNodePair args = GetRegisterListAtOperandIndex(1); TNode<UintPtrT> slot_id = BytecodeOperandIdx(3); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<Context> context = GetContext(); // Collect the {function} feedback. - CollectCallFeedback(function, context, maybe_feedback_vector, slot_id); + CollectCallFeedback(function, receiver, context, maybe_feedback_vector, + slot_id); // Call the function and dispatch to the next handler. CallJSAndDispatch(function, context, args, receiver_mode); @@ -1399,12 +1405,18 @@ class InterpreterJSCallAssembler : public InterpreterAssembler { kFirstArgumentOperandIndex + kReceiverAndArgOperandCount; TNode<Object> function = LoadRegisterAtOperandIndex(0); + LazyNode<Object> receiver = [=] { + return receiver_mode == ConvertReceiverMode::kNullOrUndefined + ? UndefinedConstant() + : LoadRegisterAtOperandIndex(1); + }; TNode<UintPtrT> slot_id = BytecodeOperandIdx(kSlotOperandIndex); TNode<HeapObject> maybe_feedback_vector = LoadFeedbackVector(); TNode<Context> context = GetContext(); // Collect the {function} feedback. - CollectCallFeedback(function, context, maybe_feedback_vector, slot_id); + CollectCallFeedback(function, receiver, context, maybe_feedback_vector, + slot_id); switch (kReceiverAndArgOperandCount) { case 0: @@ -2776,7 +2788,7 @@ IGNITION_HANDLER(ThrowIfNotSuperConstructor, InterpreterAssembler) { // Call runtime to handle debugger statement. IGNITION_HANDLER(Debugger, InterpreterAssembler) { TNode<Context> context = GetContext(); - CallStub(CodeFactory::HandleDebuggerStatement(isolate()), context); + CallRuntime(Runtime::kHandleDebuggerStatement, context); Dispatch(); } @@ -2791,7 +2803,6 @@ IGNITION_HANDLER(Debugger, InterpreterAssembler) { Runtime::kDebugBreakOnBytecode, context, accumulator); \ TNode<Object> return_value = Projection<0>(result_pair); \ TNode<IntPtrT> original_bytecode = SmiUntag(Projection<1>(result_pair)); \ - MaybeDropFrames(context); \ SetAccumulator(return_value); \ DispatchToBytecodeWithOptionalStarLookahead(original_bytecode); \ } diff --git a/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc b/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc index b6ea44f6e7..c98f78f878 100644 --- a/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc +++ b/deps/v8/src/interpreter/interpreter-intrinsics-generator.cc @@ -213,12 +213,6 @@ TNode<Object> IntrinsicsGenerator::HasProperty( arg_count); } -TNode<Object> IntrinsicsGenerator::ToString( - const InterpreterAssembler::RegListNodePair& args, TNode<Context> context, - int arg_count) { - return IntrinsicAsBuiltinCall(args, context, Builtins::kToString, arg_count); -} - TNode<Object> IntrinsicsGenerator::ToLength( const InterpreterAssembler::RegListNodePair& args, TNode<Context> context, int arg_count) { diff --git a/deps/v8/src/interpreter/interpreter-intrinsics.h b/deps/v8/src/interpreter/interpreter-intrinsics.h index 07c60270c2..85c54f67f1 100644 --- a/deps/v8/src/interpreter/interpreter-intrinsics.h +++ b/deps/v8/src/interpreter/interpreter-intrinsics.h @@ -36,7 +36,6 @@ namespace interpreter { V(IsArray, is_array, 1) \ V(IsJSReceiver, is_js_receiver, 1) \ V(IsSmi, is_smi, 1) \ - V(ToString, to_string, 1) \ V(ToLength, to_length, 1) \ V(ToObject, to_object, 1) diff --git a/deps/v8/src/interpreter/interpreter.cc b/deps/v8/src/interpreter/interpreter.cc index ddce0f0e4e..36f2c54614 100644 --- a/deps/v8/src/interpreter/interpreter.cc +++ b/deps/v8/src/interpreter/interpreter.cc @@ -18,7 +18,6 @@ #include "src/init/setup-isolate.h" #include "src/interpreter/bytecode-generator.h" #include "src/interpreter/bytecodes.h" -#include "src/logging/counters-inl.h" #include "src/objects/objects-inl.h" #include "src/objects/shared-function-info.h" #include "src/objects/slots.h" @@ -50,14 +49,13 @@ class InterpreterCompilationJob final : public UnoptimizedCompilationJob { private: BytecodeGenerator* generator() { return &generator_; } - template <typename LocalIsolate> - void CheckAndPrintBytecodeMismatch(LocalIsolate* isolate, - Handle<Script> script, + template <typename IsolateT> + void CheckAndPrintBytecodeMismatch(IsolateT* isolate, Handle<Script> script, Handle<BytecodeArray> bytecode); - template <typename LocalIsolate> + template <typename IsolateT> Status DoFinalizeJobImpl(Handle<SharedFunctionInfo> shared_info, - LocalIsolate* isolate); + IsolateT* isolate); Zone zone_; UnoptimizedCompilationInfo compilation_info_; @@ -177,10 +175,9 @@ InterpreterCompilationJob::InterpreterCompilationJob( eager_inner_literals) {} InterpreterCompilationJob::Status InterpreterCompilationJob::ExecuteJobImpl() { - RuntimeCallTimerScope runtimeTimerScope( - parse_info()->runtime_call_stats(), - RuntimeCallCounterId::kCompileIgnition, - RuntimeCallStats::kThreadSpecific); + RCS_SCOPE(parse_info()->runtime_call_stats(), + RuntimeCallCounterId::kCompileIgnition, + RuntimeCallStats::kThreadSpecific); // TODO(lpy): add support for background compilation RCS trace. TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileIgnition"); @@ -203,10 +200,9 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::ExecuteJobImpl() { } #ifdef DEBUG -template <typename LocalIsolate> +template <typename IsolateT> void InterpreterCompilationJob::CheckAndPrintBytecodeMismatch( - LocalIsolate* isolate, Handle<Script> script, - Handle<BytecodeArray> bytecode) { + IsolateT* isolate, Handle<Script> script, Handle<BytecodeArray> bytecode) { int first_mismatch = generator()->CheckBytecodeMatches(*bytecode); if (first_mismatch >= 0) { parse_info()->ast_value_factory()->Internalize(isolate); @@ -243,9 +239,8 @@ void InterpreterCompilationJob::CheckAndPrintBytecodeMismatch( InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl( Handle<SharedFunctionInfo> shared_info, Isolate* isolate) { - RuntimeCallTimerScope runtimeTimerScope( - parse_info()->runtime_call_stats(), - RuntimeCallCounterId::kCompileIgnitionFinalization); + RCS_SCOPE(parse_info()->runtime_call_stats(), + RuntimeCallCounterId::kCompileIgnitionFinalization); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileIgnitionFinalization"); return DoFinalizeJobImpl(shared_info, isolate); @@ -253,17 +248,16 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl( InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl( Handle<SharedFunctionInfo> shared_info, LocalIsolate* isolate) { - RuntimeCallTimerScope runtimeTimerScope( - parse_info()->runtime_call_stats(), - RuntimeCallCounterId::kCompileBackgroundIgnitionFinalization); + RCS_SCOPE(parse_info()->runtime_call_stats(), + RuntimeCallCounterId::kCompileBackgroundIgnitionFinalization); TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileIgnitionFinalization"); return DoFinalizeJobImpl(shared_info, isolate); } -template <typename LocalIsolate> +template <typename IsolateT> InterpreterCompilationJob::Status InterpreterCompilationJob::DoFinalizeJobImpl( - Handle<SharedFunctionInfo> shared_info, LocalIsolate* isolate) { + Handle<SharedFunctionInfo> shared_info, IsolateT* isolate) { Handle<BytecodeArray> bytecodes = compilation_info_.bytecode_array(); if (bytecodes.is_null()) { bytecodes = generator()->FinalizeBytecode( |