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

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

Issue 1503963002: [Interpreter] Adds wide variant of CreateLiterals. Adds CreateLiterals to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: renamed BuildLiteral to BuildCreateLiteral. 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') | src/interpreter/bytecode-array-builder.h » ('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 5f963770075659cb1939025cf35861bd8235407c..3e4b6f5992243f53f8eb9a7fb507a7583379e0dc 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -702,21 +702,82 @@ void BytecodeGraphBuilder::VisitCreateUnmappedArguments(
}
+void BytecodeGraphBuilder::BuildCreateLiteral(const Operator* op) {
+ Node* literal = NewNode(op, GetFunctionClosure());
+ AddEmptyFrameStateInputs(literal);
+ environment()->BindAccumulator(literal);
+}
+
+
+void BytecodeGraphBuilder::BuildCreateRegExpLiteral(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ Handle<String> constant_pattern =
+ Handle<String>::cast(iterator.GetConstantForIndexOperand(0));
+ int literal_index = iterator.GetIndexOperand(1);
+ int literal_flags = iterator.GetImmediateOperand(2);
+ const Operator* op = javascript()->CreateLiteralRegExp(
+ constant_pattern, literal_flags, literal_index);
+ BuildCreateLiteral(op);
+}
+
+
void BytecodeGraphBuilder::VisitCreateRegExpLiteral(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCreateRegExpLiteral(iterator);
+}
+
+
+void BytecodeGraphBuilder::VisitCreateRegExpLiteralWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildCreateRegExpLiteral(iterator);
+}
+
+
+void BytecodeGraphBuilder::BuildCreateArrayLiteral(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ Handle<FixedArray> constant_elements =
+ Handle<FixedArray>::cast(iterator.GetConstantForIndexOperand(0));
+ int literal_index = iterator.GetIndexOperand(1);
+ int literal_flags = iterator.GetImmediateOperand(2);
+ const Operator* op = javascript()->CreateLiteralArray(
+ constant_elements, literal_flags, literal_index);
+ BuildCreateLiteral(op);
}
void BytecodeGraphBuilder::VisitCreateArrayLiteral(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCreateArrayLiteral(iterator);
+}
+
+
+void BytecodeGraphBuilder::VisitCreateArrayLiteralWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildCreateArrayLiteral(iterator);
+}
+
+
+void BytecodeGraphBuilder::BuildCreateObjectLiteral(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ Handle<FixedArray> constant_properties =
+ Handle<FixedArray>::cast(iterator.GetConstantForIndexOperand(0));
+ int literal_index = iterator.GetIndexOperand(1);
+ int literal_flags = iterator.GetImmediateOperand(2);
+ const Operator* op = javascript()->CreateLiteralObject(
+ constant_properties, literal_flags, literal_index);
+ BuildCreateLiteral(op);
}
void BytecodeGraphBuilder::VisitCreateObjectLiteral(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ BuildCreateObjectLiteral(iterator);
+}
+
+
+void BytecodeGraphBuilder::VisitCreateObjectLiteralWide(
+ const interpreter::BytecodeArrayIterator& iterator) {
+ BuildCreateObjectLiteral(iterator);
}
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698