| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 // Do not use Crankshaft/TurboFan if we need to be able to set break points. | 674 // Do not use Crankshaft/TurboFan if we need to be able to set break points. |
| 675 if (info->shared_info()->HasDebugInfo()) { | 675 if (info->shared_info()->HasDebugInfo()) { |
| 676 info->AbortOptimization(kFunctionBeingDebugged); | 676 info->AbortOptimization(kFunctionBeingDebugged); |
| 677 return MaybeHandle<Code>(); | 677 return MaybeHandle<Code>(); |
| 678 } | 678 } |
| 679 | 679 |
| 680 // Limit the number of times we try to optimize functions. | 680 // Limit the number of times we try to optimize functions. |
| 681 const int kMaxOptCount = | 681 const int kMaxOptCount = |
| 682 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; | 682 FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000; |
| 683 if (info->shared_info()->opt_count() > kMaxOptCount) { | 683 if (info->shared_info()->opt_count() > kMaxOptCount) { |
| 684 info->AbortOptimization(kOptimizedTooManyTimes); | 684 info->AbortOptimization(kDeoptimizedTooManyTimes); |
| 685 return MaybeHandle<Code>(); | 685 return MaybeHandle<Code>(); |
| 686 } | 686 } |
| 687 | 687 |
| 688 TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate); | 688 TimerEventScope<TimerEventOptimizeCode> optimize_code_timer(isolate); |
| 689 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode); | 689 RuntimeCallTimerScope runtimeTimer(isolate, &RuntimeCallStats::OptimizeCode); |
| 690 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode"); | 690 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.OptimizeCode"); |
| 691 | 691 |
| 692 // TurboFan can optimize directly from existing bytecode. | 692 // TurboFan can optimize directly from existing bytecode. |
| 693 if (use_turbofan && ShouldUseIgnition(info)) { | 693 if (use_turbofan && ShouldUseIgnition(info)) { |
| 694 if (info->is_osr() && !ignition_osr) return MaybeHandle<Code>(); | 694 if (info->is_osr() && !ignition_osr) return MaybeHandle<Code>(); |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 DCHECK(shared->is_compiled()); | 1728 DCHECK(shared->is_compiled()); |
| 1729 function->set_literals(cached.literals); | 1729 function->set_literals(cached.literals); |
| 1730 } else if (shared->is_compiled()) { | 1730 } else if (shared->is_compiled()) { |
| 1731 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1731 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1732 JSFunction::EnsureLiterals(function); | 1732 JSFunction::EnsureLiterals(function); |
| 1733 } | 1733 } |
| 1734 } | 1734 } |
| 1735 | 1735 |
| 1736 } // namespace internal | 1736 } // namespace internal |
| 1737 } // namespace v8 | 1737 } // namespace v8 |
| OLD | NEW |