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

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

Issue 1448913002: [Interpreter] Add support for keyed load / store ICs and named store IC to (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@graph_builder_load
Patch Set: Made the binding of return value of the store explicit. Created 5 years, 1 month 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 064b4b85585e55ef1dea765ad6841e876c3a7d4d..b6b5682a76b6dc08201417bcd5cb8521791947d5 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -460,89 +460,144 @@ void BytecodeGraphBuilder::VisitLoadICStrict(
}
-void BytecodeGraphBuilder::VisitKeyedLoadICSloppy(
+void BytecodeGraphBuilder::VisitLoadICSloppyWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_sloppy(language_mode()));
+ BuildNamedLoad(iterator);
}
-void BytecodeGraphBuilder::VisitKeyedLoadICStrict(
+void BytecodeGraphBuilder::VisitLoadICStrictWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_strict(language_mode()));
+ BuildNamedLoad(iterator);
}
-void BytecodeGraphBuilder::VisitLoadICSloppyWide(
+void BytecodeGraphBuilder::BuildKeyedLoad(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ Node* key = environment()->LookupAccumulator();
+ Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0));
+ VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(1));
+
+ const Operator* op = javascript()->LoadProperty(language_mode(), feedback);
+ Node* node = NewNode(op, object, key, BuildLoadFeedbackVector());
+ AddEmptyFrameStateInputs(node);
+ environment()->BindAccumulator(node);
+}
+
+
+void BytecodeGraphBuilder::VisitKeyedLoadICSloppy(
const interpreter::BytecodeArrayIterator& iterator) {
DCHECK(is_sloppy(language_mode()));
- BuildNamedLoad(iterator);
+ BuildKeyedLoad(iterator);
}
-void BytecodeGraphBuilder::VisitLoadICStrictWide(
+void BytecodeGraphBuilder::VisitKeyedLoadICStrict(
const interpreter::BytecodeArrayIterator& iterator) {
DCHECK(is_strict(language_mode()));
- BuildNamedLoad(iterator);
+ BuildKeyedLoad(iterator);
}
void BytecodeGraphBuilder::VisitKeyedLoadICSloppyWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_sloppy(language_mode()));
+ BuildKeyedLoad(iterator);
}
void BytecodeGraphBuilder::VisitKeyedLoadICStrictWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_strict(language_mode()));
+ BuildKeyedLoad(iterator);
+}
+
+
+void BytecodeGraphBuilder::BuildNamedStore(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ Node* value = environment()->LookupAccumulator();
+ Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0));
+ Handle<Name> name =
+ Handle<Name>::cast(iterator.GetConstantForIndexOperand(1));
+ VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(2));
+
+ const Operator* op =
+ javascript()->StoreNamed(language_mode(), name, feedback);
+ Node* node = NewNode(op, object, value, BuildLoadFeedbackVector());
+ AddEmptyFrameStateInputs(node);
+ environment()->BindAccumulator(value);
}
void BytecodeGraphBuilder::VisitStoreICSloppy(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_sloppy(language_mode()));
+ BuildNamedStore(iterator);
}
void BytecodeGraphBuilder::VisitStoreICStrict(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_strict(language_mode()));
+ BuildNamedStore(iterator);
}
-void BytecodeGraphBuilder::VisitKeyedStoreICSloppy(
+void BytecodeGraphBuilder::VisitStoreICSloppyWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_sloppy(language_mode()));
+ BuildNamedStore(iterator);
}
-void BytecodeGraphBuilder::VisitKeyedStoreICStrict(
+void BytecodeGraphBuilder::VisitStoreICStrictWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_strict(language_mode()));
+ BuildNamedStore(iterator);
}
-void BytecodeGraphBuilder::VisitStoreICSloppyWide(
+void BytecodeGraphBuilder::BuildKeyedStore(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ Node* value = environment()->LookupAccumulator();
+ Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0));
+ Node* key = environment()->LookupRegister(iterator.GetRegisterOperand(1));
+ VectorSlotPair feedback = CreateVectorSlotPair(iterator.GetIndexOperand(2));
+
+ const Operator* op = javascript()->StoreProperty(language_mode(), feedback);
+ Node* node = NewNode(op, object, key, value, BuildLoadFeedbackVector());
+ AddEmptyFrameStateInputs(node);
+ environment()->BindAccumulator(value);
}
-void BytecodeGraphBuilder::VisitStoreICStrictWide(
+void BytecodeGraphBuilder::VisitKeyedStoreICSloppy(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_sloppy(language_mode()));
+ BuildKeyedStore(iterator);
+}
+
+
+void BytecodeGraphBuilder::VisitKeyedStoreICStrict(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ DCHECK(is_strict(language_mode()));
+ BuildKeyedStore(iterator);
}
void BytecodeGraphBuilder::VisitKeyedStoreICSloppyWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_sloppy(language_mode()));
+ BuildKeyedStore(iterator);
}
void BytecodeGraphBuilder::VisitKeyedStoreICStrictWide(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ DCHECK(is_strict(language_mode()));
+ BuildKeyedStore(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