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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 function->ShortPrint(); | 633 function->ShortPrint(); |
634 if (!osr_ast_id.IsNone()) { | 634 if (!osr_ast_id.IsNone()) { |
635 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); | 635 PrintF(" at OSR AST id %d", osr_ast_id.ToInt()); |
636 } | 636 } |
637 PrintF("]\n"); | 637 PrintF("]\n"); |
638 } | 638 } |
639 return cached_code; | 639 return cached_code; |
640 } | 640 } |
641 | 641 |
642 // Reset profiler ticks, function is no longer considered hot. | 642 // Reset profiler ticks, function is no longer considered hot. |
643 if (shared->is_compiled()) { | 643 if (shared->is_compiled()) { |
Michael Starzinger
2016/11/14 15:36:49
question: I know this code was here before, but wo
rmcilroy
2016/11/14 17:24:26
Hmm, yeah that makes sense. I'll change it here an
| |
644 shared->code()->set_profiler_ticks(0); | 644 shared->code()->set_profiler_ticks(0); |
645 } | 645 } |
646 if (shared->HasBytecodeArray()) { | |
647 shared->set_profiler_ticks(0); | |
648 } | |
646 | 649 |
647 VMState<COMPILER> state(isolate); | 650 VMState<COMPILER> state(isolate); |
648 DCHECK(!isolate->has_pending_exception()); | 651 DCHECK(!isolate->has_pending_exception()); |
649 PostponeInterruptsScope postpone(isolate); | 652 PostponeInterruptsScope postpone(isolate); |
650 bool use_turbofan = UseTurboFan(shared) || ignition_osr; | 653 bool use_turbofan = UseTurboFan(shared) || ignition_osr; |
651 std::unique_ptr<CompilationJob> job( | 654 std::unique_ptr<CompilationJob> job( |
652 use_turbofan ? compiler::Pipeline::NewCompilationJob(function) | 655 use_turbofan ? compiler::Pipeline::NewCompilationJob(function) |
653 : new HCompilationJob(function)); | 656 : new HCompilationJob(function)); |
654 CompilationInfo* info = job->info(); | 657 CompilationInfo* info = job->info(); |
655 ParseInfo* parse_info = info->parse_info(); | 658 ParseInfo* parse_info = info->parse_info(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
727 CompilationInfo* info = job->info(); | 730 CompilationInfo* info = job->info(); |
728 Isolate* isolate = info->isolate(); | 731 Isolate* isolate = info->isolate(); |
729 | 732 |
730 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); | 733 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
731 RuntimeCallTimerScope runtimeTimer(isolate, | 734 RuntimeCallTimerScope runtimeTimer(isolate, |
732 &RuntimeCallStats::RecompileSynchronous); | 735 &RuntimeCallStats::RecompileSynchronous); |
733 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), | 736 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), |
734 "V8.RecompileSynchronous"); | 737 "V8.RecompileSynchronous"); |
735 | 738 |
736 Handle<SharedFunctionInfo> shared = info->shared_info(); | 739 Handle<SharedFunctionInfo> shared = info->shared_info(); |
737 shared->code()->set_profiler_ticks(0); | 740 shared->code()->set_profiler_ticks(0); |
Michael Starzinger
2016/11/14 15:36:49
Likewise.
rmcilroy
2016/11/14 17:24:26
Done.
| |
741 if (shared->HasBytecodeArray()) { | |
742 shared->set_profiler_ticks(0); | |
743 } | |
738 | 744 |
739 DCHECK(!shared->HasDebugInfo()); | 745 DCHECK(!shared->HasDebugInfo()); |
740 | 746 |
741 // 1) Optimization on the concurrent thread may have failed. | 747 // 1) Optimization on the concurrent thread may have failed. |
742 // 2) The function may have already been optimized by OSR. Simply continue. | 748 // 2) The function may have already been optimized by OSR. Simply continue. |
743 // Except when OSR already disabled optimization for some reason. | 749 // Except when OSR already disabled optimization for some reason. |
744 // 3) The code may have already been invalidated due to dependency change. | 750 // 3) The code may have already been invalidated due to dependency change. |
745 // 4) Code generation may have failed. | 751 // 4) Code generation may have failed. |
746 if (job->state() == CompilationJob::State::kReadyToFinalize) { | 752 if (job->state() == CompilationJob::State::kReadyToFinalize) { |
747 if (shared->optimization_disabled()) { | 753 if (shared->optimization_disabled()) { |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1711 DCHECK(shared->is_compiled()); | 1717 DCHECK(shared->is_compiled()); |
1712 function->set_literals(cached.literals); | 1718 function->set_literals(cached.literals); |
1713 } else if (shared->is_compiled()) { | 1719 } else if (shared->is_compiled()) { |
1714 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1720 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1715 JSFunction::EnsureLiterals(function); | 1721 JSFunction::EnsureLiterals(function); |
1716 } | 1722 } |
1717 } | 1723 } |
1718 | 1724 |
1719 } // namespace internal | 1725 } // namespace internal |
1720 } // namespace v8 | 1726 } // namespace v8 |
OLD | NEW |