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

Unified Diff: src/compiler.cc

Issue 12832002: Parallel recompilation: fewer handle dereferences and tighter checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/execution.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 8f4be0c08cc172c1859ebe89f92d6d1e809eb0f9..47ae439c35301ad04b6bf62a9747498a34ec475a 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -396,7 +396,7 @@ OptimizingCompiler::Status OptimizingCompiler::CreateGraph() {
OptimizingCompiler::Status OptimizingCompiler::OptimizeGraph() {
AssertNoAllocation no_gc;
NoHandleAllocation no_handles(isolate());
- NoHandleDereference no_deref(isolate());
+ HandleDereferenceGuard no_deref(isolate(), HandleDereferenceGuard::DISALLOW);
ASSERT(last_status() == SUCCEEDED);
Timer t(this, &time_taken_to_optimize_);
@@ -943,6 +943,9 @@ void Compiler::RecompileParallel(Handle<JSFunction> closure) {
new(info->zone()) OptimizingCompiler(*info);
OptimizingCompiler::Status status = compiler->CreateGraph();
if (status == OptimizingCompiler::SUCCEEDED) {
+ // Do a scavenge to put off the next scavenge as far as possible.
+ // This may ease the issue that GVN blocks the next scavenge.
+ isolate->heap()->CollectGarbage(NEW_SPACE, "parallel recompile");
closure->MarkInRecompileQueue();
shared->code()->set_profiler_ticks(0);
info.Detach();
@@ -976,6 +979,13 @@ void Compiler::RecompileParallel(Handle<JSFunction> closure) {
void Compiler::InstallOptimizedCode(OptimizingCompiler* optimizing_compiler) {
SmartPointer<CompilationInfo> info(optimizing_compiler->info());
ASSERT(info->closure()->IsMarkedForInstallingRecompiledCode());
+ // While waiting for the optimizer thread, OSR may have already done all
+ // the work and disabled optimization of this function for some reason.
+ if (info->shared_info()->optimization_disabled()) {
+ info->SetCode(Handle<Code>(info->shared_info()->code()));
+ InstallFullCode(*info);
+ return;
+ }
Isolate* isolate = info->isolate();
VMState state(isolate, PARALLEL_COMPILER);
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698