| 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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 v8::AccessType type) { | 787 v8::AccessType type) { |
| 788 // During bootstrapping, callback functions are not enabled yet. | 788 // During bootstrapping, callback functions are not enabled yet. |
| 789 if (isolate->bootstrapper()->IsActive()) return YES; | 789 if (isolate->bootstrapper()->IsActive()) return YES; |
| 790 | 790 |
| 791 if (receiver->IsJSGlobalProxy()) { | 791 if (receiver->IsJSGlobalProxy()) { |
| 792 Object* receiver_context = JSGlobalProxy::cast(receiver)->context(); | 792 Object* receiver_context = JSGlobalProxy::cast(receiver)->context(); |
| 793 if (!receiver_context->IsContext()) return NO; | 793 if (!receiver_context->IsContext()) return NO; |
| 794 | 794 |
| 795 // Get the native context of current top context. | 795 // Get the native context of current top context. |
| 796 // avoid using Isolate::native_context() because it uses Handle. | 796 // avoid using Isolate::native_context() because it uses Handle. |
| 797 Context* native_context = isolate->context()->global()->native_context(); | 797 Context* native_context = |
| 798 isolate->context()->global_object()->native_context(); |
| 798 if (receiver_context == native_context) return YES; | 799 if (receiver_context == native_context) return YES; |
| 799 | 800 |
| 800 if (Context::cast(receiver_context)->security_token() == | 801 if (Context::cast(receiver_context)->security_token() == |
| 801 native_context->security_token()) | 802 native_context->security_token()) |
| 802 return YES; | 803 return YES; |
| 803 } | 804 } |
| 804 | 805 |
| 805 return UNKNOWN; | 806 return UNKNOWN; |
| 806 } | 807 } |
| 807 | 808 |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1317 MaybeObject* e = scheduled_exception(); | 1318 MaybeObject* e = scheduled_exception(); |
| 1318 if (e->IsFailure() && Failure::cast(e)->IsOutOfMemoryException()) { | 1319 if (e->IsFailure() && Failure::cast(e)->IsOutOfMemoryException()) { |
| 1319 return true; | 1320 return true; |
| 1320 } | 1321 } |
| 1321 } | 1322 } |
| 1322 return false; | 1323 return false; |
| 1323 } | 1324 } |
| 1324 | 1325 |
| 1325 | 1326 |
| 1326 Handle<Context> Isolate::native_context() { | 1327 Handle<Context> Isolate::native_context() { |
| 1327 GlobalObject* global = thread_local_top()->context_->global(); | 1328 GlobalObject* global = thread_local_top()->context_->global_object(); |
| 1328 return Handle<Context>(global->native_context()); | 1329 return Handle<Context>(global->native_context()); |
| 1329 } | 1330 } |
| 1330 | 1331 |
| 1331 | 1332 |
| 1332 Handle<Context> Isolate::GetCallingNativeContext() { | 1333 Handle<Context> Isolate::GetCallingNativeContext() { |
| 1333 JavaScriptFrameIterator it; | 1334 JavaScriptFrameIterator it; |
| 1334 #ifdef ENABLE_DEBUGGER_SUPPORT | 1335 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 1335 if (debug_->InDebugger()) { | 1336 if (debug_->InDebugger()) { |
| 1336 while (!it.done()) { | 1337 while (!it.done()) { |
| 1337 JavaScriptFrame* frame = it.frame(); | 1338 JavaScriptFrame* frame = it.frame(); |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2032 | 2033 |
| 2033 #ifdef DEBUG | 2034 #ifdef DEBUG |
| 2034 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2035 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2035 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2036 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2036 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2037 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2037 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2038 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2038 #undef ISOLATE_FIELD_OFFSET | 2039 #undef ISOLATE_FIELD_OFFSET |
| 2039 #endif | 2040 #endif |
| 2040 | 2041 |
| 2041 } } // namespace v8::internal | 2042 } } // namespace v8::internal |
| OLD | NEW |