OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3236 | 3236 |
3237 return AddMissingElementsTransitions(closest_map, kind); | 3237 return AddMissingElementsTransitions(closest_map, kind); |
3238 } | 3238 } |
3239 | 3239 |
3240 | 3240 |
3241 void JSObject::LocalLookupRealNamedProperty(Name* name, LookupResult* result) { | 3241 void JSObject::LocalLookupRealNamedProperty(Name* name, LookupResult* result) { |
3242 if (IsJSGlobalProxy()) { | 3242 if (IsJSGlobalProxy()) { |
3243 Object* proto = GetPrototype(); | 3243 Object* proto = GetPrototype(); |
3244 if (proto->IsNull()) return result->NotFound(); | 3244 if (proto->IsNull()) return result->NotFound(); |
3245 ASSERT(proto->IsJSGlobalObject()); | 3245 ASSERT(proto->IsJSGlobalObject()); |
3246 // A GlobalProxy's prototype should always be a proper JSObject. | |
3247 return JSObject::cast(proto)->LocalLookupRealNamedProperty(name, result); | 3246 return JSObject::cast(proto)->LocalLookupRealNamedProperty(name, result); |
3248 } | 3247 } |
3249 | 3248 |
3250 if (HasFastProperties()) { | 3249 if (HasFastProperties()) { |
3251 map()->LookupDescriptor(this, name, result); | 3250 map()->LookupDescriptor(this, name, result); |
3252 // A property or a map transition was found. We return all of these result | 3251 // A property or a map transition was found. We return all of these result |
3253 // types because LocalLookupRealNamedProperty is used when setting | 3252 // types because LocalLookupRealNamedProperty is used when setting |
3254 // properties where map transitions are handled. | 3253 // properties where map transitions are handled. |
3255 ASSERT(!result->IsFound() || | 3254 ASSERT(!result->IsFound() || |
3256 (result->holder() == this && result->IsFastPropertyType())); | 3255 (result->holder() == this && result->IsFastPropertyType())); |
(...skipping 9572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12829 | 12828 |
12830 bool JSObject::HasRealElementProperty(Isolate* isolate, uint32_t index) { | 12829 bool JSObject::HasRealElementProperty(Isolate* isolate, uint32_t index) { |
12831 // Check access rights if needed. | 12830 // Check access rights if needed. |
12832 if (IsAccessCheckNeeded()) { | 12831 if (IsAccessCheckNeeded()) { |
12833 if (!isolate->MayIndexedAccess(this, index, v8::ACCESS_HAS)) { | 12832 if (!isolate->MayIndexedAccess(this, index, v8::ACCESS_HAS)) { |
12834 isolate->ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 12833 isolate->ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
12835 return false; | 12834 return false; |
12836 } | 12835 } |
12837 } | 12836 } |
12838 | 12837 |
| 12838 if (IsJSGlobalProxy()) { |
| 12839 Object* proto = GetPrototype(); |
| 12840 if (proto->IsNull()) return false; |
| 12841 ASSERT(proto->IsJSGlobalObject()); |
| 12842 return JSObject::cast(proto)->HasRealElementProperty(isolate, index); |
| 12843 } |
| 12844 |
12839 return GetElementAttributeWithoutInterceptor(this, index, false) != ABSENT; | 12845 return GetElementAttributeWithoutInterceptor(this, index, false) != ABSENT; |
12840 } | 12846 } |
12841 | 12847 |
12842 | 12848 |
12843 bool JSObject::HasRealNamedCallbackProperty(Isolate* isolate, Name* key) { | 12849 bool JSObject::HasRealNamedCallbackProperty(Isolate* isolate, Name* key) { |
12844 // Check access rights if needed. | 12850 // Check access rights if needed. |
12845 if (IsAccessCheckNeeded()) { | 12851 if (IsAccessCheckNeeded()) { |
12846 if (!isolate->MayNamedAccess(this, key, v8::ACCESS_HAS)) { | 12852 if (!isolate->MayNamedAccess(this, key, v8::ACCESS_HAS)) { |
12847 isolate->ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 12853 isolate->ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
12848 return false; | 12854 return false; |
(...skipping 3036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15885 | 15891 |
15886 void PropertyCell::AddDependentCode(Handle<Code> code) { | 15892 void PropertyCell::AddDependentCode(Handle<Code> code) { |
15887 Handle<DependentCode> codes = DependentCode::Insert( | 15893 Handle<DependentCode> codes = DependentCode::Insert( |
15888 Handle<DependentCode>(dependent_code()), | 15894 Handle<DependentCode>(dependent_code()), |
15889 DependentCode::kPropertyCellChangedGroup, code); | 15895 DependentCode::kPropertyCellChangedGroup, code); |
15890 if (*codes != dependent_code()) set_dependent_code(*codes); | 15896 if (*codes != dependent_code()) set_dependent_code(*codes); |
15891 } | 15897 } |
15892 | 15898 |
15893 | 15899 |
15894 } } // namespace v8::internal | 15900 } } // namespace v8::internal |
OLD | NEW |