Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 7c1821b83bf743bb2644c229f8fbd264558896b9..d36480769b0d296ec5891ce895805854c78b8b03 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -544,6 +544,13 @@ compiler::Node* Interpreter::BuildLoadContextSlot( |
return __ LoadContextSlot(slot_context, slot_index); |
} |
+compiler::Node* Interpreter::BuildLoadCurrentContextSlot( |
+ InterpreterAssembler* assembler) { |
+ Node* slot_index = __ BytecodeOperandIdx(0); |
+ Node* slot_context = __ GetContext(); |
+ return __ LoadContextSlot(slot_context, slot_index); |
+} |
+ |
// LdaContextSlot <context> <slot_index> <depth> |
// |
// Load the object in |slot_index| of the context at |depth| in the context |
@@ -554,6 +561,15 @@ void Interpreter::DoLdaContextSlot(InterpreterAssembler* assembler) { |
__ Dispatch(); |
} |
+// LdaCurrentContextSlot <slot_index> |
+// |
+// Load the object in |slot_index| of the current context into the accumulator. |
+void Interpreter::DoLdaCurrentContextSlot(InterpreterAssembler* assembler) { |
+ Node* result = BuildLoadCurrentContextSlot(assembler); |
+ __ SetAccumulator(result); |
+ __ Dispatch(); |
+} |
+ |
// LdrContextSlot <context> <slot_index> <depth> <reg> |
// |
// Load the object in |slot_index| of the context at |depth| in the context |
@@ -565,6 +581,16 @@ void Interpreter::DoLdrContextSlot(InterpreterAssembler* assembler) { |
__ Dispatch(); |
} |
+// LdrCurrentContextSlot <slot_index> <reg> |
+// |
+// Load the object in |slot_index| of the current context into register |reg|. |
+void Interpreter::DoLdrCurrentContextSlot(InterpreterAssembler* assembler) { |
+ Node* result = BuildLoadCurrentContextSlot(assembler); |
+ Node* destination = __ BytecodeOperandReg(1); |
+ __ StoreRegister(result, destination); |
+ __ Dispatch(); |
+} |
+ |
// StaContextSlot <context> <slot_index> <depth> |
// |
// Stores the object in the accumulator into |slot_index| of the context at |
@@ -580,6 +606,18 @@ void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) { |
__ Dispatch(); |
} |
+// StaCurrentContextSlot <slot_index> |
+// |
+// Stores the object in the accumulator into |slot_index| of the current |
+// context. |
+void Interpreter::DoStaCurrentContextSlot(InterpreterAssembler* assembler) { |
+ Node* value = __ GetAccumulator(); |
+ Node* slot_index = __ BytecodeOperandIdx(0); |
+ Node* slot_context = __ GetContext(); |
+ __ StoreContextSlot(slot_context, slot_index, value); |
+ __ Dispatch(); |
+} |
+ |
void Interpreter::DoLdaLookupSlot(Runtime::FunctionId function_id, |
InterpreterAssembler* assembler) { |
Node* name_index = __ BytecodeOperandIdx(0); |