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

Side by Side Diff: src/optimizing-compiler-thread.cc

Issue 27473006: Fix leak in optimizing compiler thread. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/optimizing-compiler-thread.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 // 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 19 matching lines...) Expand all
30 #include "v8.h" 30 #include "v8.h"
31 31
32 #include "full-codegen.h" 32 #include "full-codegen.h"
33 #include "hydrogen.h" 33 #include "hydrogen.h"
34 #include "isolate.h" 34 #include "isolate.h"
35 #include "v8threads.h" 35 #include "v8threads.h"
36 36
37 namespace v8 { 37 namespace v8 {
38 namespace internal { 38 namespace internal {
39 39
40 OptimizingCompilerThread::~OptimizingCompilerThread() {
41 #ifdef DEBUG
42 for (int i = 0; i < osr_buffer_capacity_; i++) {
43 CHECK_EQ(NULL, osr_buffer_[i]);
44 }
45 #endif
46 DeleteArray(osr_buffer_);
47 ASSERT_EQ(0, input_queue_length_);
48 DeleteArray(input_queue_);
49 }
50
40 51
41 void OptimizingCompilerThread::Run() { 52 void OptimizingCompilerThread::Run() {
42 #ifdef DEBUG 53 #ifdef DEBUG
43 { LockGuard<Mutex> lock_guard(&thread_id_mutex_); 54 { LockGuard<Mutex> lock_guard(&thread_id_mutex_);
44 thread_id_ = ThreadId::Current().ToInteger(); 55 thread_id_ = ThreadId::Current().ToInteger();
45 } 56 }
46 #endif 57 #endif
47 Isolate::SetIsolateThreadLocals(isolate_, NULL); 58 Isolate::SetIsolateThreadLocals(isolate_, NULL);
48 DisallowHeapAllocation no_allocation; 59 DisallowHeapAllocation no_allocation;
49 DisallowHandleAllocation no_handles; 60 DisallowHandleAllocation no_handles;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 #ifdef DEBUG 370 #ifdef DEBUG
360 bool OptimizingCompilerThread::IsOptimizerThread() { 371 bool OptimizingCompilerThread::IsOptimizerThread() {
361 if (!FLAG_concurrent_recompilation) return false; 372 if (!FLAG_concurrent_recompilation) return false;
362 LockGuard<Mutex> lock_guard(&thread_id_mutex_); 373 LockGuard<Mutex> lock_guard(&thread_id_mutex_);
363 return ThreadId::Current().ToInteger() == thread_id_; 374 return ThreadId::Current().ToInteger() == thread_id_;
364 } 375 }
365 #endif 376 #endif
366 377
367 378
368 } } // namespace v8::internal 379 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/optimizing-compiler-thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698