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/node-matchers.h" |
8 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
9 #include "src/interpreter/bytecode-array-iterator.h" | 10 #include "src/interpreter/bytecode-array-iterator.h" |
10 | 11 |
11 namespace v8 { | 12 namespace v8 { |
12 namespace internal { | 13 namespace internal { |
13 namespace compiler { | 14 namespace compiler { |
14 | 15 |
15 // Issues: | 16 // Issues: |
16 // - Need to deal with FrameState / FrameStateBeforeAndAfter / StateValue. | 17 // - Need to deal with FrameState / FrameStateBeforeAndAfter / StateValue. |
17 // - Scopes - intimately tied to AST. Need to eval what is needed. | 18 // - Scopes - intimately tied to AST. Need to eval what is needed. |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 637 |
637 | 638 |
638 void BytecodeGraphBuilder::VisitPopContext( | 639 void BytecodeGraphBuilder::VisitPopContext( |
639 const interpreter::BytecodeArrayIterator& iterator) { | 640 const interpreter::BytecodeArrayIterator& iterator) { |
640 UNIMPLEMENTED(); | 641 UNIMPLEMENTED(); |
641 } | 642 } |
642 | 643 |
643 | 644 |
644 void BytecodeGraphBuilder::VisitCreateClosure( | 645 void BytecodeGraphBuilder::VisitCreateClosure( |
645 const interpreter::BytecodeArrayIterator& iterator) { | 646 const interpreter::BytecodeArrayIterator& iterator) { |
646 UNIMPLEMENTED(); | 647 Node* accumulator = environment()->LookupAccumulator(); |
| 648 HeapObjectMatcher shared_info_matcher(accumulator); |
| 649 PretenureFlag pretenure = |
| 650 iterator.GetImmediateOperand(0) ? TENURED : NOT_TENURED; |
| 651 const Operator* op = javascript()->CreateClosure( |
| 652 Handle<SharedFunctionInfo>::cast(shared_info_matcher.Value()), pretenure); |
| 653 Node* closure = NewNode(op); |
| 654 AddEmptyFrameStateInputs(closure); |
| 655 environment()->BindAccumulator(closure); |
647 } | 656 } |
648 | 657 |
649 | 658 |
650 void BytecodeGraphBuilder::VisitCreateMappedArguments( | 659 void BytecodeGraphBuilder::VisitCreateMappedArguments( |
651 const interpreter::BytecodeArrayIterator& iterator) { | 660 const interpreter::BytecodeArrayIterator& iterator) { |
652 UNIMPLEMENTED(); | 661 UNIMPLEMENTED(); |
653 } | 662 } |
654 | 663 |
655 | 664 |
656 void BytecodeGraphBuilder::VisitCreateUnmappedArguments( | 665 void BytecodeGraphBuilder::VisitCreateUnmappedArguments( |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 | 1237 |
1229 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1238 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1230 if (environment()->IsMarkedAsUnreachable()) return; | 1239 if (environment()->IsMarkedAsUnreachable()) return; |
1231 environment()->MarkAsUnreachable(); | 1240 environment()->MarkAsUnreachable(); |
1232 exit_controls_.push_back(exit); | 1241 exit_controls_.push_back(exit); |
1233 } | 1242 } |
1234 | 1243 |
1235 } // namespace compiler | 1244 } // namespace compiler |
1236 } // namespace internal | 1245 } // namespace internal |
1237 } // namespace v8 | 1246 } // namespace v8 |
OLD | NEW |