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/escape-analysis-reducer.h" | 5 #include "src/compiler/escape-analysis-reducer.h" |
6 | 6 |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/counters.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 EscapeAnalysisReducer::EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph, | 14 EscapeAnalysisReducer::EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph, |
15 EscapeAnalysis* escape_analysis, | 15 EscapeAnalysis* escape_analysis, |
16 Zone* zone) | 16 Zone* zone) |
17 : AdvancedReducer(editor), | 17 : AdvancedReducer(editor), |
18 jsgraph_(jsgraph), | 18 jsgraph_(jsgraph), |
(...skipping 24 matching lines...) Expand all Loading... | |
43 break; | 43 break; |
44 } | 44 } |
45 return NoChange(); | 45 return NoChange(); |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) { | 49 Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) { |
50 DCHECK(node->opcode() == IrOpcode::kLoadField || | 50 DCHECK(node->opcode() == IrOpcode::kLoadField || |
51 node->opcode() == IrOpcode::kLoadElement); | 51 node->opcode() == IrOpcode::kLoadElement); |
52 if (Node* rep = escape_analysis()->GetReplacement(node)) { | 52 if (Node* rep = escape_analysis()->GetReplacement(node)) { |
53 jsgraph() | |
Benedikt Meurer
2016/01/05 04:55:58
Nit: Add EscapeAnalysisReducer::isolate() and/or E
sigurds
2016/01/05 09:22:26
Done.
| |
54 ->isolate() | |
55 ->counters() | |
56 ->turbo_escape_loads_replaced() | |
57 ->Increment(); | |
53 if (FLAG_trace_turbo_escape) { | 58 if (FLAG_trace_turbo_escape) { |
54 PrintF("Replaced #%d (%s) with #%d (%s)\n", node->id(), | 59 PrintF("Replaced #%d (%s) with #%d (%s)\n", node->id(), |
55 node->op()->mnemonic(), rep->id(), rep->op()->mnemonic()); | 60 node->op()->mnemonic(), rep->id(), rep->op()->mnemonic()); |
56 } | 61 } |
57 ReplaceWithValue(node, rep); | 62 ReplaceWithValue(node, rep); |
58 return Changed(rep); | 63 return Changed(rep); |
59 } | 64 } |
60 return NoChange(); | 65 return NoChange(); |
61 } | 66 } |
62 | 67 |
(...skipping 10 matching lines...) Expand all Loading... | |
73 return Changed(node); | 78 return Changed(node); |
74 } | 79 } |
75 return NoChange(); | 80 return NoChange(); |
76 } | 81 } |
77 | 82 |
78 | 83 |
79 Reduction EscapeAnalysisReducer::ReduceAllocate(Node* node) { | 84 Reduction EscapeAnalysisReducer::ReduceAllocate(Node* node) { |
80 DCHECK_EQ(node->opcode(), IrOpcode::kAllocate); | 85 DCHECK_EQ(node->opcode(), IrOpcode::kAllocate); |
81 if (escape_analysis()->IsVirtual(node)) { | 86 if (escape_analysis()->IsVirtual(node)) { |
82 RelaxEffectsAndControls(node); | 87 RelaxEffectsAndControls(node); |
88 jsgraph() | |
Benedikt Meurer
2016/01/05 04:55:58
Nit: Add EscapeAnalysisReducer::isolate() and/or E
sigurds
2016/01/05 09:22:26
Done.
| |
89 ->isolate() | |
90 ->counters() | |
91 ->turbo_escape_allocs_replaced() | |
92 ->Increment(); | |
83 if (FLAG_trace_turbo_escape) { | 93 if (FLAG_trace_turbo_escape) { |
84 PrintF("Removed allocate #%d from effect chain\n", node->id()); | 94 PrintF("Removed allocate #%d from effect chain\n", node->id()); |
85 } | 95 } |
86 return Changed(node); | 96 return Changed(node); |
87 } | 97 } |
88 return NoChange(); | 98 return NoChange(); |
89 } | 99 } |
90 | 100 |
91 | 101 |
92 Reduction EscapeAnalysisReducer::ReduceFinishRegion(Node* node) { | 102 Reduction EscapeAnalysisReducer::ReduceFinishRegion(Node* node) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 } | 193 } |
184 } | 194 } |
185 } | 195 } |
186 return r; | 196 return r; |
187 } | 197 } |
188 | 198 |
189 | 199 |
190 } // namespace compiler | 200 } // namespace compiler |
191 } // namespace internal | 201 } // namespace internal |
192 } // namespace v8 | 202 } // namespace v8 |
OLD | NEW |