OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 info->shared_info()->set_feedback_metadata(*feedback_metadata); | 306 info->shared_info()->set_feedback_metadata(*feedback_metadata); |
307 } | 307 } |
308 | 308 |
309 // It's very important that recompiles do not alter the structure of the type | 309 // It's very important that recompiles do not alter the structure of the type |
310 // feedback vector. Verify that the structure fits the function literal. | 310 // feedback vector. Verify that the structure fits the function literal. |
311 CHECK(!info->shared_info()->feedback_metadata()->SpecDiffersFrom( | 311 CHECK(!info->shared_info()->feedback_metadata()->SpecDiffersFrom( |
312 info->literal()->feedback_vector_spec())); | 312 info->literal()->feedback_vector_spec())); |
313 } | 313 } |
314 | 314 |
315 bool UseTurboFan(Handle<SharedFunctionInfo> shared) { | 315 bool UseTurboFan(Handle<SharedFunctionInfo> shared) { |
316 bool optimization_disabled = shared->optimization_disabled(); | 316 if (shared->optimization_disabled()) { |
| 317 return false; |
| 318 } |
| 319 |
317 bool must_use_ignition_turbo = shared->must_use_ignition_turbo(); | 320 bool must_use_ignition_turbo = shared->must_use_ignition_turbo(); |
318 | 321 |
319 // Check the enabling conditions for Turbofan. | 322 // Check the enabling conditions for Turbofan. |
320 // 1. "use asm" code. | 323 // 1. "use asm" code. |
321 bool is_turbofanable_asm = | 324 bool is_turbofanable_asm = FLAG_turbo_asm && shared->asm_function(); |
322 FLAG_turbo_asm && shared->asm_function() && !optimization_disabled; | |
323 | 325 |
324 // 2. Fallback for features unsupported by Crankshaft. | 326 // 2. Fallback for features unsupported by Crankshaft. |
325 bool is_unsupported_by_crankshaft_but_turbofanable = | 327 bool is_unsupported_by_crankshaft_but_turbofanable = |
326 must_use_ignition_turbo && strcmp(FLAG_turbo_filter, "~~") == 0 && | 328 must_use_ignition_turbo && strcmp(FLAG_turbo_filter, "~~") == 0; |
327 !optimization_disabled; | |
328 | 329 |
329 // 3. Explicitly enabled by the command-line filter. | 330 // 3. Explicitly enabled by the command-line filter. |
330 bool passes_turbo_filter = shared->PassesFilter(FLAG_turbo_filter); | 331 bool passes_turbo_filter = shared->PassesFilter(FLAG_turbo_filter); |
331 | 332 |
332 return is_turbofanable_asm || is_unsupported_by_crankshaft_but_turbofanable || | 333 return is_turbofanable_asm || is_unsupported_by_crankshaft_but_turbofanable || |
333 passes_turbo_filter; | 334 passes_turbo_filter; |
334 } | 335 } |
335 | 336 |
336 bool ShouldUseIgnition(CompilationInfo* info) { | 337 bool ShouldUseIgnition(CompilationInfo* info) { |
337 DCHECK(info->has_shared_info()); | 338 DCHECK(info->has_shared_info()); |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 DCHECK(shared->is_compiled()); | 1764 DCHECK(shared->is_compiled()); |
1764 function->set_literals(cached.literals); | 1765 function->set_literals(cached.literals); |
1765 } else if (shared->is_compiled()) { | 1766 } else if (shared->is_compiled()) { |
1766 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1767 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1767 JSFunction::EnsureLiterals(function); | 1768 JSFunction::EnsureLiterals(function); |
1768 } | 1769 } |
1769 } | 1770 } |
1770 | 1771 |
1771 } // namespace internal | 1772 } // namespace internal |
1772 } // namespace v8 | 1773 } // namespace v8 |
OLD | NEW |