Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/interpreter/interpreter.cc

Issue 1524803003: [Interpreter] Add support for Load / Store to Lookup slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@init_eval_impl
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index b1bd1976339f2c37e451cde252565d75c289d5d3..7ebd7e8e4fd7472018fe7253be9114a268473450 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -423,6 +423,77 @@ void Interpreter::DoStaContextSlot(compiler::InterpreterAssembler* assembler) {
}
+// LdaLookupSlot <name_index> <context>
+//
+// 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* reg_index = __ BytecodeOperandReg(1);
+ Node* context = __ LoadRegister(reg_index);
+ Node* result =
+ __ CallRuntime(Runtime::kInterpreterLoadLookupSlotCallee, context, name);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
+// LdaLookupSlotInsideTypeof <name_index> <context>
+//
+// 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* reg_index = __ BytecodeOperandReg(1);
+ Node* context = __ LoadRegister(reg_index);
+ Node* result = __ CallRuntime(
+ Runtime::kInterpreterLoadLookupSlotNoReferenceErrorValue, context, name);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
+// StaLookupSlotSloppy <name_index> <context>
+//
+// 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* reg_index = __ BytecodeOperandReg(1);
+ Node* context = __ LoadRegister(reg_index);
+ Node* language_mode = __ NumberConstant(LanguageMode::SLOPPY);
+ Node* result = __ CallRuntime(Runtime::kStoreLookupSlot, value, context, name,
+ language_mode);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
+// StaLookupSlotStrict <name_index> <context>
+//
+// 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* reg_index = __ BytecodeOperandReg(1);
+ Node* context = __ LoadRegister(reg_index);
+ Node* language_mode = __ NumberConstant(LanguageMode::STRICT);
+ 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());

Powered by Google App Engine
This is Rietveld 408576698