Chromium Code Reviews| Index: src/interpreter/interpreter.cc |
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
| index b1bd1976339f2c37e451cde252565d75c289d5d3..8c0d9cd2ce7d78ec0705449e60641c16ca52fa29 100644 |
| --- a/src/interpreter/interpreter.cc |
| +++ b/src/interpreter/interpreter.cc |
| @@ -423,6 +423,74 @@ void Interpreter::DoStaContextSlot(compiler::InterpreterAssembler* assembler) { |
| } |
| +// LdaLookupSlot <name_index> |
| +// |
| +// Lookup the object with the name in constant pool entry |name_index| |
| +// dynamically. |
| +void Interpreter::DoLdaLookupSlot(compiler::InterpreterAssembler* assembler) { |
| + Node* index = __ BytecodeOperandIdx(0); |
| + Node* name = __ LoadConstantPoolEntry(index); |
| + Node* context = __ GetContext(); |
| + Node* result_pair = __ CallRuntime(Runtime::kLoadLookupSlot, context, name); |
| + Node* result = __ Projection(0, result_pair); |
| + __ SetAccumulator(result); |
| + __ Dispatch(); |
| +} |
| + |
| + |
| +// LdaLookupSlotInsideTypeof <name_index> |
| +// |
| +// Lookup the object with the name in constant pool entry |name_index| |
| +// dynamically without causing a NoReferenceError. |
| +void Interpreter::DoLdaLookupSlotInsideTypeof( |
| + compiler::InterpreterAssembler* assembler) { |
| + Node* index = __ BytecodeOperandIdx(0); |
| + Node* name = __ LoadConstantPoolEntry(index); |
| + Node* context = __ GetContext(); |
| + Node* result_pair = |
| + __ CallRuntime(Runtime::kLoadLookupSlotNoReferenceError, context, name); |
| + Node* result = __ Projection(0, result_pair); |
| + __ SetAccumulator(result); |
|
rmcilroy
2015/12/15 16:44:33
Please pull out common code to a helper function,
mythria
2015/12/16 09:54:21
Done.
|
| + __ Dispatch(); |
| +} |
| + |
| + |
| +// StaLookupSlotSloppy <name_index> |
| +// |
| +// Store the object in accumulator to the object with the name in constant |
| +// pool entry |name_index| in sloppy mode. |
| +void Interpreter::DoStaLookupSlotSloppy( |
| + compiler::InterpreterAssembler* assembler) { |
| + Node* value = __ GetAccumulator(); |
| + Node* index = __ BytecodeOperandIdx(0); |
| + Node* name = __ LoadConstantPoolEntry(index); |
| + Node* context = __ GetContext(); |
| + Node* language_mode = __ NumberConstant(LanguageMode::SLOPPY); |
| + Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, value, context, name, |
| + language_mode); |
| + __ SetAccumulator(result); |
| + __ Dispatch(); |
| +} |
| + |
| + |
| +// StaLookupSlotStrict <name_index> |
| +// |
| +// Store the object in accumulator to the object with the name in constant |
| +// pool entry |name_index| in strict mode. |
| +void Interpreter::DoStaLookupSlotStrict( |
| + compiler::InterpreterAssembler* assembler) { |
| + Node* value = __ GetAccumulator(); |
| + Node* index = __ BytecodeOperandIdx(0); |
| + Node* name = __ LoadConstantPoolEntry(index); |
| + Node* context = __ GetContext(); |
| + Node* language_mode = __ NumberConstant(LanguageMode::STRICT); |
|
rmcilroy
2015/12/15 16:44:32
Ditto (passing language mode).
mythria
2015/12/16 09:54:21
Done.
|
| + Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, value, context, name, |
| + language_mode); |
| + __ SetAccumulator(result); |
| + __ Dispatch(); |
| +} |
| + |
| + |
| void Interpreter::DoLoadIC(Callable ic, |
| compiler::InterpreterAssembler* assembler) { |
| Node* code_target = __ HeapConstant(ic.code()); |