OLD | NEW |
---|---|
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 | 697 |
698 | 698 |
699 void BytecodeGraphBuilder::VisitCreateUnmappedArguments( | 699 void BytecodeGraphBuilder::VisitCreateUnmappedArguments( |
700 const interpreter::BytecodeArrayIterator& iterator) { | 700 const interpreter::BytecodeArrayIterator& iterator) { |
701 UNIMPLEMENTED(); | 701 UNIMPLEMENTED(); |
702 } | 702 } |
703 | 703 |
704 | 704 |
705 void BytecodeGraphBuilder::VisitCreateRegExpLiteral( | 705 void BytecodeGraphBuilder::VisitCreateRegExpLiteral( |
706 const interpreter::BytecodeArrayIterator& iterator) { | 706 const interpreter::BytecodeArrayIterator& iterator) { |
707 UNIMPLEMENTED(); | 707 Node* closure = GetFunctionClosure(); |
708 const Operator* op = javascript()->CreateLiteralRegExp( | |
709 Handle<String>::cast(iterator.GetConstantForIndexOperand(0)), | |
710 iterator.GetImmediateOperand(2), iterator.GetIndexOperand(1)); | |
rmcilroy
2015/12/07 14:33:22
Could you pull out the iterator.GetXXX() to named
mythria
2015/12/07 15:11:18
Done.
| |
711 Node* literal = NewNode(op, closure); | |
712 AddEmptyFrameStateInputs(literal); | |
713 environment()->BindAccumulator(literal); | |
708 } | 714 } |
709 | 715 |
710 | 716 |
711 void BytecodeGraphBuilder::VisitCreateArrayLiteral( | 717 void BytecodeGraphBuilder::VisitCreateArrayLiteral( |
712 const interpreter::BytecodeArrayIterator& iterator) { | 718 const interpreter::BytecodeArrayIterator& iterator) { |
713 UNIMPLEMENTED(); | 719 Node* closure = GetFunctionClosure(); |
720 const Operator* op = javascript()->CreateLiteralArray( | |
721 Handle<FixedArray>::cast(iterator.GetConstantForIndexOperand(0)), | |
722 iterator.GetImmediateOperand(2), iterator.GetIndexOperand(1)); | |
723 Node* literal = NewNode(op, closure); | |
724 AddEmptyFrameStateInputs(literal); | |
725 environment()->BindAccumulator(literal); | |
714 } | 726 } |
715 | 727 |
716 | 728 |
717 void BytecodeGraphBuilder::VisitCreateObjectLiteral( | 729 void BytecodeGraphBuilder::VisitCreateObjectLiteral( |
718 const interpreter::BytecodeArrayIterator& iterator) { | 730 const interpreter::BytecodeArrayIterator& iterator) { |
719 UNIMPLEMENTED(); | 731 Node* closure = GetFunctionClosure(); |
732 const Operator* op = javascript()->CreateLiteralObject( | |
733 Handle<FixedArray>::cast(iterator.GetConstantForIndexOperand(0)), | |
734 iterator.GetImmediateOperand(2), iterator.GetIndexOperand(1)); | |
735 Node* literal = NewNode(op, closure); | |
736 AddEmptyFrameStateInputs(literal); | |
737 environment()->BindAccumulator(literal); | |
720 } | 738 } |
721 | 739 |
722 | 740 |
723 Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, | 741 Node* BytecodeGraphBuilder::ProcessCallArguments(const Operator* call_op, |
724 Node* callee, | 742 Node* callee, |
725 interpreter::Register receiver, | 743 interpreter::Register receiver, |
726 size_t arity) { | 744 size_t arity) { |
727 Node** all = info()->zone()->NewArray<Node*>(static_cast<int>(arity)); | 745 Node** all = info()->zone()->NewArray<Node*>(static_cast<int>(arity)); |
728 all[0] = callee; | 746 all[0] = callee; |
729 all[1] = environment()->LookupRegister(receiver); | 747 all[1] = environment()->LookupRegister(receiver); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1322 | 1340 |
1323 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1341 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1324 if (environment()->IsMarkedAsUnreachable()) return; | 1342 if (environment()->IsMarkedAsUnreachable()) return; |
1325 environment()->MarkAsUnreachable(); | 1343 environment()->MarkAsUnreachable(); |
1326 exit_controls_.push_back(exit); | 1344 exit_controls_.push_back(exit); |
1327 } | 1345 } |
1328 | 1346 |
1329 } // namespace compiler | 1347 } // namespace compiler |
1330 } // namespace internal | 1348 } // namespace internal |
1331 } // namespace v8 | 1349 } // namespace v8 |
OLD | NEW |