OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 #define DEF_VISIT(type) \ | 110 #define DEF_VISIT(type) \ |
111 void Visit##type(type* node) override { \ | 111 void Visit##type(type* node) override { \ |
112 HOptimizedGraphBuilder::Visit##type(node); \ | 112 HOptimizedGraphBuilder::Visit##type(node); \ |
113 } | 113 } |
114 DECLARATION_NODE_LIST(DEF_VISIT) | 114 DECLARATION_NODE_LIST(DEF_VISIT) |
115 #undef DEF_VISIT | 115 #undef DEF_VISIT |
116 }; | 116 }; |
117 | 117 |
118 HCompilationJob::Status HCompilationJob::CreateGraphImpl() { | 118 HCompilationJob::Status HCompilationJob::CreateGraphImpl() { |
119 bool dont_crankshaft = info()->shared_info()->dont_crankshaft(); | 119 if (!isolate()->use_crankshaft() || |
| 120 info()->shared_info()->dont_crankshaft()) { |
| 121 // Crankshaft is entirely disabled. |
| 122 return FAILED; |
| 123 } |
120 | 124 |
121 // Optimization requires a version of fullcode with deoptimization support. | 125 // Optimization requires a version of fullcode with deoptimization support. |
122 // Recompile the unoptimized version of the code if the current version | 126 // Recompile the unoptimized version of the code if the current version |
123 // doesn't have deoptimization support already. | 127 // doesn't have deoptimization support already. |
124 // Otherwise, if we are gathering compilation time and space statistics | 128 // Otherwise, if we are gathering compilation time and space statistics |
125 // for hydrogen, gather baseline statistics for a fullcode compilation. | 129 // for hydrogen, gather baseline statistics for a fullcode compilation. |
126 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); | 130 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); |
127 if (should_recompile || FLAG_hydrogen_stats) { | 131 if (should_recompile || FLAG_hydrogen_stats) { |
128 base::ElapsedTimer timer; | 132 base::ElapsedTimer timer; |
129 if (FLAG_hydrogen_stats) { | 133 if (FLAG_hydrogen_stats) { |
130 timer.Start(); | 134 timer.Start(); |
131 } | 135 } |
132 if (!Compiler::EnsureDeoptimizationSupport(info())) { | 136 if (!Compiler::EnsureDeoptimizationSupport(info())) { |
133 return FAILED; | 137 return FAILED; |
134 } | 138 } |
135 if (FLAG_hydrogen_stats) { | 139 if (FLAG_hydrogen_stats) { |
136 isolate()->GetHStatistics()->IncrementFullCodeGen(timer.Elapsed()); | 140 isolate()->GetHStatistics()->IncrementFullCodeGen(timer.Elapsed()); |
137 } | 141 } |
138 } | 142 } |
139 DCHECK(info()->shared_info()->has_deoptimization_support()); | 143 DCHECK(info()->shared_info()->has_deoptimization_support()); |
140 DCHECK(!info()->shared_info()->never_compiled()); | 144 DCHECK(!info()->shared_info()->never_compiled()); |
141 | 145 |
142 if (!isolate()->use_crankshaft() || dont_crankshaft) { | |
143 // Crankshaft is entirely disabled. | |
144 return FAILED; | |
145 } | |
146 | |
147 // Check the whitelist for Crankshaft. | 146 // Check the whitelist for Crankshaft. |
148 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { | 147 if (!info()->shared_info()->PassesFilter(FLAG_hydrogen_filter)) { |
149 return AbortOptimization(kHydrogenFilter); | 148 return AbortOptimization(kHydrogenFilter); |
150 } | 149 } |
151 | 150 |
152 Scope* scope = info()->scope(); | 151 Scope* scope = info()->scope(); |
153 if (LUnallocated::TooManyParameters(scope->num_parameters())) { | 152 if (LUnallocated::TooManyParameters(scope->num_parameters())) { |
154 // Crankshaft would require too many Lithium operands. | 153 // Crankshaft would require too many Lithium operands. |
155 return AbortOptimization(kTooManyParameters); | 154 return AbortOptimization(kTooManyParameters); |
156 } | 155 } |
(...skipping 13264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13421 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13420 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13422 } | 13421 } |
13423 | 13422 |
13424 #ifdef DEBUG | 13423 #ifdef DEBUG |
13425 graph_->Verify(false); // No full verify. | 13424 graph_->Verify(false); // No full verify. |
13426 #endif | 13425 #endif |
13427 } | 13426 } |
13428 | 13427 |
13429 } // namespace internal | 13428 } // namespace internal |
13430 } // namespace v8 | 13429 } // namespace v8 |
OLD | NEW |