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/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/compiler-source-position-table.h" | 10 #include "src/compiler/compiler-source-position-table.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 Node* value = environment()->LookupAccumulator(); | 795 Node* value = environment()->LookupAccumulator(); |
796 int flags = bytecode_iterator().GetFlagOperand(2); | 796 int flags = bytecode_iterator().GetFlagOperand(2); |
797 VectorSlotPair feedback = | 797 VectorSlotPair feedback = |
798 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); | 798 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(3)); |
799 | 799 |
800 const Operator* op = javascript()->StoreDataPropertyInLiteral(feedback); | 800 const Operator* op = javascript()->StoreDataPropertyInLiteral(feedback); |
801 Node* node = NewNode(op, object, name, value, jsgraph()->Constant(flags)); | 801 Node* node = NewNode(op, object, name, value, jsgraph()->Constant(flags)); |
802 environment()->RecordAfterState(node, Environment::kAttachFrameState); | 802 environment()->RecordAfterState(node, Environment::kAttachFrameState); |
803 } | 803 } |
804 | 804 |
805 void BytecodeGraphBuilder::VisitCollectTypeProfile() { | |
806 PrepareEagerCheckpoint(); | |
807 | |
808 Node* name = | |
809 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | |
810 Node* value = environment()->LookupAccumulator(); | |
811 Node* index = jsgraph()->Constant(bytecode_iterator().GetIndexOperand(1)); | |
812 | |
813 Node* vector = jsgraph()->Constant(feedback_vector()); | |
814 | |
815 const Operator* op = javascript()->CallRuntime(Runtime::kCollectTypeProfile); | |
816 | |
817 Node* node = NewNode(op, name, value, vector, index); | |
818 environment()->RecordAfterState(node, Environment::kAttachFrameState); | |
819 } | |
820 | |
821 void BytecodeGraphBuilder::VisitLdaContextSlot() { | 805 void BytecodeGraphBuilder::VisitLdaContextSlot() { |
822 const Operator* op = javascript()->LoadContext( | 806 const Operator* op = javascript()->LoadContext( |
823 bytecode_iterator().GetUnsignedImmediateOperand(2), | 807 bytecode_iterator().GetUnsignedImmediateOperand(2), |
824 bytecode_iterator().GetIndexOperand(1), false); | 808 bytecode_iterator().GetIndexOperand(1), false); |
825 Node* node = NewNode(op); | 809 Node* node = NewNode(op); |
826 Node* context = | 810 Node* context = |
827 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 811 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
828 NodeProperties::ReplaceContextInput(node, context); | 812 NodeProperties::ReplaceContextInput(node, context); |
829 environment()->BindAccumulator(node); | 813 environment()->BindAccumulator(node); |
830 } | 814 } |
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2540 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2524 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2541 it->Advance(); | 2525 it->Advance(); |
2542 } else { | 2526 } else { |
2543 DCHECK_GT(it->code_offset(), offset); | 2527 DCHECK_GT(it->code_offset(), offset); |
2544 } | 2528 } |
2545 } | 2529 } |
2546 | 2530 |
2547 } // namespace compiler | 2531 } // namespace compiler |
2548 } // namespace internal | 2532 } // namespace internal |
2549 } // namespace v8 | 2533 } // namespace v8 |
OLD | NEW |