Chromium Code Reviews| 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 VectorSlotPair feedback = | |
| 812 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); | |
| 813 | |
| 814 const Operator* op = javascript()->CollectTypeProfile(feedback); | |
|
rmcilroy
2017/03/13 10:50:59
Do we want to collect type profile data in optimiz
Franzi
2017/03/13 12:01:56
I think we want to collect types for optimized cod
rmcilroy
2017/03/13 12:05:45
I thought generally nothing was optimized once we
| |
| 815 | |
| 816 Node* node = NewNode(op, name, value); | |
|
Michael Starzinger
2017/03/14 13:12:43
Do we ever want to optimize the CollectTypeProfile
Yang
2017/03/14 13:35:22
We might want to optimize it in the future. But fo
Michael Starzinger
2017/03/14 13:41:38
+1 to keeping it simple in the TurboFan IR for now
Franzi
2017/03/14 15:55:11
I deleted the opcode. Please have another look. Th
| |
| 817 environment()->RecordAfterState(node, Environment::kAttachFrameState); | |
| 818 } | |
| 819 | |
| 805 void BytecodeGraphBuilder::VisitLdaContextSlot() { | 820 void BytecodeGraphBuilder::VisitLdaContextSlot() { |
| 806 const Operator* op = javascript()->LoadContext( | 821 const Operator* op = javascript()->LoadContext( |
| 807 bytecode_iterator().GetUnsignedImmediateOperand(2), | 822 bytecode_iterator().GetUnsignedImmediateOperand(2), |
| 808 bytecode_iterator().GetIndexOperand(1), false); | 823 bytecode_iterator().GetIndexOperand(1), false); |
| 809 Node* node = NewNode(op); | 824 Node* node = NewNode(op); |
| 810 Node* context = | 825 Node* context = |
| 811 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 826 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
| 812 NodeProperties::ReplaceContextInput(node, context); | 827 NodeProperties::ReplaceContextInput(node, context); |
| 813 environment()->BindAccumulator(node); | 828 environment()->BindAccumulator(node); |
| 814 } | 829 } |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2430 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2445 it->source_position().ScriptOffset(), start_position_.InliningId())); |
| 2431 it->Advance(); | 2446 it->Advance(); |
| 2432 } else { | 2447 } else { |
| 2433 DCHECK_GT(it->code_offset(), offset); | 2448 DCHECK_GT(it->code_offset(), offset); |
| 2434 } | 2449 } |
| 2435 } | 2450 } |
| 2436 | 2451 |
| 2437 } // namespace compiler | 2452 } // namespace compiler |
| 2438 } // namespace internal | 2453 } // namespace internal |
| 2439 } // namespace v8 | 2454 } // namespace v8 |
| OLD | NEW |