Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: src/compiler.cc

Issue 1082183003: Revert of Reland "Remove support for thread-based recompilation" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/cpu-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698