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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1541143003: [Interpreter] Adds support for Load/Store LookupSlots to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removes an extra line in bytecode-graph-builder.h. 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
« no previous file with comments | « src/compiler/bytecode-graph-builder.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/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 4cbde46813c3de538fcbceb964fb9abef9243445..12d944407f10f2cca250fa306559f2eac0b0da74 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -702,27 +702,53 @@ void BytecodeGraphBuilder::VisitStaContextSlot(
}
+void BytecodeGraphBuilder::BuildLdaLookupSlot(
+ TypeofMode typeof_mode,
+ const interpreter::BytecodeArrayIterator& iterator) {
+ FrameStateBeforeAndAfter states(this, iterator);
+ Handle<String> name =
+ Handle<String>::cast(iterator.GetConstantForIndexOperand(0));
+ const Operator* op = javascript()->LoadDynamic(name, typeof_mode);
+ Node* value =
+ NewNode(op, BuildLoadFeedbackVector(), environment()->Context());
+ environment()->BindAccumulator(value, &states);
+}
+
+
void BytecodeGraphBuilder::VisitLdaLookupSlot(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildLdaLookupSlot(TypeofMode::NOT_INSIDE_TYPEOF, iterator);
}
void BytecodeGraphBuilder::VisitLdaLookupSlotInsideTypeof(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildLdaLookupSlot(TypeofMode::INSIDE_TYPEOF, iterator);
+}
+
+
+void BytecodeGraphBuilder::BuildStaLookupSlot(
+ LanguageMode language_mode,
+ const interpreter::BytecodeArrayIterator& iterator) {
+ FrameStateBeforeAndAfter states(this, iterator);
+ Node* value = environment()->LookupAccumulator();
+ Node* name = jsgraph()->Constant(iterator.GetConstantForIndexOperand(0));
+ Node* language = jsgraph()->Constant(language_mode);
+ const Operator* op = javascript()->CallRuntime(Runtime::kStoreLookupSlot, 4);
+ Node* store = NewNode(op, value, environment()->Context(), name, language);
+ environment()->BindAccumulator(store, &states);
}
void BytecodeGraphBuilder::VisitStaLookupSlotSloppy(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildStaLookupSlot(LanguageMode::SLOPPY, iterator);
}
void BytecodeGraphBuilder::VisitStaLookupSlotStrict(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildStaLookupSlot(LanguageMode::STRICT, iterator);
}
« no previous file with comments | « src/compiler/bytecode-graph-builder.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