OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 | 795 |
796 if (Context::cast(receiver_context)->security_token() == | 796 if (Context::cast(receiver_context)->security_token() == |
797 native_context->security_token()) | 797 native_context->security_token()) |
798 return YES; | 798 return YES; |
799 } | 799 } |
800 | 800 |
801 return UNKNOWN; | 801 return UNKNOWN; |
802 } | 802 } |
803 | 803 |
804 | 804 |
| 805 bool Isolate::IsInternallyUsedPropertyName(Handle<Object> name) { |
| 806 return name.is_identical_to(factory()->hidden_string()) || |
| 807 name.is_identical_to(factory()->prototype_users_symbol()); |
| 808 } |
| 809 |
| 810 |
| 811 bool Isolate::IsInternallyUsedPropertyName(Object* name) { |
| 812 return name == heap()->hidden_string() || |
| 813 name == heap()->prototype_users_symbol(); |
| 814 } |
| 815 |
| 816 |
805 bool Isolate::MayNamedAccess(Handle<JSObject> receiver, | 817 bool Isolate::MayNamedAccess(Handle<JSObject> receiver, |
806 Handle<Object> key, | 818 Handle<Object> key, |
807 v8::AccessType type) { | 819 v8::AccessType type) { |
808 DCHECK(receiver->IsJSGlobalProxy() || receiver->IsAccessCheckNeeded()); | 820 DCHECK(receiver->IsJSGlobalProxy() || receiver->IsAccessCheckNeeded()); |
809 | 821 |
810 // Skip checks for hidden properties access. Note, we do not | 822 // Skip checks for internally used properties. Note, we do not |
811 // require existence of a context in this case. | 823 // require existence of a context in this case. |
812 if (key.is_identical_to(factory()->hidden_string())) return true; | 824 if (IsInternallyUsedPropertyName(key)) return true; |
813 | 825 |
814 // Check for compatibility between the security tokens in the | 826 // Check for compatibility between the security tokens in the |
815 // current lexical context and the accessed object. | 827 // current lexical context and the accessed object. |
816 DCHECK(context()); | 828 DCHECK(context()); |
817 | 829 |
818 MayAccessDecision decision = MayAccessPreCheck(this, receiver, type); | 830 MayAccessDecision decision = MayAccessPreCheck(this, receiver, type); |
819 if (decision != UNKNOWN) return decision == YES; | 831 if (decision != UNKNOWN) return decision == YES; |
820 | 832 |
821 HandleScope scope(this); | 833 HandleScope scope(this); |
822 Handle<Object> data; | 834 Handle<Object> data; |
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 if (prev_ && prev_->Intercept(flag)) return true; | 2563 if (prev_ && prev_->Intercept(flag)) return true; |
2552 // Then check whether this scope intercepts. | 2564 // Then check whether this scope intercepts. |
2553 if ((flag & intercept_mask_)) { | 2565 if ((flag & intercept_mask_)) { |
2554 intercepted_flags_ |= flag; | 2566 intercepted_flags_ |= flag; |
2555 return true; | 2567 return true; |
2556 } | 2568 } |
2557 return false; | 2569 return false; |
2558 } | 2570 } |
2559 | 2571 |
2560 } } // namespace v8::internal | 2572 } } // namespace v8::internal |
OLD | NEW |