OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |