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

Side by Side Diff: src/compiler/basic-block-instrumentor.cc

Issue 1362783004: Revert of [turbofan] Checking of input counts on node creation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | src/compiler/graph.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/basic-block-instrumentor.h" 5 #include "src/compiler/basic-block-instrumentor.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 BasicBlockVector* blocks = schedule->rpo_order(); 74 BasicBlockVector* blocks = schedule->rpo_order();
75 size_t block_number = 0; 75 size_t block_number = 0;
76 for (BasicBlockVector::iterator it = blocks->begin(); block_number < n_blocks; 76 for (BasicBlockVector::iterator it = blocks->begin(); block_number < n_blocks;
77 ++it, ++block_number) { 77 ++it, ++block_number) {
78 BasicBlock* block = (*it); 78 BasicBlock* block = (*it);
79 data->SetBlockId(block_number, block->id().ToSize()); 79 data->SetBlockId(block_number, block->id().ToSize());
80 // TODO(dcarney): wire effect and control deps for load and store. 80 // TODO(dcarney): wire effect and control deps for load and store.
81 // Construct increment operation. 81 // Construct increment operation.
82 Node* base = graph->NewNode( 82 Node* base = graph->NewNode(
83 PointerConstant(&common, data->GetCounterAddress(block_number))); 83 PointerConstant(&common, data->GetCounterAddress(block_number)));
84 Node* load = graph->NewNode(machine.Load(kMachUint32), base, zero, 84 Node* load = graph->NewNode(machine.Load(kMachUint32), base, zero);
85 graph->start(), graph->start());
86 Node* inc = graph->NewNode(machine.Int32Add(), load, one); 85 Node* inc = graph->NewNode(machine.Int32Add(), load, one);
87 Node* store = graph->NewNode( 86 Node* store = graph->NewNode(
88 machine.Store(StoreRepresentation(kMachUint32, kNoWriteBarrier)), base, 87 machine.Store(StoreRepresentation(kMachUint32, kNoWriteBarrier)), base,
89 zero, inc, graph->start(), graph->start()); 88 zero, inc);
90 // Insert the new nodes. 89 // Insert the new nodes.
91 static const int kArraySize = 6; 90 static const int kArraySize = 6;
92 Node* to_insert[kArraySize] = {zero, one, base, load, inc, store}; 91 Node* to_insert[kArraySize] = {zero, one, base, load, inc, store};
93 int insertion_start = block_number == 0 ? 0 : 2; 92 int insertion_start = block_number == 0 ? 0 : 2;
94 NodeVector::iterator insertion_point = FindInsertionPoint(block); 93 NodeVector::iterator insertion_point = FindInsertionPoint(block);
95 block->InsertNodes(insertion_point, &to_insert[insertion_start], 94 block->InsertNodes(insertion_point, &to_insert[insertion_start],
96 &to_insert[kArraySize]); 95 &to_insert[kArraySize]);
97 // Tell the scheduler about the new nodes. 96 // Tell the scheduler about the new nodes.
98 for (int i = insertion_start; i < kArraySize; ++i) { 97 for (int i = insertion_start; i < kArraySize; ++i) {
99 schedule->SetBlockForNode(block, to_insert[i]); 98 schedule->SetBlockForNode(block, to_insert[i]);
100 } 99 }
101 } 100 }
102 return data; 101 return data;
103 } 102 }
104 103
105 } // namespace compiler 104 } // namespace compiler
106 } // namespace internal 105 } // namespace internal
107 } // namespace v8 106 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698