| Index: src/interpreter/interpreter.cc
|
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
|
| index 503594e4fc2730ebfa46e3d7fd569ce4ee2a4aba..6d5fd39e9b41aec7d6f797c12221f72a9c24ce76 100644
|
| --- a/src/interpreter/interpreter.cc
|
| +++ b/src/interpreter/interpreter.cc
|
| @@ -184,41 +184,89 @@ void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) {
|
| }
|
|
|
|
|
| -// LdaGlobal <slot_index>
|
| -//
|
| -// Load the global at |slot_index| into the accumulator.
|
| -void Interpreter::DoLdaGlobal(compiler::InterpreterAssembler* assembler) {
|
| - Node* slot_index = __ BytecodeOperandIdx8(0);
|
| - Node* smi_slot_index = __ SmiTag(slot_index);
|
| - Node* result = __ CallRuntime(Runtime::kLoadGlobalViaContext, smi_slot_index);
|
| +void Interpreter::DoLoadGlobal(Callable ic,
|
| + compiler::InterpreterAssembler* assembler) {
|
| + // Get the global object.
|
| + Node* context = __ GetContext();
|
| + Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX);
|
| +
|
| + // Load the global via the LoadIC.
|
| + Node* code_target = __ HeapConstant(ic.code());
|
| + Node* constant_index = __ BytecodeOperandIdx8(0);
|
| + Node* name = __ LoadConstantPoolEntry(constant_index);
|
| + Node* raw_slot = __ BytecodeOperandIdx8(1);
|
| + Node* smi_slot = __ SmiTag(raw_slot);
|
| + Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| + Node* result = __ CallIC(ic.descriptor(), code_target, global, name, smi_slot,
|
| + type_feedback_vector);
|
| __ SetAccumulator(result);
|
| +
|
| __ Dispatch();
|
| }
|
|
|
|
|
| -// StaGlobalSloppy <slot_index>
|
| +// LdaGlobalSloppy <name> <slot>
|
| //
|
| -// Store the global at |slot_index| with the value in the the accumulator in
|
| -// sloppy mode.
|
| -void Interpreter::DoStaGlobalSloppy(compiler::InterpreterAssembler* assembler) {
|
| - Node* slot_index = __ BytecodeOperandIdx8(0);
|
| - Node* smi_slot_index = __ SmiTag(slot_index);
|
| +// Load the global with name in constant pool entry <name> into the accumulator
|
| +// using FeedBackVector slot <slot> in sloppy mode.
|
| +void Interpreter::DoLdaGlobalSloppy(compiler::InterpreterAssembler* assembler) {
|
| + Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
|
| + SLOPPY, UNINITIALIZED);
|
| + DoLoadGlobal(ic, assembler);
|
| +}
|
| +
|
| +
|
| +// LdaGlobalSloppy <name> <slot>
|
| +//
|
| +// Load the global with name in constant pool entry <name> into the accumulator
|
| +// using FeedBackVector slot <slot> in strict mode.
|
| +void Interpreter::DoLdaGlobalStrict(compiler::InterpreterAssembler* assembler) {
|
| + Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
|
| + STRICT, UNINITIALIZED);
|
| + DoLoadGlobal(ic, assembler);
|
| +}
|
| +
|
| +
|
| +void Interpreter::DoStoreGlobal(Callable ic,
|
| + compiler::InterpreterAssembler* assembler) {
|
| + // Get the global object.
|
| + Node* context = __ GetContext();
|
| + Node* global = __ LoadContextSlot(context, Context::GLOBAL_OBJECT_INDEX);
|
| +
|
| + // Store the global via the StoreIC.
|
| + Node* code_target = __ HeapConstant(ic.code());
|
| + Node* constant_index = __ BytecodeOperandIdx8(0);
|
| + Node* name = __ LoadConstantPoolEntry(constant_index);
|
| Node* value = __ GetAccumulator();
|
| - __ CallRuntime(Runtime::kStoreGlobalViaContext_Sloppy, smi_slot_index, value);
|
| + Node* raw_slot = __ BytecodeOperandIdx8(1);
|
| + Node* smi_slot = __ SmiTag(raw_slot);
|
| + Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| + __ CallIC(ic.descriptor(), code_target, global, name, value, smi_slot,
|
| + type_feedback_vector);
|
| +
|
| __ Dispatch();
|
| }
|
|
|
|
|
| -// StaGlobalStrict <slot_index>
|
| +// StaGlobalSloppy <name> <slot>
|
| +//
|
| +// Store the value in the accumulator into the global with name in constant pool
|
| +// entry <name> using FeedBackVector slot <slot> in sloppy mode.
|
| +void Interpreter::DoStaGlobalSloppy(compiler::InterpreterAssembler* assembler) {
|
| + Callable ic =
|
| + CodeFactory::StoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| + DoStoreGlobal(ic, assembler);
|
| +}
|
| +
|
| +
|
| +// StaGlobalStrict <name> <slot>
|
| //
|
| -// Store the global at |slot_index| with the value in the the accumulator in
|
| -// strict mode.
|
| +// Store the value in the accumulator into the global with name in constant pool
|
| +// entry <name> using FeedBackVector slot <slot> in strict mode.
|
| void Interpreter::DoStaGlobalStrict(compiler::InterpreterAssembler* assembler) {
|
| - Node* slot_index = __ BytecodeOperandIdx8(0);
|
| - Node* smi_slot_index = __ SmiTag(slot_index);
|
| - Node* value = __ GetAccumulator();
|
| - __ CallRuntime(Runtime::kStoreGlobalViaContext_Strict, smi_slot_index, value);
|
| - __ Dispatch();
|
| + Callable ic =
|
| + CodeFactory::StoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| + DoStoreGlobal(ic, assembler);
|
| }
|
|
|
|
|
| @@ -248,13 +296,14 @@ void Interpreter::DoStaContextSlot(compiler::InterpreterAssembler* assembler) {
|
| }
|
|
|
|
|
| -void Interpreter::DoPropertyLoadIC(Callable ic,
|
| - compiler::InterpreterAssembler* assembler) {
|
| +void Interpreter::DoLoadIC(Callable ic,
|
| + compiler::InterpreterAssembler* assembler) {
|
| Node* code_target = __ HeapConstant(ic.code());
|
| - Node* reg_index = __ BytecodeOperandReg8(0);
|
| - Node* object = __ LoadRegister(reg_index);
|
| - Node* name = __ GetAccumulator();
|
| - Node* raw_slot = __ BytecodeOperandIdx8(1);
|
| + Node* register_index = __ BytecodeOperandReg8(0);
|
| + Node* object = __ LoadRegister(register_index);
|
| + Node* constant_index = __ BytecodeOperandIdx8(1);
|
| + Node* name = __ LoadConstantPoolEntry(constant_index);
|
| + Node* raw_slot = __ BytecodeOperandIdx8(2);
|
| Node* smi_slot = __ SmiTag(raw_slot);
|
| Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| Node* result = __ CallIC(ic.descriptor(), code_target, object, name, smi_slot,
|
| @@ -264,25 +313,41 @@ void Interpreter::DoPropertyLoadIC(Callable ic,
|
| }
|
|
|
|
|
| -// LoadICSloppy <object> <slot>
|
| +// LoadICSloppy <object> <name> <slot>
|
| //
|
| // Calls the sloppy mode LoadIC at FeedBackVector slot <slot> for <object> and
|
| -// the name in the accumulator.
|
| +// the name at constant pool entry <name>.
|
| void Interpreter::DoLoadICSloppy(compiler::InterpreterAssembler* assembler) {
|
| Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
|
| SLOPPY, UNINITIALIZED);
|
| - DoPropertyLoadIC(ic, assembler);
|
| + DoLoadIC(ic, assembler);
|
| }
|
|
|
|
|
| -// LoadICStrict <object> <slot>
|
| +// LoadICStrict <object> <name> <slot>
|
| //
|
| -// Calls the strict mode LoadIC at FeedBackVector slot <slot> for <object> and
|
| -// the name in the accumulator.
|
| +// Calls the sloppy mode LoadIC at FeedBackVector slot <slot> for <object> and
|
| +// the name at constant pool entry <name>.
|
| void Interpreter::DoLoadICStrict(compiler::InterpreterAssembler* assembler) {
|
| Callable ic = CodeFactory::LoadICInOptimizedCode(isolate_, NOT_INSIDE_TYPEOF,
|
| STRICT, UNINITIALIZED);
|
| - DoPropertyLoadIC(ic, assembler);
|
| + DoLoadIC(ic, assembler);
|
| +}
|
| +
|
| +
|
| +void Interpreter::DoKeyedLoadIC(Callable ic,
|
| + compiler::InterpreterAssembler* assembler) {
|
| + Node* code_target = __ HeapConstant(ic.code());
|
| + Node* reg_index = __ BytecodeOperandReg8(0);
|
| + Node* object = __ LoadRegister(reg_index);
|
| + Node* name = __ GetAccumulator();
|
| + Node* raw_slot = __ BytecodeOperandIdx8(1);
|
| + Node* smi_slot = __ SmiTag(raw_slot);
|
| + Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| + Node* result = __ CallIC(ic.descriptor(), code_target, object, name, smi_slot,
|
| + type_feedback_vector);
|
| + __ SetAccumulator(result);
|
| + __ Dispatch();
|
| }
|
|
|
|
|
| @@ -294,7 +359,7 @@ void Interpreter::DoKeyedLoadICSloppy(
|
| compiler::InterpreterAssembler* assembler) {
|
| Callable ic =
|
| CodeFactory::KeyedLoadICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| - DoPropertyLoadIC(ic, assembler);
|
| + DoKeyedLoadIC(ic, assembler);
|
| }
|
|
|
|
|
| @@ -306,24 +371,23 @@ void Interpreter::DoKeyedLoadICStrict(
|
| compiler::InterpreterAssembler* assembler) {
|
| Callable ic =
|
| CodeFactory::KeyedLoadICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| - DoPropertyLoadIC(ic, assembler);
|
| + DoKeyedLoadIC(ic, assembler);
|
| }
|
|
|
|
|
| -void Interpreter::DoPropertyStoreIC(Callable ic,
|
| - compiler::InterpreterAssembler* assembler) {
|
| +void Interpreter::DoStoreIC(Callable ic,
|
| + compiler::InterpreterAssembler* assembler) {
|
| Node* code_target = __ HeapConstant(ic.code());
|
| Node* object_reg_index = __ BytecodeOperandReg8(0);
|
| Node* object = __ LoadRegister(object_reg_index);
|
| - Node* name_reg_index = __ BytecodeOperandReg8(1);
|
| - Node* name = __ LoadRegister(name_reg_index);
|
| + Node* constant_index = __ BytecodeOperandIdx8(1);
|
| + Node* name = __ LoadConstantPoolEntry(constant_index);
|
| Node* value = __ GetAccumulator();
|
| Node* raw_slot = __ BytecodeOperandIdx8(2);
|
| Node* smi_slot = __ SmiTag(raw_slot);
|
| Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| - Node* result = __ CallIC(ic.descriptor(), code_target, object, name, value,
|
| - smi_slot, type_feedback_vector);
|
| - __ SetAccumulator(result);
|
| + __ CallIC(ic.descriptor(), code_target, object, name, value, smi_slot,
|
| + type_feedback_vector);
|
| __ Dispatch();
|
| }
|
|
|
| @@ -331,22 +395,39 @@ void Interpreter::DoPropertyStoreIC(Callable ic,
|
| // StoreICSloppy <object> <name> <slot>
|
| //
|
| // Calls the sloppy mode StoreIC at FeedBackVector slot <slot> for <object> and
|
| -// the name <name> with the value in the accumulator.
|
| +// the in constant pool entry <name> with the value in the accumulator.
|
| void Interpreter::DoStoreICSloppy(compiler::InterpreterAssembler* assembler) {
|
| Callable ic =
|
| CodeFactory::StoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| - DoPropertyStoreIC(ic, assembler);
|
| + DoStoreIC(ic, assembler);
|
| }
|
|
|
|
|
| // StoreICStrict <object> <name> <slot>
|
| //
|
| // Calls the strict mode StoreIC at FeedBackVector slot <slot> for <object> and
|
| -// the name <name> with the value in the accumulator.
|
| +// the name in constant pool entry <name> with the value in the accumulator.
|
| void Interpreter::DoStoreICStrict(compiler::InterpreterAssembler* assembler) {
|
| Callable ic =
|
| CodeFactory::StoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| - DoPropertyStoreIC(ic, assembler);
|
| + DoStoreIC(ic, assembler);
|
| +}
|
| +
|
| +
|
| +void Interpreter::DoKeyedStoreIC(Callable ic,
|
| + compiler::InterpreterAssembler* assembler) {
|
| + Node* code_target = __ HeapConstant(ic.code());
|
| + Node* object_reg_index = __ BytecodeOperandReg8(0);
|
| + Node* object = __ LoadRegister(object_reg_index);
|
| + Node* name_reg_index = __ BytecodeOperandReg8(1);
|
| + Node* name = __ LoadRegister(name_reg_index);
|
| + Node* value = __ GetAccumulator();
|
| + Node* raw_slot = __ BytecodeOperandIdx8(2);
|
| + Node* smi_slot = __ SmiTag(raw_slot);
|
| + Node* type_feedback_vector = __ LoadTypeFeedbackVector();
|
| + __ CallIC(ic.descriptor(), code_target, object, name, value, smi_slot,
|
| + type_feedback_vector);
|
| + __ Dispatch();
|
| }
|
|
|
|
|
| @@ -358,7 +439,7 @@ void Interpreter::DoKeyedStoreICSloppy(
|
| compiler::InterpreterAssembler* assembler) {
|
| Callable ic =
|
| CodeFactory::KeyedStoreICInOptimizedCode(isolate_, SLOPPY, UNINITIALIZED);
|
| - DoPropertyStoreIC(ic, assembler);
|
| + DoKeyedStoreIC(ic, assembler);
|
| }
|
|
|
|
|
| @@ -370,7 +451,7 @@ void Interpreter::DoKeyedStoreICStrict(
|
| compiler::InterpreterAssembler* assembler) {
|
| Callable ic =
|
| CodeFactory::KeyedStoreICInOptimizedCode(isolate_, STRICT, UNINITIALIZED);
|
| - DoPropertyStoreIC(ic, assembler);
|
| + DoKeyedStoreIC(ic, assembler);
|
| }
|
|
|
|
|
|
|