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