| OLD | NEW |
| 1 // Copyright 2006-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2010 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 thread_data_table_ = new Isolate::ThreadDataTable(); | 247 thread_data_table_ = new Isolate::ThreadDataTable(); |
| 248 default_isolate_ = new Isolate(); | 248 default_isolate_ = new Isolate(); |
| 249 } | 249 } |
| 250 // Can't use SetIsolateThreadLocals(default_isolate_, NULL) here | 250 // Can't use SetIsolateThreadLocals(default_isolate_, NULL) here |
| 251 // becase a non-null thread data may be already set. | 251 // becase a non-null thread data may be already set. |
| 252 Thread::SetThreadLocal(isolate_key_, default_isolate_); | 252 Thread::SetThreadLocal(isolate_key_, default_isolate_); |
| 253 CHECK(default_isolate_->PreInit()); | 253 CHECK(default_isolate_->PreInit()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 | 256 |
| 257 Debugger* Isolate::GetDefaultIsolateDebugger() { |
| 258 EnsureDefaultIsolate(); |
| 259 return default_isolate_->debugger(); |
| 260 } |
| 261 |
| 262 |
| 263 StackGuard* Isolate::GetDefaultIsolateStackGuard() { |
| 264 EnsureDefaultIsolate(); |
| 265 return default_isolate_->stack_guard(); |
| 266 } |
| 267 |
| 268 |
| 257 void Isolate::EnterDefaultIsolate() { | 269 void Isolate::EnterDefaultIsolate() { |
| 258 EnsureDefaultIsolate(); | 270 EnsureDefaultIsolate(); |
| 259 ASSERT(default_isolate_ != NULL); | 271 ASSERT(default_isolate_ != NULL); |
| 260 | 272 |
| 261 PerIsolateThreadData* data = CurrentPerIsolateThreadData(); | 273 PerIsolateThreadData* data = CurrentPerIsolateThreadData(); |
| 262 // If not yet in default isolate - enter it. | 274 // If not yet in default isolate - enter it. |
| 263 if (data == NULL || data->isolate() != default_isolate_) { | 275 if (data == NULL || data->isolate() != default_isolate_) { |
| 264 default_isolate_->Enter(); | 276 default_isolate_->Enter(); |
| 265 } | 277 } |
| 266 } | 278 } |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 | 816 |
| 805 #ifdef DEBUG | 817 #ifdef DEBUG |
| 806 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 818 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 807 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 819 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 808 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 820 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 809 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 821 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 810 #undef ISOLATE_FIELD_OFFSET | 822 #undef ISOLATE_FIELD_OFFSET |
| 811 #endif | 823 #endif |
| 812 | 824 |
| 813 } } // namespace v8::internal | 825 } } // namespace v8::internal |
| OLD | NEW |