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

Side by Side Diff: src/optimizing-compile-dispatcher.cc

Issue 1930773003: [compiler] Untangle CompilationInfo allocated with new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-compiler-simplify-30
Patch Set: Fix finalization. Created 4 years, 7 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
« src/compiler/pipeline.cc ('K') | « src/crankshaft/hydrogen.h ('k') | no next file » | 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/optimizing-compile-dispatcher.h" 5 #include "src/optimizing-compile-dispatcher.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/full-codegen/full-codegen.h" 8 #include "src/full-codegen/full-codegen.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/tracing/trace-event.h" 10 #include "src/tracing/trace-event.h"
11 #include "src/v8.h" 11 #include "src/v8.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 namespace { 16 namespace {
17 17
18 void DisposeCompilationJob(CompilationJob* job, bool restore_function_code) { 18 void DisposeCompilationJob(CompilationJob* job, bool restore_function_code) {
19 // The recompile job is allocated in the CompilationInfo's zone.
20 CompilationInfo* info = job->info();
21 if (restore_function_code) { 19 if (restore_function_code) {
22 Handle<JSFunction> function = info->closure(); 20 Handle<JSFunction> function = job->info()->closure();
23 function->ReplaceCode(function->shared()->code()); 21 function->ReplaceCode(function->shared()->code());
24 } 22 }
25 delete job; 23 delete job;
26 delete info;
27 } 24 }
28 25
29 } // namespace 26 } // namespace
30 27
31 28
32 class OptimizingCompileDispatcher::CompileTask : public v8::Task { 29 class OptimizingCompileDispatcher::CompileTask : public v8::Task {
33 public: 30 public:
34 explicit CompileTask(Isolate* isolate) : isolate_(isolate) { 31 explicit CompileTask(Isolate* isolate) : isolate_(isolate) {
35 OptimizingCompileDispatcher* dispatcher = 32 OptimizingCompileDispatcher* dispatcher =
36 isolate_->optimizing_compile_dispatcher(); 33 isolate_->optimizing_compile_dispatcher();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 while (blocked_jobs_ > 0) { 213 while (blocked_jobs_ > 0) {
217 V8::GetCurrentPlatform()->CallOnBackgroundThread( 214 V8::GetCurrentPlatform()->CallOnBackgroundThread(
218 new CompileTask(isolate_), v8::Platform::kShortRunningTask); 215 new CompileTask(isolate_), v8::Platform::kShortRunningTask);
219 blocked_jobs_--; 216 blocked_jobs_--;
220 } 217 }
221 } 218 }
222 219
223 220
224 } // namespace internal 221 } // namespace internal
225 } // namespace v8 222 } // namespace v8
OLDNEW
« src/compiler/pipeline.cc ('K') | « src/crankshaft/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698