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

Unified Diff: src/interpreter/interpreter-assembler.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-assembler.h ('k') | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter-assembler.cc
diff --git a/src/interpreter/interpreter-assembler.cc b/src/interpreter/interpreter-assembler.cc
index 7d8250944586dab591ab688fbf879607c4658625..cfb58a852a1eebd9e1be8a45a0d472a93bfe85a2 100644
--- a/src/interpreter/interpreter-assembler.cc
+++ b/src/interpreter/interpreter-assembler.cc
@@ -114,6 +114,41 @@ Node* InterpreterAssembler::GetContextAtDepth(Node* context, Node* depth) {
return cur_context.value();
}
+void InterpreterAssembler::GotoIfHasContextExtensionUpToDepth(Node* context,
+ Node* depth,
+ Label* target) {
+ Variable cur_context(this, MachineRepresentation::kTaggedPointer);
+ cur_context.Bind(context);
+
+ Variable cur_depth(this, MachineRepresentation::kWord32);
+ cur_depth.Bind(depth);
+
+ Variable* context_search_loop_variables[2] = {&cur_depth, &cur_context};
+ Label context_search(this, 2, context_search_loop_variables);
+
+ // Loop until the depth is 0.
+ Goto(&context_search);
+ Bind(&context_search);
+ {
+ // TODO(leszeks): We only need to do this check if the context had a sloppy
+ // eval, we could pass in a context chain bitmask to figure out which
+ // contexts actually need to be checked.
+
+ Node* extension_slot =
+ LoadContextSlot(cur_context.value(), Context::EXTENSION_INDEX);
+
+ // Jump to the target if the extension slot is not a hole.
+ GotoIf(WordNotEqual(extension_slot, TheHoleConstant()), target);
+
+ cur_depth.Bind(Int32Sub(cur_depth.value(), Int32Constant(1)));
+ cur_context.Bind(
+ LoadContextSlot(cur_context.value(), Context::PREVIOUS_INDEX));
+
+ GotoIf(Word32NotEqual(cur_depth.value(), Int32Constant(0)),
+ &context_search);
+ }
+}
+
Node* InterpreterAssembler::BytecodeOffset() {
return bytecode_offset_.value();
}
« no previous file with comments | « src/interpreter/interpreter-assembler.h ('k') | test/cctest/compiler/test-run-bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698