Chromium Code Reviews| Index: src/interpreter/interpreter.cc |
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
| index 7a38a63e128e025b18a30cc6e6a1cce18835b479..d3201b41ad17fea1ca6a804b55459caeac594a79 100644 |
| --- a/src/interpreter/interpreter.cc |
| +++ b/src/interpreter/interpreter.cc |
| @@ -518,38 +518,45 @@ void Interpreter::DoStaGlobalStrict(InterpreterAssembler* assembler) { |
| compiler::Node* Interpreter::BuildLoadContextSlot( |
| InterpreterAssembler* assembler) { |
| Node* reg_index = __ BytecodeOperandReg(0); |
| - Node* context = __ LoadRegister(reg_index); |
| + Node* root_context = __ LoadRegister(reg_index); |
|
Michael Starzinger
2016/09/13 09:53:08
nit: Likewise about "root_context" vs "context" he
Leszek Swirski
2016/09/13 10:17:51
Done.
|
| Node* slot_index = __ BytecodeOperandIdx(1); |
| + Node* depth = __ BytecodeOperandIdx(2); |
| + Node* context = __ GetContextAtDepth(root_context, depth); |
| return __ LoadContextSlot(context, slot_index); |
| } |
| -// LdaContextSlot <context> <slot_index> |
| +// LdaContextSlot <root_context> <slot_index> <depth> |
| // |
| -// Load the object in |slot_index| of |context| into the accumulator. |
| +// Load the object in |slot_index| of at <depth> of |root_context| into the |
| +// accumulator. |
| void Interpreter::DoLdaContextSlot(InterpreterAssembler* assembler) { |
| Node* result = BuildLoadContextSlot(assembler); |
| __ SetAccumulator(result); |
| __ Dispatch(); |
| } |
| -// LdrContextSlot <context> <slot_index> <reg> |
| +// LdrContextSlot <root_context> <slot_index> <depth> <reg> |
| // |
| -// Load the object in <slot_index> of <context> into register <reg>. |
| +// Load the object in |slot_index| at |depth| of |root_context| into register |
| +// |reg|. |
| void Interpreter::DoLdrContextSlot(InterpreterAssembler* assembler) { |
| Node* result = BuildLoadContextSlot(assembler); |
| - Node* destination = __ BytecodeOperandReg(2); |
| + Node* destination = __ BytecodeOperandReg(3); |
| __ StoreRegister(result, destination); |
| __ Dispatch(); |
| } |
| -// StaContextSlot <context> <slot_index> |
| +// StaContextSlot <root_context> <slot_index> <depth> |
| // |
| -// Stores the object in the accumulator into |slot_index| of |context|. |
| +// Stores the object in the accumulator into |slot_index| of |root_context| at |
| +// |depth|. |
| void Interpreter::DoStaContextSlot(InterpreterAssembler* assembler) { |
| Node* value = __ GetAccumulator(); |
| Node* reg_index = __ BytecodeOperandReg(0); |
| - Node* context = __ LoadRegister(reg_index); |
| + Node* root_context = __ LoadRegister(reg_index); |
| Node* slot_index = __ BytecodeOperandIdx(1); |
| + Node* depth = __ BytecodeOperandIdx(2); |
| + Node* context = __ GetContextAtDepth(root_context, depth); |
| __ StoreContextSlot(context, slot_index, value); |
| __ Dispatch(); |
| } |