| Index: src/interpreter/interpreter.cc
|
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
|
| index 422b5c16eee1700b8dbbe7b354e8790ed81707d1..132a62b315a78104c88be1f1389524402e82b89f 100644
|
| --- a/src/interpreter/interpreter.cc
|
| +++ b/src/interpreter/interpreter.cc
|
| @@ -23,7 +23,7 @@ using compiler::Node;
|
| #define __ assembler->
|
|
|
| Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) {
|
| - memset(&dispatch_table_, 0, sizeof(dispatch_table_));
|
| + memset(dispatch_table_, 0, sizeof(dispatch_table_));
|
| }
|
|
|
| void Interpreter::Initialize() {
|
| @@ -32,24 +32,59 @@ void Interpreter::Initialize() {
|
| Zone zone;
|
| HandleScope scope(isolate_);
|
|
|
| -#define GENERATE_CODE(Name, ...) \
|
| - { \
|
| - InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name); \
|
| - Do##Name(&assembler); \
|
| - Handle<Code> code = assembler.GenerateCode(); \
|
| - TraceCodegen(code, #Name); \
|
| - LOG_CODE_EVENT(isolate_, \
|
| - CodeCreateEvent(Logger::BYTECODE_HANDLER_TAG, \
|
| - AbstractCode::cast(*code), #Name)); \
|
| - dispatch_table_[Bytecodes::ToByte(Bytecode::k##Name)] = *code; \
|
| + for (uint32_t i = 0; i < kNumberOfWideVariants; ++i) {
|
| +#define GENERATE_CODE(Name, ...) \
|
| + { \
|
| + if (i == 0 || \
|
| + Bytecodes::IsBytecodeWithScalableOperands(Bytecode::k##Name)) { \
|
| + InterpreterAssembler assembler(isolate_, &zone, Bytecode::k##Name, \
|
| + 1 << i); \
|
| + Do##Name(&assembler); \
|
| + Handle<Code> code = assembler.GenerateCode(); \
|
| + TraceCodegen(code, #Name); \
|
| + LOG_CODE_EVENT(isolate_, \
|
| + CodeCreateEvent(Logger::BYTECODE_HANDLER_TAG, \
|
| + AbstractCode::cast(*code), #Name)); \
|
| + size_t index = GetDispatchTableIndex(Bytecode::k##Name, i); \
|
| + dispatch_table_[index] = *code; \
|
| + } \
|
| }
|
| - BYTECODE_LIST(GENERATE_CODE)
|
| + BYTECODE_LIST(GENERATE_CODE)
|
| #undef GENERATE_CODE
|
| + }
|
| +
|
| + size_t illegal_index = GetDispatchTableIndex(Bytecode::kIllegal, 0);
|
| + for (size_t index = 0; index < arraysize(dispatch_table_); ++index) {
|
| + if (dispatch_table_[index] == nullptr) {
|
| + dispatch_table_[index] = dispatch_table_[illegal_index];
|
| + }
|
| + }
|
| }
|
|
|
| -Code* Interpreter::GetBytecodeHandler(Bytecode bytecode) {
|
| +Code* Interpreter::GetBytecodeHandler(Bytecode bytecode, int operand_scale) {
|
| DCHECK(IsDispatchTableInitialized());
|
| - return dispatch_table_[Bytecodes::ToByte(bytecode)];
|
| + uint32_t scale = static_cast<uint32_t>(operand_scale);
|
| + DCHECK(base::bits::IsPowerOfTwo32(scale));
|
| + size_t index =
|
| + GetDispatchTableIndex(bytecode, base::bits::CountTrailingZeros32(scale));
|
| + Code* handler = dispatch_table_[index];
|
| + Code* invalid_handler =
|
| + dispatch_table_[Bytecodes::ToByte(Bytecode::kIllegal)];
|
| + if (handler != invalid_handler ||
|
| + (operand_scale == 1 && bytecode <= Bytecode::kLast)) {
|
| + return handler;
|
| + } else {
|
| + return nullptr;
|
| + }
|
| +}
|
| +
|
| +size_t Interpreter::GetDispatchTableIndex(Bytecode bytecode,
|
| + uint32_t operand_scale_log2) {
|
| + static const int kEntriesPerOperandScale = kMaxUInt8 + 1;
|
| + size_t index = operand_scale_log2 * kEntriesPerOperandScale +
|
| + static_cast<size_t>(bytecode);
|
| + DCHECK_LE(index, arraysize(dispatch_table_));
|
| + return index;
|
| }
|
|
|
| void Interpreter::IterateDispatchTable(ObjectVisitor* v) {
|
| @@ -135,11 +170,10 @@ void Interpreter::DoLdaZero(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| -// LdaSmi8 <imm8>
|
| +// LdaSmi <imm>
|
| //
|
| -// Load an 8-bit integer literal into the accumulator as a Smi.
|
| -void Interpreter::DoLdaSmi8(InterpreterAssembler* assembler) {
|
| +// Load an integer literal into the accumulator as a Smi.
|
| +void Interpreter::DoLdaSmi(InterpreterAssembler* assembler) {
|
| Node* raw_int = __ BytecodeOperandImm(0);
|
| Node* smi_int = __ SmiTag(raw_int);
|
| __ SetAccumulator(smi_int);
|
| @@ -161,15 +195,6 @@ void Interpreter::DoLdaConstant(InterpreterAssembler* assembler) {
|
| DoLoadConstant(assembler);
|
| }
|
|
|
| -
|
| -// LdaConstantWide <idx>
|
| -//
|
| -// Load constant literal at |idx| in the constant pool into the accumulator.
|
| -void Interpreter::DoLdaConstantWide(InterpreterAssembler* assembler) {
|
| - DoLoadConstant(assembler);
|
| -}
|
| -
|
| -
|
| // LdaUndefined
|
| //
|
| // Load Undefined into the accumulator.
|
| @@ -255,13 +280,6 @@ void Interpreter::DoMov(InterpreterAssembler* assembler) {
|
| }
|
|
|
|
|
| -// MovWide <src> <dst>
|
| -//
|
| -// Stores the value of register <src> to register <dst>.
|
| -void Interpreter::DoMovWide(InterpreterAssembler* assembler) {
|
| - DoMov(assembler);
|
| -}
|
| -
|
| void Interpreter::DoLoadGlobal(Callable ic, InterpreterAssembler* assembler) {
|
| // Get the global object.
|
| Node* context = __ GetContext();
|
| @@ -302,27 +320,6 @@ void Interpreter::DoLdaGlobalInsideTypeof(InterpreterAssembler* assembler) {
|
| DoLoadGlobal(ic, assembler);
|
| }
|
|
|
| -// LdaGlobalWide <name_index> <slot>
|
| -//
|
| -// Load the global with name in constant pool entry <name_index> into the
|
| -// accumulator using FeedBackVector slot <slot> outside of a typeof.
|
| -void Interpreter::DoLdaGlobalWide(InterpreterAssembler* assembler) {
|
| - Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
|
| - UNINITIALIZED);
|
| - DoLoadGlobal(ic, assembler);
|
| -}
|
| -
|
| -// LdaGlobalInsideTypeofWide <name_index> <slot>
|
| -//
|
| -// Load the global with name in constant pool entry <name_index> into the
|
| -// accumulator using FeedBackVector slot <slot> inside of a typeof.
|
| -void Interpreter::DoLdaGlobalInsideTypeofWide(InterpreterAssembler* assembler) {
|
| - Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, INSIDE_TYPEOF,
|
| - UNINITIALIZED);
|
| - DoLoadGlobal(ic, assembler);
|
| -}
|
| -
|
| -
|
| void Interpreter::DoStoreGlobal(Callable ic, InterpreterAssembler* assembler) {
|
| // Get the global object.
|
| Node* context = __ GetContext();
|
| @@ -340,7 +337,6 @@ void Interpreter::DoStoreGlobal(Callable ic, InterpreterAssembler* assembler) {
|
| Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| __ CallStub(ic.descriptor(), code_target, context, global, name, value,
|
| smi_slot, type_feedback_vector);
|
| -
|
| __ Dispatch();
|
| }
|
|
|
| @@ -366,29 +362,6 @@ void Interpreter::DoStaGlobalStrict(InterpreterAssembler* assembler) {
|
| DoStoreGlobal(ic, assembler);
|
| }
|
|
|
| -
|
| -// StaGlobalSloppyWide <name_index> <slot>
|
| -//
|
| -// Store the value in the accumulator into the global with name in constant pool
|
| -// entry <name_index> using FeedBackVector slot <slot> in sloppy mode.
|
| -void Interpreter::DoStaGlobalSloppyWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::StoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| - DoStoreGlobal(ic, assembler);
|
| -}
|
| -
|
| -
|
| -// StaGlobalStrictWide <name_index> <slot>
|
| -//
|
| -// Store the value in the accumulator into the global with name in constant pool
|
| -// entry <name_index> using FeedBackVector slot <slot> in strict mode.
|
| -void Interpreter::DoStaGlobalStrictWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::StoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| - DoStoreGlobal(ic, assembler);
|
| -}
|
| -
|
| -
|
| // LdaContextSlot <context> <slot_index>
|
| //
|
| // Load the object in |slot_index| of |context| into the accumulator.
|
| @@ -401,15 +374,6 @@ void Interpreter::DoLdaContextSlot(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| -// LdaContextSlotWide <context> <slot_index>
|
| -//
|
| -// Load the object in |slot_index| of |context| into the accumulator.
|
| -void Interpreter::DoLdaContextSlotWide(InterpreterAssembler* assembler) {
|
| - DoLdaContextSlot(assembler);
|
| -}
|
| -
|
| -
|
| // StaContextSlot <context> <slot_index>
|
| //
|
| // Stores the object in the accumulator into |slot_index| of |context|.
|
| @@ -422,14 +386,6 @@ void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| -// StaContextSlot <context> <slot_index>
|
| -//
|
| -// Stores the object in the accumulator into |slot_index| of |context|.
|
| -void Interpreter::DoStaContextSlotWide(InterpreterAssembler* assembler) {
|
| - DoStaContextSlot(assembler);
|
| -}
|
| -
|
| void Interpreter::DoLoadLookupSlot(Runtime::FunctionId function_id,
|
| InterpreterAssembler* assembler) {
|
| Node* index = __ BytecodeOperandIdx(0);
|
| @@ -440,7 +396,6 @@ void Interpreter::DoLoadLookupSlot(Runtime::FunctionId function_id,
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| // LdaLookupSlot <name_index>
|
| //
|
| // Lookup the object with the name in constant pool entry |name_index|
|
| @@ -449,7 +404,6 @@ void Interpreter::DoLdaLookupSlot(InterpreterAssembler* assembler) {
|
| DoLoadLookupSlot(Runtime::kLoadLookupSlot, assembler);
|
| }
|
|
|
| -
|
| // LdaLookupSlotInsideTypeof <name_index>
|
| //
|
| // Lookup the object with the name in constant pool entry |name_index|
|
| @@ -458,25 +412,6 @@ void Interpreter::DoLdaLookupSlotInsideTypeof(InterpreterAssembler* assembler) {
|
| DoLoadLookupSlot(Runtime::kLoadLookupSlotInsideTypeof, assembler);
|
| }
|
|
|
| -
|
| -// LdaLookupSlotWide <name_index>
|
| -//
|
| -// Lookup the object with the name in constant pool entry |name_index|
|
| -// dynamically.
|
| -void Interpreter::DoLdaLookupSlotWide(InterpreterAssembler* assembler) {
|
| - DoLdaLookupSlot(assembler);
|
| -}
|
| -
|
| -
|
| -// LdaLookupSlotInsideTypeofWide <name_index>
|
| -//
|
| -// Lookup the object with the name in constant pool entry |name_index|
|
| -// dynamically without causing a NoReferenceError.
|
| -void Interpreter::DoLdaLookupSlotInsideTypeofWide(
|
| - InterpreterAssembler* assembler) {
|
| - DoLdaLookupSlotInsideTypeof(assembler);
|
| -}
|
| -
|
| void Interpreter::DoStoreLookupSlot(LanguageMode language_mode,
|
| InterpreterAssembler* assembler) {
|
| Node* value = __ GetAccumulator();
|
| @@ -491,7 +426,6 @@ void Interpreter::DoStoreLookupSlot(LanguageMode language_mode,
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| // StaLookupSlotSloppy <name_index>
|
| //
|
| // Store the object in accumulator to the object with the name in constant
|
| @@ -509,24 +443,6 @@ void Interpreter::DoStaLookupSlotStrict(InterpreterAssembler* assembler) {
|
| DoStoreLookupSlot(LanguageMode::STRICT, assembler);
|
| }
|
|
|
| -
|
| -// StaLookupSlotSloppyWide <name_index>
|
| -//
|
| -// Store the object in accumulator to the object with the name in constant
|
| -// pool entry |name_index| in sloppy mode.
|
| -void Interpreter::DoStaLookupSlotSloppyWide(InterpreterAssembler* assembler) {
|
| - DoStaLookupSlotSloppy(assembler);
|
| -}
|
| -
|
| -
|
| -// StaLookupSlotStrictWide <name_index>
|
| -//
|
| -// Store the object in accumulator to the object with the name in constant
|
| -// pool entry |name_index| in strict mode.
|
| -void Interpreter::DoStaLookupSlotStrictWide(InterpreterAssembler* assembler) {
|
| - DoStaLookupSlotStrict(assembler);
|
| -}
|
| -
|
| void Interpreter::DoLoadIC(Callable ic, InterpreterAssembler* assembler) {
|
| Node* code_target = __ HeapConstant(ic.code());
|
| Node* register_index = __ BytecodeOperandReg(0);
|
| @@ -553,17 +469,6 @@ void Interpreter::DoLoadIC(InterpreterAssembler* assembler) {
|
| DoLoadIC(ic, assembler);
|
| }
|
|
|
| -// LoadICWide <object> <name_index> <slot>
|
| -//
|
| -// Calls the LoadIC at FeedBackVector slot <slot> for <object> and the name at
|
| -// constant pool entry <name_index>.
|
| -void Interpreter::DoLoadICWide(InterpreterAssembler* assembler) {
|
| - Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
|
| - UNINITIALIZED);
|
| - DoLoadIC(ic, assembler);
|
| -}
|
| -
|
| -
|
| void Interpreter::DoKeyedLoadIC(Callable ic, InterpreterAssembler* assembler) {
|
| Node* code_target = __ HeapConstant(ic.code());
|
| Node* reg_index = __ BytecodeOperandReg(0);
|
| @@ -589,17 +494,6 @@ void Interpreter::DoKeyedLoadIC(InterpreterAssembler* assembler) {
|
| DoKeyedLoadIC(ic, assembler);
|
| }
|
|
|
| -// KeyedLoadICWide <object> <slot>
|
| -//
|
| -// Calls the KeyedLoadIC at FeedBackVector slot <slot> for <object> and the key
|
| -// in the accumulator.
|
| -void Interpreter::DoKeyedLoadICWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::KeyedLoadICInOptimizedCode(isolate_, UNINITIALIZED);
|
| - DoKeyedLoadIC(ic, assembler);
|
| -}
|
| -
|
| -
|
| void Interpreter::DoStoreIC(Callable ic, InterpreterAssembler* assembler) {
|
| Node* code_target = __ HeapConstant(ic.code());
|
| Node* object_reg_index = __ BytecodeOperandReg(0);
|
| @@ -640,30 +534,6 @@ void Interpreter::DoStoreICStrict(InterpreterAssembler* assembler) {
|
| DoStoreIC(ic, assembler);
|
| }
|
|
|
| -
|
| -// StoreICSloppyWide <object> <name_index> <slot>
|
| -//
|
| -// Calls the sloppy mode StoreIC at FeedBackVector slot <slot> for <object> and
|
| -// the name in constant pool entry <name_index> with the value in the
|
| -// accumulator.
|
| -void Interpreter::DoStoreICSloppyWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::StoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| - DoStoreIC(ic, assembler);
|
| -}
|
| -
|
| -
|
| -// StoreICStrictWide <object> <name_index> <slot>
|
| -//
|
| -// Calls the strict mode StoreIC at FeedBackVector slot <slot> for <object> and
|
| -// the name in constant pool entry <name_index> with the value in the
|
| -// accumulator.
|
| -void Interpreter::DoStoreICStrictWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::StoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| - DoStoreIC(ic, assembler);
|
| -}
|
| -
|
| void Interpreter::DoKeyedStoreIC(Callable ic, InterpreterAssembler* assembler) {
|
| Node* code_target = __ HeapConstant(ic.code());
|
| Node* object_reg_index = __ BytecodeOperandReg(0);
|
| @@ -702,28 +572,6 @@ void Interpreter::DoKeyedStoreICStrict(InterpreterAssembler* assembler) {
|
| DoKeyedStoreIC(ic, assembler);
|
| }
|
|
|
| -
|
| -// KeyedStoreICSloppyWide <object> <key> <slot>
|
| -//
|
| -// Calls the sloppy mode KeyStoreIC at FeedBackVector slot <slot> for <object>
|
| -// and the key <key> with the value in the accumulator.
|
| -void Interpreter::DoKeyedStoreICSloppyWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::KeyedStoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| - DoKeyedStoreIC(ic, assembler);
|
| -}
|
| -
|
| -
|
| -// KeyedStoreICStoreWide <object> <key> <slot>
|
| -//
|
| -// Calls the strict mode KeyStoreIC at FeedBackVector slot <slot> for <object>
|
| -// and the key <key> with the value in the accumulator.
|
| -void Interpreter::DoKeyedStoreICStrictWide(InterpreterAssembler* assembler) {
|
| - Callable ic =
|
| - CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| - DoKeyedStoreIC(ic, assembler);
|
| -}
|
| -
|
| // PushContext <context>
|
| //
|
| // Saves the current context in <context>, and pushes the accumulator as the
|
| @@ -997,15 +845,6 @@ void Interpreter::DoCall(InterpreterAssembler* assembler) {
|
| DoJSCall(assembler, TailCallMode::kDisallow);
|
| }
|
|
|
| -
|
| -// CallWide <callable> <receiver> <arg_count>
|
| -//
|
| -// Call a JSfunction or Callable in |callable| with the |receiver| and
|
| -// |arg_count| arguments in subsequent registers.
|
| -void Interpreter::DoCallWide(InterpreterAssembler* assembler) {
|
| - DoJSCall(assembler, TailCallMode::kDisallow);
|
| -}
|
| -
|
| // TailCall <callable> <receiver> <arg_count>
|
| //
|
| // Tail call a JSfunction or Callable in |callable| with the |receiver| and
|
| @@ -1014,16 +853,8 @@ void Interpreter::DoTailCall(InterpreterAssembler* assembler) {
|
| DoJSCall(assembler, TailCallMode::kAllow);
|
| }
|
|
|
| -// TailCallWide <callable> <receiver> <arg_count>
|
| -//
|
| -// Tail call a JSfunction or Callable in |callable| with the |receiver| and
|
| -// |arg_count| arguments in subsequent registers.
|
| -void Interpreter::DoTailCallWide(InterpreterAssembler* assembler) {
|
| - DoJSCall(assembler, TailCallMode::kAllow);
|
| -}
|
| -
|
| void Interpreter::DoCallRuntimeCommon(InterpreterAssembler* assembler) {
|
| - Node* function_id = __ BytecodeOperandIdx(0);
|
| + Node* function_id = __ BytecodeOperandRuntimeId(0);
|
| Node* first_arg_reg = __ BytecodeOperandReg(1);
|
| Node* first_arg = __ RegisterLocation(first_arg_reg);
|
| Node* args_count = __ BytecodeOperandCount(2);
|
| @@ -1043,19 +874,9 @@ void Interpreter::DoCallRuntime(InterpreterAssembler* assembler) {
|
| DoCallRuntimeCommon(assembler);
|
| }
|
|
|
| -
|
| -// CallRuntime <function_id> <first_arg> <arg_count>
|
| -//
|
| -// Call the runtime function |function_id| with the first argument in
|
| -// register |first_arg| and |arg_count| arguments in subsequent
|
| -// registers.
|
| -void Interpreter::DoCallRuntimeWide(InterpreterAssembler* assembler) {
|
| - DoCallRuntimeCommon(assembler);
|
| -}
|
| -
|
| void Interpreter::DoCallRuntimeForPairCommon(InterpreterAssembler* assembler) {
|
| // Call the runtime function.
|
| - Node* function_id = __ BytecodeOperandIdx(0);
|
| + Node* function_id = __ BytecodeOperandRuntimeId(0);
|
| Node* first_arg_reg = __ BytecodeOperandReg(1);
|
| Node* first_arg = __ RegisterLocation(first_arg_reg);
|
| Node* args_count = __ BytecodeOperandCount(2);
|
| @@ -1084,17 +905,6 @@ void Interpreter::DoCallRuntimeForPair(InterpreterAssembler* assembler) {
|
| DoCallRuntimeForPairCommon(assembler);
|
| }
|
|
|
| -
|
| -// CallRuntimeForPairWide <function_id> <first_arg> <arg_count> <first_return>
|
| -//
|
| -// Call the runtime function |function_id| which returns a pair, with the
|
| -// first argument in register |first_arg| and |arg_count| arguments in
|
| -// subsequent registers. Returns the result in <first_return> and
|
| -// <first_return + 1>
|
| -void Interpreter::DoCallRuntimeForPairWide(InterpreterAssembler* assembler) {
|
| - DoCallRuntimeForPairCommon(assembler);
|
| -}
|
| -
|
| void Interpreter::DoCallJSRuntimeCommon(InterpreterAssembler* assembler) {
|
| Node* context_index = __ BytecodeOperandIdx(0);
|
| Node* receiver_reg = __ BytecodeOperandReg(1);
|
| @@ -1125,15 +935,6 @@ void Interpreter::DoCallJSRuntime(InterpreterAssembler* assembler) {
|
| DoCallJSRuntimeCommon(assembler);
|
| }
|
|
|
| -
|
| -// CallJSRuntimeWide <context_index> <receiver> <arg_count>
|
| -//
|
| -// Call the JS runtime function that has the |context_index| with the receiver
|
| -// in register |receiver| and |arg_count| arguments in subsequent registers.
|
| -void Interpreter::DoCallJSRuntimeWide(InterpreterAssembler* assembler) {
|
| - DoCallJSRuntimeCommon(assembler);
|
| -}
|
| -
|
| void Interpreter::DoCallConstruct(InterpreterAssembler* assembler) {
|
| Callable ic = CodeFactory::InterpreterPushArgsAndConstruct(isolate_);
|
| Node* new_target = __ GetAccumulator();
|
| @@ -1160,18 +961,6 @@ void Interpreter::DoNew(InterpreterAssembler* assembler) {
|
| DoCallConstruct(assembler);
|
| }
|
|
|
| -
|
| -// NewWide <constructor> <first_arg> <arg_count>
|
| -//
|
| -// Call operator new with |constructor| and the first argument in
|
| -// register |first_arg| and |arg_count| arguments in subsequent
|
| -// registers. The new.target is in the accumulator.
|
| -//
|
| -void Interpreter::DoNewWide(InterpreterAssembler* assembler) {
|
| - DoCallConstruct(assembler);
|
| -}
|
| -
|
| -
|
| // TestEqual <src>
|
| //
|
| // Test if the value in the <src> register equals the accumulator.
|
| @@ -1281,19 +1070,17 @@ void Interpreter::DoToObject(InterpreterAssembler* assembler) {
|
| DoTypeConversionOp(CodeFactory::ToObject(isolate_), assembler);
|
| }
|
|
|
| -
|
| -// Jump <imm8>
|
| +// Jump <imm>
|
| //
|
| -// Jump by number of bytes represented by the immediate operand |imm8|.
|
| +// Jump by number of bytes represented by the immediate operand |imm|.
|
| void Interpreter::DoJump(InterpreterAssembler* assembler) {
|
| Node* relative_jump = __ BytecodeOperandImm(0);
|
| __ Jump(relative_jump);
|
| }
|
|
|
| -
|
| -// JumpConstant <idx8>
|
| +// JumpConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool.
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool.
|
| void Interpreter::DoJumpConstant(InterpreterAssembler* assembler) {
|
| Node* index = __ BytecodeOperandIdx(0);
|
| Node* constant = __ LoadConstantPoolEntry(index);
|
| @@ -1301,17 +1088,7 @@ void Interpreter::DoJumpConstant(InterpreterAssembler* assembler) {
|
| __ Jump(relative_jump);
|
| }
|
|
|
| -
|
| -// JumpConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the
|
| -// constant pool.
|
| -void Interpreter::DoJumpConstantWide(InterpreterAssembler* assembler) {
|
| - DoJumpConstant(assembler);
|
| -}
|
| -
|
| -
|
| -// JumpIfTrue <imm8>
|
| +// JumpIfTrue <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the
|
| // accumulator contains true.
|
| @@ -1322,10 +1099,9 @@ void Interpreter::DoJumpIfTrue(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, true_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfTrueConstant <idx8>
|
| +// JumpIfTrueConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the accumulator contains true.
|
| void Interpreter::DoJumpIfTrueConstant(InterpreterAssembler* assembler) {
|
| Node* accumulator = __ GetAccumulator();
|
| @@ -1336,17 +1112,7 @@ void Interpreter::DoJumpIfTrueConstant(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, true_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfTrueConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the accumulator contains true.
|
| -void Interpreter::DoJumpIfTrueConstantWide(InterpreterAssembler* assembler) {
|
| - DoJumpIfTrueConstant(assembler);
|
| -}
|
| -
|
| -
|
| -// JumpIfFalse <imm8>
|
| +// JumpIfFalse <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the
|
| // accumulator contains false.
|
| @@ -1357,10 +1123,9 @@ void Interpreter::DoJumpIfFalse(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, false_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfFalseConstant <idx8>
|
| +// JumpIfFalseConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the accumulator contains false.
|
| void Interpreter::DoJumpIfFalseConstant(InterpreterAssembler* assembler) {
|
| Node* accumulator = __ GetAccumulator();
|
| @@ -1371,17 +1136,7 @@ void Interpreter::DoJumpIfFalseConstant(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, false_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfFalseConstant <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the accumulator contains false.
|
| -void Interpreter::DoJumpIfFalseConstantWide(InterpreterAssembler* assembler) {
|
| - DoJumpIfFalseConstant(assembler);
|
| -}
|
| -
|
| -
|
| -// JumpIfToBooleanTrue <imm8>
|
| +// JumpIfToBooleanTrue <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the object
|
| // referenced by the accumulator is true when the object is cast to boolean.
|
| @@ -1397,10 +1152,9 @@ void Interpreter::DoJumpIfToBooleanTrue(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(to_boolean_value, true_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfToBooleanTrueConstant <idx8>
|
| +// JumpIfToBooleanTrueConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the object referenced by the accumulator is true when the object is cast
|
| // to boolean.
|
| void Interpreter::DoJumpIfToBooleanTrueConstant(
|
| @@ -1418,19 +1172,7 @@ void Interpreter::DoJumpIfToBooleanTrueConstant(
|
| __ JumpIfWordEqual(to_boolean_value, true_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfToBooleanTrueConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the object referenced by the accumulator is true when the object is cast
|
| -// to boolean.
|
| -void Interpreter::DoJumpIfToBooleanTrueConstantWide(
|
| - InterpreterAssembler* assembler) {
|
| - DoJumpIfToBooleanTrueConstant(assembler);
|
| -}
|
| -
|
| -
|
| -// JumpIfToBooleanFalse <imm8>
|
| +// JumpIfToBooleanFalse <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the object
|
| // referenced by the accumulator is false when the object is cast to boolean.
|
| @@ -1446,10 +1188,9 @@ void Interpreter::DoJumpIfToBooleanFalse(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(to_boolean_value, false_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfToBooleanFalseConstant <idx8>
|
| +// JumpIfToBooleanFalseConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the object referenced by the accumulator is false when the object is cast
|
| // to boolean.
|
| void Interpreter::DoJumpIfToBooleanFalseConstant(
|
| @@ -1467,19 +1208,7 @@ void Interpreter::DoJumpIfToBooleanFalseConstant(
|
| __ JumpIfWordEqual(to_boolean_value, false_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfToBooleanFalseConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the object referenced by the accumulator is false when the object is cast
|
| -// to boolean.
|
| -void Interpreter::DoJumpIfToBooleanFalseConstantWide(
|
| - InterpreterAssembler* assembler) {
|
| - DoJumpIfToBooleanFalseConstant(assembler);
|
| -}
|
| -
|
| -
|
| -// JumpIfNull <imm8>
|
| +// JumpIfNull <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the object
|
| // referenced by the accumulator is the null constant.
|
| @@ -1490,10 +1219,9 @@ void Interpreter::DoJumpIfNull(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, null_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfNullConstant <idx8>
|
| +// JumpIfNullConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the object referenced by the accumulator is the null constant.
|
| void Interpreter::DoJumpIfNullConstant(InterpreterAssembler* assembler) {
|
| Node* accumulator = __ GetAccumulator();
|
| @@ -1504,16 +1232,7 @@ void Interpreter::DoJumpIfNullConstant(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, null_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfNullConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the object referenced by the accumulator is the null constant.
|
| -void Interpreter::DoJumpIfNullConstantWide(InterpreterAssembler* assembler) {
|
| - DoJumpIfNullConstant(assembler);
|
| -}
|
| -
|
| -// JumpIfUndefined <imm8>
|
| +// JumpIfUndefined <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the object
|
| // referenced by the accumulator is the undefined constant.
|
| @@ -1525,10 +1244,9 @@ void Interpreter::DoJumpIfUndefined(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, undefined_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfUndefinedConstant <idx8>
|
| +// JumpIfUndefinedConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the object referenced by the accumulator is the undefined constant.
|
| void Interpreter::DoJumpIfUndefinedConstant(InterpreterAssembler* assembler) {
|
| Node* accumulator = __ GetAccumulator();
|
| @@ -1540,17 +1258,7 @@ void Interpreter::DoJumpIfUndefinedConstant(InterpreterAssembler* assembler) {
|
| __ JumpIfWordEqual(accumulator, undefined_value, relative_jump);
|
| }
|
|
|
| -
|
| -// JumpIfUndefinedConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the object referenced by the accumulator is the undefined constant.
|
| -void Interpreter::DoJumpIfUndefinedConstantWide(
|
| - InterpreterAssembler* assembler) {
|
| - DoJumpIfUndefinedConstant(assembler);
|
| -}
|
| -
|
| -// JumpIfNotHole <imm8>
|
| +// JumpIfNotHole <imm>
|
| //
|
| // Jump by number of bytes represented by an immediate operand if the object
|
| // referenced by the accumulator is the hole.
|
| @@ -1561,9 +1269,9 @@ void Interpreter::DoJumpIfNotHole(InterpreterAssembler* assembler) {
|
| __ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump);
|
| }
|
|
|
| -// JumpIfNotHoleConstant <idx8>
|
| +// JumpIfNotHoleConstant <idx>
|
| //
|
| -// Jump by number of bytes in the Smi in the |idx8| entry in the constant pool
|
| +// Jump by number of bytes in the Smi in the |idx| entry in the constant pool
|
| // if the object referenced by the accumulator is the hole constant.
|
| void Interpreter::DoJumpIfNotHoleConstant(InterpreterAssembler* assembler) {
|
| Node* accumulator = __ GetAccumulator();
|
| @@ -1574,21 +1282,13 @@ void Interpreter::DoJumpIfNotHoleConstant(InterpreterAssembler* assembler) {
|
| __ JumpIfWordNotEqual(accumulator, the_hole_value, relative_jump);
|
| }
|
|
|
| -// JumpIfNotHoleConstantWide <idx16>
|
| -//
|
| -// Jump by number of bytes in the Smi in the |idx16| entry in the constant pool
|
| -// if the object referenced by the accumulator is the hole constant.
|
| -void Interpreter::DoJumpIfNotHoleConstantWide(InterpreterAssembler* assembler) {
|
| - DoJumpIfNotHoleConstant(assembler);
|
| -}
|
| -
|
| void Interpreter::DoCreateLiteral(Runtime::FunctionId function_id,
|
| InterpreterAssembler* assembler) {
|
| Node* index = __ BytecodeOperandIdx(0);
|
| Node* constant_elements = __ LoadConstantPoolEntry(index);
|
| Node* literal_index_raw = __ BytecodeOperandIdx(1);
|
| Node* literal_index = __ SmiTag(literal_index_raw);
|
| - Node* flags_raw = __ BytecodeOperandImm(2);
|
| + Node* flags_raw = __ BytecodeOperandFlag(2);
|
| Node* flags = __ SmiTag(flags_raw);
|
| Node* closure = __ LoadRegister(Register::function_closure());
|
| Node* context = __ GetContext();
|
| @@ -1610,7 +1310,7 @@ void Interpreter::DoCreateRegExpLiteral(InterpreterAssembler* assembler) {
|
| Node* pattern = __ LoadConstantPoolEntry(index);
|
| Node* literal_index_raw = __ BytecodeOperandIdx(1);
|
| Node* literal_index = __ SmiTag(literal_index_raw);
|
| - Node* flags_raw = __ BytecodeOperandImm(2);
|
| + Node* flags_raw = __ BytecodeOperandFlag(2);
|
| Node* flags = __ SmiTag(flags_raw);
|
| Node* closure = __ LoadRegister(Register::function_closure());
|
| Node* context = __ GetContext();
|
| @@ -1620,16 +1320,6 @@ void Interpreter::DoCreateRegExpLiteral(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| -// CreateRegExpLiteralWide <pattern_idx> <literal_idx> <flags>
|
| -//
|
| -// Creates a regular expression literal for literal index <literal_idx> with
|
| -// <flags> and the pattern in <pattern_idx>.
|
| -void Interpreter::DoCreateRegExpLiteralWide(InterpreterAssembler* assembler) {
|
| - DoCreateRegExpLiteral(assembler);
|
| -}
|
| -
|
| -
|
| // CreateArrayLiteral <element_idx> <literal_idx> <flags>
|
| //
|
| // Creates an array literal for literal index <literal_idx> with flags <flags>
|
| @@ -1638,16 +1328,6 @@ void Interpreter::DoCreateArrayLiteral(InterpreterAssembler* assembler) {
|
| DoCreateLiteral(Runtime::kCreateArrayLiteral, assembler);
|
| }
|
|
|
| -
|
| -// CreateArrayLiteralWide <element_idx> <literal_idx> <flags>
|
| -//
|
| -// Creates an array literal for literal index <literal_idx> with flags <flags>
|
| -// and constant elements in <element_idx>.
|
| -void Interpreter::DoCreateArrayLiteralWide(InterpreterAssembler* assembler) {
|
| - DoCreateLiteral(Runtime::kCreateArrayLiteral, assembler);
|
| -}
|
| -
|
| -
|
| // CreateObjectLiteral <element_idx> <literal_idx> <flags>
|
| //
|
| // Creates an object literal for literal index <literal_idx> with flags <flags>
|
| @@ -1656,16 +1336,6 @@ void Interpreter::DoCreateObjectLiteral(InterpreterAssembler* assembler) {
|
| DoCreateLiteral(Runtime::kCreateObjectLiteral, assembler);
|
| }
|
|
|
| -
|
| -// CreateObjectLiteralWide <element_idx> <literal_idx> <flags>
|
| -//
|
| -// Creates an object literal for literal index <literal_idx> with flags <flags>
|
| -// and constant elements in <element_idx>.
|
| -void Interpreter::DoCreateObjectLiteralWide(InterpreterAssembler* assembler) {
|
| - DoCreateLiteral(Runtime::kCreateObjectLiteral, assembler);
|
| -}
|
| -
|
| -
|
| // CreateClosure <index> <tenured>
|
| //
|
| // Creates a new closure for SharedFunctionInfo at position |index| in the
|
| @@ -1675,7 +1345,7 @@ void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
|
| // calling into the runtime.
|
| Node* index = __ BytecodeOperandIdx(0);
|
| Node* shared = __ LoadConstantPoolEntry(index);
|
| - Node* tenured_raw = __ BytecodeOperandImm(1);
|
| + Node* tenured_raw = __ BytecodeOperandFlag(1);
|
| Node* tenured = __ SmiTag(tenured_raw);
|
| Node* context = __ GetContext();
|
| Node* result =
|
| @@ -1684,16 +1354,6 @@ void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| -// CreateClosureWide <index> <tenured>
|
| -//
|
| -// Creates a new closure for SharedFunctionInfo at position |index| in the
|
| -// constant pool and with the PretenureFlag <tenured>.
|
| -void Interpreter::DoCreateClosureWide(InterpreterAssembler* assembler) {
|
| - return DoCreateClosure(assembler);
|
| -}
|
| -
|
| -
|
| // CreateMappedArguments
|
| //
|
| // Creates a new mapped arguments object.
|
| @@ -1815,18 +1475,6 @@ void Interpreter::DoForInPrepare(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| -// ForInPrepareWide <cache_info_triple>
|
| -//
|
| -// Returns state for for..in loop execution based on the object in the
|
| -// accumulator. The result is output in registers |cache_info_triple| to
|
| -// |cache_info_triple + 2|, with the registers holding cache_type, cache_array,
|
| -// and cache_length respectively.
|
| -void Interpreter::DoForInPrepareWide(InterpreterAssembler* assembler) {
|
| - DoForInPrepare(assembler);
|
| -}
|
| -
|
| -
|
| // ForInNext <receiver> <index> <cache_info_pair>
|
| //
|
| // Returns the next enumerable property in the the accumulator.
|
| @@ -1873,15 +1521,6 @@ void Interpreter::DoForInNext(InterpreterAssembler* assembler) {
|
| }
|
| }
|
|
|
| -
|
| -// ForInNextWide <receiver> <index> <cache_info_pair>
|
| -//
|
| -// Returns the next enumerable property in the the accumulator.
|
| -void Interpreter::DoForInNextWide(InterpreterAssembler* assembler) {
|
| - return DoForInNext(assembler);
|
| -}
|
| -
|
| -
|
| // ForInDone <index> <cache_length>
|
| //
|
| // Returns true if the end of the enumerable properties has been reached.
|
| @@ -1898,7 +1537,6 @@ void Interpreter::DoForInDone(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| -
|
| // ForInStep <index>
|
| //
|
| // Increments the loop counter in register |index| and stores the result
|
| @@ -1912,6 +1550,27 @@ void Interpreter::DoForInStep(InterpreterAssembler* assembler) {
|
| __ Dispatch();
|
| }
|
|
|
| +// Wide
|
| +//
|
| +// Prefix bytecode indicating next bytecode has wide (16-bit) operands.
|
| +void Interpreter::DoWide(InterpreterAssembler* assembler) {
|
| + __ RedispatchWide(2);
|
| +}
|
| +
|
| +// ExtraWide
|
| +//
|
| +// Prefix bytecode indicating next bytecode has extra-wide (32-bit) operands.
|
| +void Interpreter::DoExtraWide(InterpreterAssembler* assembler) {
|
| + __ RedispatchWide(4);
|
| +}
|
| +
|
| +// Illegal
|
| +//
|
| +// An invalid bytecode aborting execution if dispatched.
|
| +void Interpreter::DoIllegal(InterpreterAssembler* assembler) {
|
| + __ Abort(kInvalidBytecode);
|
| +}
|
| +
|
| } // namespace interpreter
|
| } // namespace internal
|
| } // namespace v8
|
|
|