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

Unified Diff: src/interpreter/interpreter.cc

Issue 2459513002: [ignition] Add bytecodes for loads/stores in the current context (Closed)
Patch Set: s/LocalContext/CurrentContext/g Created 4 years, 2 months 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
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/interpreter/mkpeephole.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/interpreter/mkpeephole.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698