| 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 }; | 782 }; |
| 783 | 783 |
| 784 | 784 |
| 785 static MayAccessDecision MayAccessPreCheck(Isolate* isolate, | 785 static MayAccessDecision MayAccessPreCheck(Isolate* isolate, |
| 786 JSObject* receiver, | 786 JSObject* receiver, |
| 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)->native_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 = | 797 Context* native_context = |
| 798 isolate->context()->global_object()->native_context(); | 798 isolate->context()->global_object()->native_context(); |
| 799 if (receiver_context == native_context) return YES; | 799 if (receiver_context == native_context) return YES; |
| 800 | 800 |
| 801 if (Context::cast(receiver_context)->security_token() == | 801 if (Context::cast(receiver_context)->security_token() == |
| 802 native_context->security_token()) | 802 native_context->security_token()) |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 | 2033 |
| 2034 #ifdef DEBUG | 2034 #ifdef DEBUG |
| 2035 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2035 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2036 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2036 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2037 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2037 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2038 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2038 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2039 #undef ISOLATE_FIELD_OFFSET | 2039 #undef ISOLATE_FIELD_OFFSET |
| 2040 #endif | 2040 #endif |
| 2041 | 2041 |
| 2042 } } // namespace v8::internal | 2042 } } // namespace v8::internal |
| OLD | NEW |