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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 Thread::SetThreadLocal(isolate_key_, default_isolate_); | 205 Thread::SetThreadLocal(isolate_key_, default_isolate_); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 struct StaticInitializer { | 209 struct StaticInitializer { |
210 StaticInitializer() { | 210 StaticInitializer() { |
211 Isolate::EnsureDefaultIsolate(); | 211 Isolate::EnsureDefaultIsolate(); |
212 } | 212 } |
213 } static_initializer; | 213 } static_initializer; |
214 | 214 |
215 #ifdef ENABLE_DEBUGGER_SUPPORT | |
216 Debugger* Isolate::GetDefaultIsolateDebugger() { | |
217 EnsureDefaultIsolate(); | |
218 return default_isolate_->debugger(); | |
219 } | |
220 #endif | |
221 | |
222 | |
223 StackGuard* Isolate::GetDefaultIsolateStackGuard() { | |
224 EnsureDefaultIsolate(); | |
225 return default_isolate_->stack_guard(); | |
226 } | |
227 | |
228 | 215 |
229 void Isolate::EnterDefaultIsolate() { | 216 void Isolate::EnterDefaultIsolate() { |
230 EnsureDefaultIsolate(); | 217 EnsureDefaultIsolate(); |
231 ASSERT(default_isolate_ != NULL); | 218 ASSERT(default_isolate_ != NULL); |
232 | 219 |
233 PerIsolateThreadData* data = CurrentPerIsolateThreadData(); | 220 PerIsolateThreadData* data = CurrentPerIsolateThreadData(); |
234 // If not yet in default isolate - enter it. | 221 // If not yet in default isolate - enter it. |
235 if (data == NULL || data->isolate() != default_isolate_) { | 222 if (data == NULL || data->isolate() != default_isolate_) { |
236 default_isolate_->Enter(); | 223 default_isolate_->Enter(); |
237 } | 224 } |
238 } | 225 } |
239 | 226 |
240 | 227 |
241 v8::Isolate* Isolate::GetDefaultIsolateForLocking() { | |
242 EnsureDefaultIsolate(); | |
243 return reinterpret_cast<v8::Isolate*>(default_isolate_); | |
244 } | |
245 | |
246 | |
247 Address Isolate::get_address_from_id(Isolate::AddressId id) { | 228 Address Isolate::get_address_from_id(Isolate::AddressId id) { |
248 return isolate_addresses_[id]; | 229 return isolate_addresses_[id]; |
249 } | 230 } |
250 | 231 |
251 | 232 |
252 char* Isolate::Iterate(ObjectVisitor* v, char* thread_storage) { | 233 char* Isolate::Iterate(ObjectVisitor* v, char* thread_storage) { |
253 ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage); | 234 ThreadLocalTop* thread = reinterpret_cast<ThreadLocalTop*>(thread_storage); |
254 Iterate(v, thread); | 235 Iterate(v, thread); |
255 return thread_storage + sizeof(ThreadLocalTop); | 236 return thread_storage + sizeof(ThreadLocalTop); |
256 } | 237 } |
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); | 2266 Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); |
2286 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); | 2267 JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); |
2287 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); | 2268 JSObject::SetProperty(registry, name, obj, NONE, STRICT).Assert(); |
2288 } | 2269 } |
2289 } | 2270 } |
2290 return Handle<JSObject>::cast(factory()->symbol_registry()); | 2271 return Handle<JSObject>::cast(factory()->symbol_registry()); |
2291 } | 2272 } |
2292 | 2273 |
2293 | 2274 |
2294 } } // namespace v8::internal | 2275 } } // namespace v8::internal |
OLD | NEW |