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-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 DCHECK(!info->isolate()->has_pending_exception()); | 813 DCHECK(!info->isolate()->has_pending_exception()); |
814 InsertCodeIntoOptimizedCodeMap(info); | 814 InsertCodeIntoOptimizedCodeMap(info); |
815 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, | 815 RecordFunctionCompilation(Logger::LAZY_COMPILE_TAG, info, |
816 info->shared_info()); | 816 info->shared_info()); |
817 return true; | 817 return true; |
818 } | 818 } |
819 | 819 |
820 | 820 |
821 static bool GetOptimizedCodeLater(CompilationInfo* info) { | 821 static bool GetOptimizedCodeLater(CompilationInfo* info) { |
822 Isolate* isolate = info->isolate(); | 822 Isolate* isolate = info->isolate(); |
823 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { | 823 if (!isolate->optimizing_compile_dispatcher()->IsQueueAvailable()) { |
824 if (FLAG_trace_concurrent_recompilation) { | 824 if (FLAG_trace_concurrent_recompilation) { |
825 PrintF(" ** Compilation queue full, will retry optimizing "); | 825 PrintF(" ** Compilation queue full, will retry optimizing "); |
826 info->closure()->ShortPrint(); | 826 info->closure()->ShortPrint(); |
827 PrintF(" later.\n"); | 827 PrintF(" later.\n"); |
828 } | 828 } |
829 return false; | 829 return false; |
830 } | 830 } |
831 | 831 |
832 CompilationHandleScope handle_scope(info); | 832 CompilationHandleScope handle_scope(info); |
833 if (!Compiler::ParseAndAnalyze(info->parse_info())) return false; | 833 if (!Compiler::ParseAndAnalyze(info->parse_info())) return false; |
834 | 834 |
835 // Reopen handles in the new CompilationHandleScope. | 835 // Reopen handles in the new CompilationHandleScope. |
836 info->ReopenHandlesInNewHandleScope(); | 836 info->ReopenHandlesInNewHandleScope(); |
837 info->parse_info()->ReopenHandlesInNewHandleScope(); | 837 info->parse_info()->ReopenHandlesInNewHandleScope(); |
838 | 838 |
839 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); | 839 TimerEventScope<TimerEventRecompileSynchronous> timer(info->isolate()); |
840 | 840 |
841 OptimizedCompileJob* job = new (info->zone()) OptimizedCompileJob(info); | 841 OptimizedCompileJob* job = new (info->zone()) OptimizedCompileJob(info); |
842 OptimizedCompileJob::Status status = job->CreateGraph(); | 842 OptimizedCompileJob::Status status = job->CreateGraph(); |
843 if (status != OptimizedCompileJob::SUCCEEDED) return false; | 843 if (status != OptimizedCompileJob::SUCCEEDED) return false; |
844 isolate->optimizing_compiler_thread()->QueueForOptimization(job); | 844 isolate->optimizing_compile_dispatcher()->QueueForOptimization(job); |
845 | 845 |
846 if (FLAG_trace_concurrent_recompilation) { | 846 if (FLAG_trace_concurrent_recompilation) { |
847 PrintF(" ** Queued "); | 847 PrintF(" ** Queued "); |
848 info->closure()->ShortPrint(); | 848 info->closure()->ShortPrint(); |
849 if (info->is_osr()) { | 849 if (info->is_osr()) { |
850 PrintF(" for concurrent OSR at %d.\n", info->osr_ast_id().ToInt()); | 850 PrintF(" for concurrent OSR at %d.\n", info->osr_ast_id().ToInt()); |
851 } else { | 851 } else { |
852 PrintF(" for concurrent optimization.\n"); | 852 PrintF(" for concurrent optimization.\n"); |
853 } | 853 } |
854 } | 854 } |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 } | 1591 } |
1592 | 1592 |
1593 | 1593 |
1594 #if DEBUG | 1594 #if DEBUG |
1595 void CompilationInfo::PrintAstForTesting() { | 1595 void CompilationInfo::PrintAstForTesting() { |
1596 PrintF("--- Source from AST ---\n%s\n", | 1596 PrintF("--- Source from AST ---\n%s\n", |
1597 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1597 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1598 } | 1598 } |
1599 #endif | 1599 #endif |
1600 } } // namespace v8::internal | 1600 } } // namespace v8::internal |
OLD | NEW |