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/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 // available in bytecode array. update this code when the implementation | 759 // available in bytecode array. update this code when the implementation |
760 // changes. | 760 // changes. |
761 const Operator* op = | 761 const Operator* op = |
762 javascript()->LoadContext(0, iterator.GetIndexOperand(1), false); | 762 javascript()->LoadContext(0, iterator.GetIndexOperand(1), false); |
763 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 763 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
764 Node* node = NewNode(op, context); | 764 Node* node = NewNode(op, context); |
765 environment()->BindAccumulator(node); | 765 environment()->BindAccumulator(node); |
766 } | 766 } |
767 | 767 |
768 | 768 |
| 769 void BytecodeGraphBuilder::VisitLdaContextSlotWide( |
| 770 const interpreter::BytecodeArrayIterator& iterator) { |
| 771 VisitLdaContextSlot(iterator); |
| 772 } |
| 773 |
| 774 |
769 void BytecodeGraphBuilder::VisitStaContextSlot( | 775 void BytecodeGraphBuilder::VisitStaContextSlot( |
770 const interpreter::BytecodeArrayIterator& iterator) { | 776 const interpreter::BytecodeArrayIterator& iterator) { |
771 // TODO(mythria): LoadContextSlots are unrolled by the required depth when | 777 // TODO(mythria): LoadContextSlots are unrolled by the required depth when |
772 // generating bytecode. Hence the value of depth is always 0. Update this | 778 // generating bytecode. Hence the value of depth is always 0. Update this |
773 // code, when the implementation changes. | 779 // code, when the implementation changes. |
774 const Operator* op = | 780 const Operator* op = |
775 javascript()->StoreContext(0, iterator.GetIndexOperand(1)); | 781 javascript()->StoreContext(0, iterator.GetIndexOperand(1)); |
776 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); | 782 Node* context = environment()->LookupRegister(iterator.GetRegisterOperand(0)); |
777 Node* value = environment()->LookupAccumulator(); | 783 Node* value = environment()->LookupAccumulator(); |
778 NewNode(op, context, value); | 784 NewNode(op, context, value); |
779 } | 785 } |
780 | 786 |
781 | 787 |
| 788 void BytecodeGraphBuilder::VisitStaContextSlotWide( |
| 789 const interpreter::BytecodeArrayIterator& iterator) { |
| 790 VisitStaContextSlot(iterator); |
| 791 } |
| 792 |
| 793 |
782 void BytecodeGraphBuilder::BuildLdaLookupSlot( | 794 void BytecodeGraphBuilder::BuildLdaLookupSlot( |
783 TypeofMode typeof_mode, | 795 TypeofMode typeof_mode, |
784 const interpreter::BytecodeArrayIterator& iterator) { | 796 const interpreter::BytecodeArrayIterator& iterator) { |
785 FrameStateBeforeAndAfter states(this, iterator); | 797 FrameStateBeforeAndAfter states(this, iterator); |
786 Handle<String> name = | 798 Handle<String> name = |
787 Handle<String>::cast(iterator.GetConstantForIndexOperand(0)); | 799 Handle<String>::cast(iterator.GetConstantForIndexOperand(0)); |
788 const Operator* op = javascript()->LoadDynamic(name, typeof_mode); | 800 const Operator* op = javascript()->LoadDynamic(name, typeof_mode); |
789 Node* value = | 801 Node* value = |
790 NewNode(op, BuildLoadFeedbackVector(), environment()->Context()); | 802 NewNode(op, BuildLoadFeedbackVector(), environment()->Context()); |
791 environment()->BindAccumulator(value, &states); | 803 environment()->BindAccumulator(value, &states); |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 | 2015 |
2004 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 2016 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
2005 if (environment()->IsMarkedAsUnreachable()) return; | 2017 if (environment()->IsMarkedAsUnreachable()) return; |
2006 environment()->MarkAsUnreachable(); | 2018 environment()->MarkAsUnreachable(); |
2007 exit_controls_.push_back(exit); | 2019 exit_controls_.push_back(exit); |
2008 } | 2020 } |
2009 | 2021 |
2010 } // namespace compiler | 2022 } // namespace compiler |
2011 } // namespace internal | 2023 } // namespace internal |
2012 } // namespace v8 | 2024 } // namespace v8 |
OLD | NEW |