Chromium Code Reviews| 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..4355b10d6f7ca631573c98b1fa748a4d6f4e939f 100644 |
| --- a/src/compiler/bytecode-graph-builder.cc |
| +++ b/src/compiler/bytecode-graph-builder.cc |
| @@ -702,21 +702,84 @@ void BytecodeGraphBuilder::VisitCreateUnmappedArguments( |
| } |
| +void BytecodeGraphBuilder::BuildCreateRegExpLiteral( |
| + const interpreter::BytecodeArrayIterator& iterator) { |
| + Node* closure = GetFunctionClosure(); |
|
Benedikt Meurer
2015/12/09 07:24:11
This code is duplicated 3 times. How about adding
mythria
2015/12/09 09:48:20
Done.
|
| + 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); |
| + Node* literal = NewNode(op, closure); |
| + AddEmptyFrameStateInputs(literal); |
| + environment()->BindAccumulator(literal); |
| +} |
| + |
| + |
| 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) { |
| + Node* closure = GetFunctionClosure(); |
| + 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); |
| + Node* literal = NewNode(op, closure); |
| + AddEmptyFrameStateInputs(literal); |
| + environment()->BindAccumulator(literal); |
| } |
| 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) { |
| + Node* closure = GetFunctionClosure(); |
| + 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); |
| + Node* literal = NewNode(op, closure); |
| + AddEmptyFrameStateInputs(literal); |
| + environment()->BindAccumulator(literal); |
| } |
| void BytecodeGraphBuilder::VisitCreateObjectLiteral( |
| const interpreter::BytecodeArrayIterator& iterator) { |
| - UNIMPLEMENTED(); |
| + BuildCreateObjectLiteral(iterator); |
| +} |
| + |
| + |
| +void BytecodeGraphBuilder::VisitCreateObjectLiteralWide( |
| + const interpreter::BytecodeArrayIterator& iterator) { |
| + BuildCreateObjectLiteral(iterator); |
| } |