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 | 10 |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 | 750 |
751 | 751 |
752 void BytecodeGraphBuilder::VisitDec( | 752 void BytecodeGraphBuilder::VisitDec( |
753 const interpreter::BytecodeArrayIterator& iterator) { | 753 const interpreter::BytecodeArrayIterator& iterator) { |
754 UNIMPLEMENTED(); | 754 UNIMPLEMENTED(); |
755 } | 755 } |
756 | 756 |
757 | 757 |
758 void BytecodeGraphBuilder::VisitLogicalNot( | 758 void BytecodeGraphBuilder::VisitLogicalNot( |
759 const interpreter::BytecodeArrayIterator& iterator) { | 759 const interpreter::BytecodeArrayIterator& iterator) { |
760 UNIMPLEMENTED(); | 760 Node* node = |
| 761 NewNode(javascript()->UnaryNot(), environment()->LookupAccumulator()); |
| 762 environment()->BindAccumulator(node); |
761 } | 763 } |
762 | 764 |
763 | 765 |
764 void BytecodeGraphBuilder::VisitTypeOf( | 766 void BytecodeGraphBuilder::VisitTypeOf( |
765 const interpreter::BytecodeArrayIterator& iterator) { | 767 const interpreter::BytecodeArrayIterator& iterator) { |
766 UNIMPLEMENTED(); | 768 Node* node = |
| 769 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); |
| 770 environment()->BindAccumulator(node); |
| 771 } |
| 772 |
| 773 |
| 774 void BytecodeGraphBuilder::BuildDelete( |
| 775 const interpreter::BytecodeArrayIterator& iterator) { |
| 776 Node* key = environment()->LookupAccumulator(); |
| 777 Node* object = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
| 778 |
| 779 Node* node = |
| 780 NewNode(javascript()->DeleteProperty(language_mode()), object, key); |
| 781 AddEmptyFrameStateInputs(node); |
| 782 environment()->BindAccumulator(node); |
767 } | 783 } |
768 | 784 |
769 | 785 |
770 void BytecodeGraphBuilder::VisitDeletePropertyStrict( | 786 void BytecodeGraphBuilder::VisitDeletePropertyStrict( |
771 const interpreter::BytecodeArrayIterator& iterator) { | 787 const interpreter::BytecodeArrayIterator& iterator) { |
772 UNIMPLEMENTED(); | 788 DCHECK(is_strict(language_mode())); |
| 789 BuildDelete(iterator); |
773 } | 790 } |
774 | 791 |
775 | 792 |
776 void BytecodeGraphBuilder::VisitDeletePropertySloppy( | 793 void BytecodeGraphBuilder::VisitDeletePropertySloppy( |
777 const interpreter::BytecodeArrayIterator& iterator) { | 794 const interpreter::BytecodeArrayIterator& iterator) { |
778 UNIMPLEMENTED(); | 795 DCHECK(is_sloppy(language_mode())); |
| 796 BuildDelete(iterator); |
779 } | 797 } |
780 | 798 |
781 | 799 |
782 void BytecodeGraphBuilder::VisitTestEqual( | 800 void BytecodeGraphBuilder::VisitTestEqual( |
783 const interpreter::BytecodeArrayIterator& iterator) { | 801 const interpreter::BytecodeArrayIterator& iterator) { |
784 UNIMPLEMENTED(); | 802 UNIMPLEMENTED(); |
785 } | 803 } |
786 | 804 |
787 | 805 |
788 void BytecodeGraphBuilder::VisitTestNotEqual( | 806 void BytecodeGraphBuilder::VisitTestNotEqual( |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 | 1087 |
1070 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1088 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1071 if (environment()->IsMarkedAsUnreachable()) return; | 1089 if (environment()->IsMarkedAsUnreachable()) return; |
1072 environment()->MarkAsUnreachable(); | 1090 environment()->MarkAsUnreachable(); |
1073 exit_controls_.push_back(exit); | 1091 exit_controls_.push_back(exit); |
1074 } | 1092 } |
1075 | 1093 |
1076 } // namespace compiler | 1094 } // namespace compiler |
1077 } // namespace internal | 1095 } // namespace internal |
1078 } // namespace v8 | 1096 } // namespace v8 |
OLD | NEW |