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

Unified Diff: src/interpreter/interpreter.cc

Issue 2343633002: [interpreter] Add a fast path for dynamic local load (Closed)
Patch Set: Fix extension slot word size in equality test Created 4 years, 3 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/interpreter-assembler.h » ('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 d0d8cae83d19eca6073fc16991df1a3b1a6bb93a..0c1f945d0fd3322f146bc3449409ec5a5734fbb9 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -587,6 +587,53 @@ void Interpreter::DoLdaLookupSlotInsideTypeof(InterpreterAssembler* assembler) {
DoLdaLookupSlot(Runtime::kLoadLookupSlotInsideTypeof, assembler);
}
+void Interpreter::DoLdaLookupContextSlot(Runtime::FunctionId function_id,
+ InterpreterAssembler* assembler) {
+ Node* context = __ GetContext();
+ Node* name_index = __ BytecodeOperandIdx(0);
+ Node* slot_index = __ BytecodeOperandIdx(1);
+ Node* depth = __ BytecodeOperandUImm(2);
+
+ Label slowpath(assembler, Label::kDeferred);
+
+ // Check for context extensions to allow the fast path.
+ __ GotoIfHasContextExtensionUpToDepth(context, depth, &slowpath);
+
+ // Fast path does a normal load context.
+ {
+ Node* slot_context = __ GetContextAtDepth(context, depth);
+ Node* result = __ LoadContextSlot(slot_context, slot_index);
+ __ SetAccumulator(result);
+ __ Dispatch();
+ }
+
+ // Slow path when we have to call out to the runtime.
+ __ Bind(&slowpath);
+ {
+ Node* name = __ LoadConstantPoolEntry(name_index);
+ Node* result = __ CallRuntime(function_id, context, name);
+ __ SetAccumulator(result);
+ __ Dispatch();
+ }
+}
+
+// LdaLookupSlot <name_index>
+//
+// Lookup the object with the name in constant pool entry |name_index|
+// dynamically.
+void Interpreter::DoLdaLookupContextSlot(InterpreterAssembler* assembler) {
+ DoLdaLookupContextSlot(Runtime::kLoadLookupSlot, assembler);
+}
+
+// LdaLookupSlotInsideTypeof <name_index>
+//
+// Lookup the object with the name in constant pool entry |name_index|
+// dynamically without causing a NoReferenceError.
+void Interpreter::DoLdaLookupContextSlotInsideTypeof(
+ InterpreterAssembler* assembler) {
+ DoLdaLookupContextSlot(Runtime::kLoadLookupSlotInsideTypeof, assembler);
+}
+
void Interpreter::DoStaLookupSlot(LanguageMode language_mode,
InterpreterAssembler* assembler) {
Node* value = __ GetAccumulator();
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/interpreter/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698