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

Unified Diff: src/compiler/basic-block-instrumentor.cc

Issue 606403003: Refactor BasicBlock, no inheritance from GenericNode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Attempt n+1 to address the size_t madness Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/basic-block-profiler.cc ('k') | src/compiler/code-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/basic-block-instrumentor.cc
diff --git a/src/compiler/basic-block-instrumentor.cc b/src/compiler/basic-block-instrumentor.cc
index 119a44b9c9e7156dfba1c16f44f503d56bbc4ce4..3ee2bb29e226ae9e29aef1f6a332352930aae7e2 100644
--- a/src/compiler/basic-block-instrumentor.cc
+++ b/src/compiler/basic-block-instrumentor.cc
@@ -15,9 +15,9 @@ namespace compiler {
// Find the first place to insert new nodes in a block that's already been
// scheduled that won't upset the register allocator.
-static NodeVector::iterator FindInsertionPoint(NodeVector* nodes) {
- NodeVector::iterator i = nodes->begin();
- for (; i != nodes->end(); ++i) {
+static NodeVector::iterator FindInsertionPoint(BasicBlock* block) {
+ NodeVector::iterator i = block->begin();
+ for (; i != block->end(); ++i) {
const Operator* op = (*i)->op();
if (OperatorProperties::IsBasicBlockBegin(op)) continue;
switch (op->opcode()) {
@@ -72,7 +72,7 @@ BasicBlockProfiler::Data* BasicBlockInstrumentor::Instrument(
for (BasicBlockVector::iterator it = blocks->begin(); block_number < n_blocks;
++it, ++block_number) {
BasicBlock* block = (*it);
- data->SetBlockId(block_number, block->id());
+ data->SetBlockId(block_number, block->id().ToSize());
// TODO(dcarney): wire effect and control deps for load and store.
// Construct increment operation.
Node* base = graph->NewNode(
@@ -86,10 +86,9 @@ BasicBlockProfiler::Data* BasicBlockInstrumentor::Instrument(
static const int kArraySize = 6;
Node* to_insert[kArraySize] = {zero, one, base, load, inc, store};
int insertion_start = block_number == 0 ? 0 : 2;
- NodeVector* nodes = &block->nodes_;
- NodeVector::iterator insertion_point = FindInsertionPoint(nodes);
- nodes->insert(insertion_point, &to_insert[insertion_start],
- &to_insert[kArraySize]);
+ NodeVector::iterator insertion_point = FindInsertionPoint(block);
+ block->InsertNodes(insertion_point, &to_insert[insertion_start],
+ &to_insert[kArraySize]);
// Tell the scheduler about the new nodes.
for (int i = insertion_start; i < kArraySize; ++i) {
schedule->SetBlockForNode(block, to_insert[i]);
« no previous file with comments | « src/basic-block-profiler.cc ('k') | src/compiler/code-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698