| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // of it being optimized away. | 219 // of it being optimized away. |
| 220 OS::StrNCpy(local_buffer, "PreallocatedMemoryThread shutting down.\n", | 220 OS::StrNCpy(local_buffer, "PreallocatedMemoryThread shutting down.\n", |
| 221 local_buffer.length()); | 221 local_buffer.length()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 | 224 |
| 225 private: | 225 private: |
| 226 PreallocatedMemoryThread() | 226 PreallocatedMemoryThread() |
| 227 : Thread("v8:PreallocMem"), | 227 : Thread("v8:PreallocMem"), |
| 228 keep_running_(true), | 228 keep_running_(true), |
| 229 wait_for_ever_semaphore_(OS::CreateSemaphore(0)), | 229 wait_for_ever_semaphore_(new Semaphore(0)), |
| 230 data_ready_semaphore_(OS::CreateSemaphore(0)), | 230 data_ready_semaphore_(new Semaphore(0)), |
| 231 data_(NULL), | 231 data_(NULL), |
| 232 length_(0) { | 232 length_(0) { |
| 233 } | 233 } |
| 234 | 234 |
| 235 // Used to make sure that the thread keeps looping even for spurious wakeups. | 235 // Used to make sure that the thread keeps looping even for spurious wakeups. |
| 236 bool keep_running_; | 236 bool keep_running_; |
| 237 | 237 |
| 238 // This semaphore is used by the PreallocatedMemoryThread to wait for ever. | 238 // This semaphore is used by the PreallocatedMemoryThread to wait for ever. |
| 239 Semaphore* wait_for_ever_semaphore_; | 239 Semaphore* wait_for_ever_semaphore_; |
| 240 // Semaphore to signal that the data has been initialized. | 240 // Semaphore to signal that the data has been initialized. |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2527 | 2527 |
| 2528 #ifdef DEBUG | 2528 #ifdef DEBUG |
| 2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2533 #undef ISOLATE_FIELD_OFFSET | 2533 #undef ISOLATE_FIELD_OFFSET |
| 2534 #endif | 2534 #endif |
| 2535 | 2535 |
| 2536 } } // namespace v8::internal | 2536 } } // namespace v8::internal |
| OLD | NEW |