Chromium Code Reviews| 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 | 8 |
| 9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 728 ParseInfo* parse_info = info->parse_info(); | 728 ParseInfo* parse_info = info->parse_info(); |
| 729 | 729 |
| 730 info->SetOptimizingForOsr(osr_ast_id); | 730 info->SetOptimizingForOsr(osr_ast_id); |
| 731 | 731 |
| 732 // Do not use Crankshaft/TurboFan if we need to be able to set break points. | 732 // Do not use Crankshaft/TurboFan if we need to be able to set break points. |
| 733 if (info->shared_info()->HasDebugInfo()) { | 733 if (info->shared_info()->HasDebugInfo()) { |
| 734 info->AbortOptimization(kFunctionBeingDebugged); | 734 info->AbortOptimization(kFunctionBeingDebugged); |
| 735 return MaybeHandle<Code>(); | 735 return MaybeHandle<Code>(); |
| 736 } | 736 } |
| 737 | 737 |
| 738 // Do not use Crankshaft/TurboFan on a generator function. | 738 // Do not use Crankshaft on a generator function. |
| 739 // TODO(neis): Eventually enable for Turbofan. | 739 if (IsGeneratorFunction(info->shared_info()->kind()) && !use_turbofan) { |
|
neis
2016/05/10 10:03:22
Does this make sense?
rmcilroy
2016/05/10 10:23:21
I think you also need to check for the FLAG_turbo_
Michael Starzinger
2016/05/10 10:37:11
Rather than keeping this bailout here, we could mo
neis
2016/05/10 11:32:06
Done.
| |
| 740 if (IsGeneratorFunction(info->shared_info()->kind())) { | |
| 741 info->AbortOptimization(kGenerator); | 740 info->AbortOptimization(kGenerator); |
| 742 return MaybeHandle<Code>(); | 741 return MaybeHandle<Code>(); |
| 743 } | 742 } |
| 744 | 743 |
| 745 // Limit the number of times we try to optimize functions. | 744 // Limit the number of times we try to optimize functions. |
| 746 const int kMaxOptCount = | 745 const int kMaxOptCount = |
| 747 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 746 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
| 748 if (info->shared_info()->opt_count() > kMaxOptCount) { | 747 if (info->shared_info()->opt_count() > kMaxOptCount) { |
| 749 info->AbortOptimization(kOptimizedTooManyTimes); | 748 info->AbortOptimization(kOptimizedTooManyTimes); |
| 750 return MaybeHandle<Code>(); | 749 return MaybeHandle<Code>(); |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1743 MaybeHandle<Code> code; | 1742 MaybeHandle<Code> code; |
| 1744 if (cached.code != nullptr) code = handle(cached.code); | 1743 if (cached.code != nullptr) code = handle(cached.code); |
| 1745 Handle<Context> native_context(function->context()->native_context()); | 1744 Handle<Context> native_context(function->context()->native_context()); |
| 1746 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1745 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1747 literals, BailoutId::None()); | 1746 literals, BailoutId::None()); |
| 1748 } | 1747 } |
| 1749 } | 1748 } |
| 1750 | 1749 |
| 1751 } // namespace internal | 1750 } // namespace internal |
| 1752 } // namespace v8 | 1751 } // namespace v8 |
| OLD | NEW |