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

Side by Side Diff: src/compiler.cc

Issue 11414086: Add parallel recompilation time to histogram and plot execution pause times. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/counters.cc » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 ASSERT(info->code().is_null()); 845 ASSERT(info->code().is_null());
846 return false; 846 return false;
847 } 847 }
848 848
849 849
850 void Compiler::RecompileParallel(Handle<JSFunction> closure) { 850 void Compiler::RecompileParallel(Handle<JSFunction> closure) {
851 if (closure->IsInRecompileQueue()) return; 851 if (closure->IsInRecompileQueue()) return;
852 ASSERT(closure->IsMarkedForParallelRecompilation()); 852 ASSERT(closure->IsMarkedForParallelRecompilation());
853 853
854 Isolate* isolate = closure->GetIsolate(); 854 Isolate* isolate = closure->GetIsolate();
855 HistogramTimerScope timer(isolate->counters()->compile_parallel());
856
855 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { 857 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) {
856 if (FLAG_trace_parallel_recompilation) { 858 if (FLAG_trace_parallel_recompilation) {
857 PrintF(" ** Compilation queue, will retry opting on next run.\n"); 859 PrintF(" ** Compilation queue, will retry opting on next run.\n");
858 } 860 }
859 return; 861 return;
860 } 862 }
861 863
862 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(closure)); 864 SmartPointer<CompilationInfo> info(new CompilationInfoWithZone(closure));
863 VMState state(isolate, PARALLEL_COMPILER_PROLOGUE); 865 VMState state(isolate, PARALLEL_COMPILER);
864 PostponeInterruptsScope postpone(isolate); 866 PostponeInterruptsScope postpone(isolate);
865 867
866 Handle<SharedFunctionInfo> shared = info->shared_info(); 868 Handle<SharedFunctionInfo> shared = info->shared_info();
867 int compiled_size = shared->end_position() - shared->start_position(); 869 int compiled_size = shared->end_position() - shared->start_position();
868 isolate->counters()->total_compile_size()->Increment(compiled_size); 870 isolate->counters()->total_compile_size()->Increment(compiled_size);
869 info->SetOptimizing(BailoutId::None()); 871 info->SetOptimizing(BailoutId::None());
870 872
871 { 873 {
872 CompilationHandleScope handle_scope(*info); 874 CompilationHandleScope handle_scope(*info);
873 875
(...skipping 27 matching lines...) Expand all
901 } 903 }
902 904
903 if (isolate->has_pending_exception()) { 905 if (isolate->has_pending_exception()) {
904 isolate->clear_pending_exception(); 906 isolate->clear_pending_exception();
905 } 907 }
906 } 908 }
907 909
908 910
909 void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) { 911 void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
910 SmartPointer<CompilationInfo> info(optimizing_compiler->info()); 912 SmartPointer<CompilationInfo> info(optimizing_compiler->info());
913 Isolate* isolate = info->isolate();
914 VMState state(isolate, PARALLEL_COMPILER);
915 HistogramTimerScope timer(isolate->counters()->compile_parallel());
911 // If crankshaft succeeded, install the optimized code else install 916 // If crankshaft succeeded, install the optimized code else install
912 // the unoptimized code. 917 // the unoptimized code.
913 OptimizingCompiler::Status status = optimizing_compiler->last_status(); 918 OptimizingCompiler::Status status = optimizing_compiler->last_status();
914 if (status != OptimizingCompiler::SUCCEEDED) { 919 if (status != OptimizingCompiler::SUCCEEDED) {
915 optimizing_compiler->info()->set_bailout_reason( 920 optimizing_compiler->info()->set_bailout_reason(
916 "failed/bailed out last time"); 921 "failed/bailed out last time");
917 status = optimizing_compiler->AbortOptimization(); 922 status = optimizing_compiler->AbortOptimization();
918 } else { 923 } else {
919 status = optimizing_compiler->GenerateAndInstallCode(); 924 status = optimizing_compiler->GenerateAndInstallCode();
920 ASSERT(status == OptimizingCompiler::SUCCEEDED || 925 ASSERT(status == OptimizingCompiler::SUCCEEDED ||
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } 1066 }
1062 } 1067 }
1063 1068
1064 GDBJIT(AddCode(Handle<String>(shared->DebugName()), 1069 GDBJIT(AddCode(Handle<String>(shared->DebugName()),
1065 Handle<Script>(info->script()), 1070 Handle<Script>(info->script()),
1066 Handle<Code>(info->code()), 1071 Handle<Code>(info->code()),
1067 info)); 1072 info));
1068 } 1073 }
1069 1074
1070 } } // namespace v8::internal 1075 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698