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/counters.h" | 8 #include "src/counters.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 10 matching lines...) Expand all Loading... |
21 #endif // DEBUG | 21 #endif // DEBUG |
22 | 22 |
23 EscapeAnalysisReducer::EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph, | 23 EscapeAnalysisReducer::EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph, |
24 EscapeAnalysis* escape_analysis, | 24 EscapeAnalysis* escape_analysis, |
25 Zone* zone) | 25 Zone* zone) |
26 : AdvancedReducer(editor), | 26 : AdvancedReducer(editor), |
27 jsgraph_(jsgraph), | 27 jsgraph_(jsgraph), |
28 escape_analysis_(escape_analysis), | 28 escape_analysis_(escape_analysis), |
29 zone_(zone), | 29 zone_(zone), |
30 fully_reduced_(static_cast<int>(jsgraph->graph()->NodeCount() * 2), zone), | 30 fully_reduced_(static_cast<int>(jsgraph->graph()->NodeCount() * 2), zone), |
31 exists_virtual_allocate_(true) {} | 31 exists_virtual_allocate_(escape_analysis->ExistsVirtualAllocate()) {} |
32 | |
33 | 32 |
34 Reduction EscapeAnalysisReducer::Reduce(Node* node) { | 33 Reduction EscapeAnalysisReducer::Reduce(Node* node) { |
35 if (node->id() < static_cast<NodeId>(fully_reduced_.length()) && | 34 if (node->id() < static_cast<NodeId>(fully_reduced_.length()) && |
36 fully_reduced_.Contains(node->id())) { | 35 fully_reduced_.Contains(node->id())) { |
37 return NoChange(); | 36 return NoChange(); |
38 } | 37 } |
39 | 38 |
40 switch (node->opcode()) { | 39 switch (node->opcode()) { |
41 case IrOpcode::kLoadField: | 40 case IrOpcode::kLoadField: |
42 case IrOpcode::kLoadElement: | 41 case IrOpcode::kLoadElement: |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 GraphReducer graph_reducer(zone(), jsgraph()->graph()); | 357 GraphReducer graph_reducer(zone(), jsgraph()->graph()); |
359 EscapeAnalysisVerifier verifier(&graph_reducer, escape_analysis()); | 358 EscapeAnalysisVerifier verifier(&graph_reducer, escape_analysis()); |
360 graph_reducer.AddReducer(&verifier); | 359 graph_reducer.AddReducer(&verifier); |
361 graph_reducer.ReduceGraph(); | 360 graph_reducer.ReduceGraph(); |
362 #endif // DEBUG | 361 #endif // DEBUG |
363 } | 362 } |
364 | 363 |
365 } // namespace compiler | 364 } // namespace compiler |
366 } // namespace internal | 365 } // namespace internal |
367 } // namespace v8 | 366 } // namespace v8 |
OLD | NEW |