Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2707873002: Collect type profile for DevTools. (Closed)
Patch Set: Add documentation and sprinkle consts around. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
815
816 Node* node = NewNode(op, name, value);
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 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 it->source_position().ScriptOffset(), start_position_.InliningId())); 2449 it->source_position().ScriptOffset(), start_position_.InliningId()));
2435 it->Advance(); 2450 it->Advance();
2436 } else { 2451 } else {
2437 DCHECK_GT(it->code_offset(), offset); 2452 DCHECK_GT(it->code_offset(), offset);
2438 } 2453 }
2439 } 2454 }
2440 2455
2441 } // namespace compiler 2456 } // namespace compiler
2442 } // namespace internal 2457 } // namespace internal
2443 } // namespace v8 2458 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698