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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 return false; | 1323 return false; |
1324 } | 1324 } |
1325 | 1325 |
1326 | 1326 |
1327 Handle<Context> Isolate::native_context() { | 1327 Handle<Context> Isolate::native_context() { |
1328 GlobalObject* global = thread_local_top()->context_->global_object(); | 1328 GlobalObject* global = thread_local_top()->context_->global_object(); |
1329 return Handle<Context>(global->native_context()); | 1329 return Handle<Context>(global->native_context()); |
1330 } | 1330 } |
1331 | 1331 |
1332 | 1332 |
| 1333 Handle<Context> Isolate::global_context() { |
| 1334 GlobalObject* global = thread_local_top()->context_->global_object(); |
| 1335 return Handle<Context>(global->global_context()); |
| 1336 } |
| 1337 |
| 1338 |
1333 Handle<Context> Isolate::GetCallingNativeContext() { | 1339 Handle<Context> Isolate::GetCallingNativeContext() { |
1334 JavaScriptFrameIterator it; | 1340 JavaScriptFrameIterator it; |
1335 #ifdef ENABLE_DEBUGGER_SUPPORT | 1341 #ifdef ENABLE_DEBUGGER_SUPPORT |
1336 if (debug_->InDebugger()) { | 1342 if (debug_->InDebugger()) { |
1337 while (!it.done()) { | 1343 while (!it.done()) { |
1338 JavaScriptFrame* frame = it.frame(); | 1344 JavaScriptFrame* frame = it.frame(); |
1339 Context* context = Context::cast(frame->context()); | 1345 Context* context = Context::cast(frame->context()); |
1340 if (context->native_context() == *debug_->debug_context()) { | 1346 if (context->native_context() == *debug_->debug_context()) { |
1341 it.Advance(); | 1347 it.Advance(); |
1342 } else { | 1348 } else { |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 | 2039 |
2034 #ifdef DEBUG | 2040 #ifdef DEBUG |
2035 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2041 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2036 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2042 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2037 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2043 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2038 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2044 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2039 #undef ISOLATE_FIELD_OFFSET | 2045 #undef ISOLATE_FIELD_OFFSET |
2040 #endif | 2046 #endif |
2041 | 2047 |
2042 } } // namespace v8::internal | 2048 } } // namespace v8::internal |
OLD | NEW |