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

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

Issue 985023002: [turbofan] Add schedule to visualizer output (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove redundant cdoe Created 5 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
« no previous file with comments | « no previous file | src/compiler/graph-visualizer.h » ('j') | src/compiler/visualizer.cc » ('J')
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"
11 #include "src/compiler/graph.h" 11 #include "src/compiler/graph.h"
12 #include "src/compiler/machine-operator.h" 12 #include "src/compiler/machine-operator.h"
13 #include "src/compiler/node.h" 13 #include "src/compiler/node.h"
14 #include "src/compiler/operator-properties.h" 14 #include "src/compiler/operator-properties.h"
15 #include "src/compiler/schedule.h" 15 #include "src/compiler/schedule.h"
16 #include "src/compiler/visualizer.h"
16 17
17 namespace v8 { 18 namespace v8 {
18 namespace internal { 19 namespace internal {
19 namespace compiler { 20 namespace compiler {
20 21
21 // Find the first place to insert new nodes in a block that's already been 22 // Find the first place to insert new nodes in a block that's already been
22 // scheduled that won't upset the register allocator. 23 // scheduled that won't upset the register allocator.
23 static NodeVector::iterator FindInsertionPoint(BasicBlock* block) { 24 static NodeVector::iterator FindInsertionPoint(BasicBlock* block) {
24 NodeVector::iterator i = block->begin(); 25 NodeVector::iterator i = block->begin();
25 for (; i != block->end(); ++i) { 26 for (; i != block->end(); ++i) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Set the function name. 58 // Set the function name.
58 if (!info->shared_info().is_null() && 59 if (!info->shared_info().is_null() &&
59 info->shared_info()->name()->IsString()) { 60 info->shared_info()->name()->IsString()) {
60 std::ostringstream os; 61 std::ostringstream os;
61 String::cast(info->shared_info()->name())->PrintUC16(os); 62 String::cast(info->shared_info()->name())->PrintUC16(os);
62 data->SetFunctionName(&os); 63 data->SetFunctionName(&os);
63 } 64 }
64 // Capture the schedule string before instrumentation. 65 // Capture the schedule string before instrumentation.
65 { 66 {
66 std::ostringstream os; 67 std::ostringstream os;
67 os << *schedule; 68 os << ScheduleAsJSON(*schedule);
68 data->SetSchedule(&os); 69 data->SetSchedule(&os);
69 } 70 }
70 // Add the increment instructions to the start of every block. 71 // Add the increment instructions to the start of every block.
71 CommonOperatorBuilder common(graph->zone()); 72 CommonOperatorBuilder common(graph->zone());
72 Node* zero = graph->NewNode(common.Int32Constant(0)); 73 Node* zero = graph->NewNode(common.Int32Constant(0));
73 Node* one = graph->NewNode(common.Int32Constant(1)); 74 Node* one = graph->NewNode(common.Int32Constant(1));
74 MachineOperatorBuilder machine(graph->zone()); 75 MachineOperatorBuilder machine(graph->zone());
75 BasicBlockVector* blocks = schedule->rpo_order(); 76 BasicBlockVector* blocks = schedule->rpo_order();
76 size_t block_number = 0; 77 size_t block_number = 0;
77 for (BasicBlockVector::iterator it = blocks->begin(); block_number < n_blocks; 78 for (BasicBlockVector::iterator it = blocks->begin(); block_number < n_blocks;
(...skipping 20 matching lines...) Expand all
98 for (int i = insertion_start; i < kArraySize; ++i) { 99 for (int i = insertion_start; i < kArraySize; ++i) {
99 schedule->SetBlockForNode(block, to_insert[i]); 100 schedule->SetBlockForNode(block, to_insert[i]);
100 } 101 }
101 } 102 }
102 return data; 103 return data;
103 } 104 }
104 105
105 } // namespace compiler 106 } // namespace compiler
106 } // namespace internal 107 } // namespace internal
107 } // namespace v8 108 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/graph-visualizer.h » ('j') | src/compiler/visualizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698