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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 native_context->security_token()) | 771 native_context->security_token()) |
772 return YES; | 772 return YES; |
773 } | 773 } |
774 | 774 |
775 return UNKNOWN; | 775 return UNKNOWN; |
776 } | 776 } |
777 | 777 |
778 | 778 |
779 bool Isolate::MayNamedAccess(JSObject* receiver, Object* key, | 779 bool Isolate::MayNamedAccess(JSObject* receiver, Object* key, |
780 v8::AccessType type) { | 780 v8::AccessType type) { |
781 ASSERT(receiver->IsJSGlobalProxy() || receiver->IsAccessCheckNeeded()); | 781 ASSERT(receiver->IsAccessCheckNeeded()); |
782 | 782 |
783 // The callers of this method are not expecting a GC. | 783 // The callers of this method are not expecting a GC. |
784 DisallowHeapAllocation no_gc; | 784 DisallowHeapAllocation no_gc; |
785 | 785 |
786 // Skip checks for hidden properties access. Note, we do not | 786 // Skip checks for hidden properties access. Note, we do not |
787 // require existence of a context in this case. | 787 // require existence of a context in this case. |
788 if (key == heap_.hidden_string()) return true; | 788 if (key == heap_.hidden_string()) return true; |
789 | 789 |
790 // Check for compatibility between the security tokens in the | 790 // Check for compatibility between the security tokens in the |
791 // current lexical context and the accessed object. | 791 // current lexical context and the accessed object. |
(...skipping 30 matching lines...) Expand all Loading... |
822 type, | 822 type, |
823 v8::Utils::ToLocal(data)); | 823 v8::Utils::ToLocal(data)); |
824 } | 824 } |
825 return result; | 825 return result; |
826 } | 826 } |
827 | 827 |
828 | 828 |
829 bool Isolate::MayIndexedAccess(JSObject* receiver, | 829 bool Isolate::MayIndexedAccess(JSObject* receiver, |
830 uint32_t index, | 830 uint32_t index, |
831 v8::AccessType type) { | 831 v8::AccessType type) { |
832 ASSERT(receiver->IsJSGlobalProxy() || receiver->IsAccessCheckNeeded()); | 832 ASSERT(receiver->IsAccessCheckNeeded()); |
833 // Check for compatibility between the security tokens in the | 833 // Check for compatibility between the security tokens in the |
834 // current lexical context and the accessed object. | 834 // current lexical context and the accessed object. |
835 ASSERT(context()); | 835 ASSERT(context()); |
836 | 836 |
837 MayAccessDecision decision = MayAccessPreCheck(this, receiver, type); | 837 MayAccessDecision decision = MayAccessPreCheck(this, receiver, type); |
838 if (decision != UNKNOWN) return decision == YES; | 838 if (decision != UNKNOWN) return decision == YES; |
839 | 839 |
840 // Get indexed access check callback | 840 // Get indexed access check callback |
841 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); | 841 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); |
842 if (!constructor->shared()->IsApiFunction()) return false; | 842 if (!constructor->shared()->IsApiFunction()) return false; |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 | 2316 |
2317 #ifdef DEBUG | 2317 #ifdef DEBUG |
2318 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2318 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2319 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2319 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2320 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2320 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2321 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2321 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2322 #undef ISOLATE_FIELD_OFFSET | 2322 #undef ISOLATE_FIELD_OFFSET |
2323 #endif | 2323 #endif |
2324 | 2324 |
2325 } } // namespace v8::internal | 2325 } } // namespace v8::internal |
OLD | NEW |