| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 object->GetProperty(*receiver, result, *key, attributes)); | 821 object->GetProperty(*receiver, result, *key, attributes)); |
| 822 } | 822 } |
| 823 | 823 |
| 824 | 824 |
| 825 MaybeObject* Object::GetProperty(Object* receiver, | 825 MaybeObject* Object::GetProperty(Object* receiver, |
| 826 LookupResult* result, | 826 LookupResult* result, |
| 827 Name* name, | 827 Name* name, |
| 828 PropertyAttributes* attributes) { | 828 PropertyAttributes* attributes) { |
| 829 // Make sure that the top context does not change when doing | 829 // Make sure that the top context does not change when doing |
| 830 // callbacks or interceptor calls. | 830 // callbacks or interceptor calls. |
| 831 AssertNoContextChange ncc; | 831 AssertNoContextChangeWithHandleScope ncc; |
| 832 |
| 832 Isolate* isolate = name->GetIsolate(); | 833 Isolate* isolate = name->GetIsolate(); |
| 833 Heap* heap = isolate->heap(); | 834 Heap* heap = isolate->heap(); |
| 834 | 835 |
| 835 // Traverse the prototype chain from the current object (this) to | 836 // Traverse the prototype chain from the current object (this) to |
| 836 // the holder and check for access rights. This avoids traversing the | 837 // the holder and check for access rights. This avoids traversing the |
| 837 // objects more than once in case of interceptors, because the | 838 // objects more than once in case of interceptors, because the |
| 838 // holder will always be the interceptor holder and the search may | 839 // holder will always be the interceptor holder and the search may |
| 839 // only continue with a current object just after the interceptor | 840 // only continue with a current object just after the interceptor |
| 840 // holder in the prototype chain. | 841 // holder in the prototype chain. |
| 841 // Proxy handlers do not use the proxy's prototype, so we can skip this. | 842 // Proxy handlers do not use the proxy's prototype, so we can skip this. |
| (...skipping 3029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3871 | 3872 |
| 3872 | 3873 |
| 3873 MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, | 3874 MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, |
| 3874 Name* name_raw, | 3875 Name* name_raw, |
| 3875 Object* value_raw, | 3876 Object* value_raw, |
| 3876 PropertyAttributes attributes, | 3877 PropertyAttributes attributes, |
| 3877 StrictModeFlag strict_mode, | 3878 StrictModeFlag strict_mode, |
| 3878 StoreFromKeyed store_mode) { | 3879 StoreFromKeyed store_mode) { |
| 3879 Heap* heap = GetHeap(); | 3880 Heap* heap = GetHeap(); |
| 3880 Isolate* isolate = heap->isolate(); | 3881 Isolate* isolate = heap->isolate(); |
| 3882 |
| 3881 // Make sure that the top context does not change when doing callbacks or | 3883 // Make sure that the top context does not change when doing callbacks or |
| 3882 // interceptor calls. | 3884 // interceptor calls. |
| 3883 AssertNoContextChange ncc; | 3885 AssertNoContextChangeWithHandleScope ncc; |
| 3884 | 3886 |
| 3885 // Optimization for 2-byte strings often used as keys in a decompression | 3887 // Optimization for 2-byte strings often used as keys in a decompression |
| 3886 // dictionary. We internalize these short keys to avoid constantly | 3888 // dictionary. We internalize these short keys to avoid constantly |
| 3887 // reallocating them. | 3889 // reallocating them. |
| 3888 if (name_raw->IsString() && !name_raw->IsInternalizedString() && | 3890 if (name_raw->IsString() && !name_raw->IsInternalizedString() && |
| 3889 String::cast(name_raw)->length() <= 2) { | 3891 String::cast(name_raw)->length() <= 2) { |
| 3890 Object* internalized_version; | 3892 Object* internalized_version; |
| 3891 { MaybeObject* maybe_string_version = | 3893 { MaybeObject* maybe_string_version = |
| 3892 heap->InternalizeString(String::cast(name_raw)); | 3894 heap->InternalizeString(String::cast(name_raw)); |
| 3893 if (maybe_string_version->ToObject(&internalized_version)) { | 3895 if (maybe_string_version->ToObject(&internalized_version)) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4032 | 4034 |
| 4033 MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( | 4035 MaybeObject* JSObject::SetLocalPropertyIgnoreAttributes( |
| 4034 Name* name_raw, | 4036 Name* name_raw, |
| 4035 Object* value_raw, | 4037 Object* value_raw, |
| 4036 PropertyAttributes attributes, | 4038 PropertyAttributes attributes, |
| 4037 ValueType value_type, | 4039 ValueType value_type, |
| 4038 StoreMode mode, | 4040 StoreMode mode, |
| 4039 ExtensibilityCheck extensibility_check) { | 4041 ExtensibilityCheck extensibility_check) { |
| 4040 // Make sure that the top context does not change when doing callbacks or | 4042 // Make sure that the top context does not change when doing callbacks or |
| 4041 // interceptor calls. | 4043 // interceptor calls. |
| 4042 AssertNoContextChange ncc; | 4044 AssertNoContextChangeWithHandleScope ncc; |
| 4043 Isolate* isolate = GetIsolate(); | 4045 Isolate* isolate = GetIsolate(); |
| 4044 LookupResult lookup(isolate); | 4046 LookupResult lookup(isolate); |
| 4045 LocalLookup(name_raw, &lookup, true); | 4047 LocalLookup(name_raw, &lookup, true); |
| 4046 if (!lookup.IsFound()) map()->LookupTransition(this, name_raw, &lookup); | 4048 if (!lookup.IsFound()) map()->LookupTransition(this, name_raw, &lookup); |
| 4047 // Check access rights if needed. | 4049 // Check access rights if needed. |
| 4048 if (IsAccessCheckNeeded()) { | 4050 if (IsAccessCheckNeeded()) { |
| 4049 if (!isolate->MayNamedAccess(this, name_raw, v8::ACCESS_SET)) { | 4051 if (!isolate->MayNamedAccess(this, name_raw, v8::ACCESS_SET)) { |
| 4050 return SetPropertyWithFailedAccessCheck(&lookup, | 4052 return SetPropertyWithFailedAccessCheck(&lookup, |
| 4051 name_raw, | 4053 name_raw, |
| 4052 value_raw, | 4054 value_raw, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4176 | 4178 |
| 4177 | 4179 |
| 4178 PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor( | 4180 PropertyAttributes JSObject::GetPropertyAttributeWithInterceptor( |
| 4179 JSObject* receiver, | 4181 JSObject* receiver, |
| 4180 Name* name, | 4182 Name* name, |
| 4181 bool continue_search) { | 4183 bool continue_search) { |
| 4182 // TODO(rossberg): Support symbols in the API. | 4184 // TODO(rossberg): Support symbols in the API. |
| 4183 if (name->IsSymbol()) return ABSENT; | 4185 if (name->IsSymbol()) return ABSENT; |
| 4184 | 4186 |
| 4185 Isolate* isolate = GetIsolate(); | 4187 Isolate* isolate = GetIsolate(); |
| 4188 HandleScope scope(isolate); |
| 4186 | 4189 |
| 4187 // Make sure that the top context does not change when doing | 4190 // Make sure that the top context does not change when doing |
| 4188 // callbacks or interceptor calls. | 4191 // callbacks or interceptor calls. |
| 4189 AssertNoContextChange ncc; | 4192 AssertNoContextChange ncc; |
| 4190 | 4193 |
| 4191 HandleScope scope(isolate); | |
| 4192 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); | 4194 Handle<InterceptorInfo> interceptor(GetNamedInterceptor()); |
| 4193 Handle<JSObject> receiver_handle(receiver); | 4195 Handle<JSObject> receiver_handle(receiver); |
| 4194 Handle<JSObject> holder_handle(this); | 4196 Handle<JSObject> holder_handle(this); |
| 4195 Handle<String> name_handle(String::cast(name)); | 4197 Handle<String> name_handle(String::cast(name)); |
| 4196 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); | 4198 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); |
| 4197 if (!interceptor->query()->IsUndefined()) { | 4199 if (!interceptor->query()->IsUndefined()) { |
| 4198 v8::NamedPropertyQueryCallback query = | 4200 v8::NamedPropertyQueryCallback query = |
| 4199 v8::ToCData<v8::NamedPropertyQueryCallback>(interceptor->query()); | 4201 v8::ToCData<v8::NamedPropertyQueryCallback>(interceptor->query()); |
| 4200 LOG(isolate, | 4202 LOG(isolate, |
| 4201 ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); | 4203 ApiNamedPropertyAccess("interceptor-named-has", *holder_handle, name)); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 } | 4313 } |
| 4312 | 4314 |
| 4313 return GetElementAttributeWithoutInterceptor( | 4315 return GetElementAttributeWithoutInterceptor( |
| 4314 receiver, index, continue_search); | 4316 receiver, index, continue_search); |
| 4315 } | 4317 } |
| 4316 | 4318 |
| 4317 | 4319 |
| 4318 PropertyAttributes JSObject::GetElementAttributeWithInterceptor( | 4320 PropertyAttributes JSObject::GetElementAttributeWithInterceptor( |
| 4319 JSReceiver* receiver, uint32_t index, bool continue_search) { | 4321 JSReceiver* receiver, uint32_t index, bool continue_search) { |
| 4320 Isolate* isolate = GetIsolate(); | 4322 Isolate* isolate = GetIsolate(); |
| 4323 HandleScope scope(isolate); |
| 4324 |
| 4321 // Make sure that the top context does not change when doing | 4325 // Make sure that the top context does not change when doing |
| 4322 // callbacks or interceptor calls. | 4326 // callbacks or interceptor calls. |
| 4323 AssertNoContextChange ncc; | 4327 AssertNoContextChange ncc; |
| 4324 HandleScope scope(isolate); | 4328 |
| 4325 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 4329 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
| 4326 Handle<JSReceiver> hreceiver(receiver); | 4330 Handle<JSReceiver> hreceiver(receiver); |
| 4327 Handle<JSObject> holder(this); | 4331 Handle<JSObject> holder(this); |
| 4328 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); | 4332 PropertyCallbackArguments args(isolate, interceptor->data(), receiver, this); |
| 4329 if (!interceptor->query()->IsUndefined()) { | 4333 if (!interceptor->query()->IsUndefined()) { |
| 4330 v8::IndexedPropertyQueryCallback query = | 4334 v8::IndexedPropertyQueryCallback query = |
| 4331 v8::ToCData<v8::IndexedPropertyQueryCallback>(interceptor->query()); | 4335 v8::ToCData<v8::IndexedPropertyQueryCallback>(interceptor->query()); |
| 4332 LOG(isolate, | 4336 LOG(isolate, |
| 4333 ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); | 4337 ApiIndexedPropertyAccess("interceptor-indexed-has", this, index)); |
| 4334 v8::Handle<v8::Integer> result = args.Call(query, index); | 4338 v8::Handle<v8::Integer> result = args.Call(query, index); |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5023 Handle<Object> result = | 5027 Handle<Object> result = |
| 5024 DeletePropertyPostInterceptor(object, name, NORMAL_DELETION); | 5028 DeletePropertyPostInterceptor(object, name, NORMAL_DELETION); |
| 5025 RETURN_HANDLE_IF_SCHEDULED_EXCEPTION(isolate, Object); | 5029 RETURN_HANDLE_IF_SCHEDULED_EXCEPTION(isolate, Object); |
| 5026 return result; | 5030 return result; |
| 5027 } | 5031 } |
| 5028 | 5032 |
| 5029 | 5033 |
| 5030 MaybeObject* JSObject::DeleteElementWithInterceptor(uint32_t index) { | 5034 MaybeObject* JSObject::DeleteElementWithInterceptor(uint32_t index) { |
| 5031 Isolate* isolate = GetIsolate(); | 5035 Isolate* isolate = GetIsolate(); |
| 5032 Heap* heap = isolate->heap(); | 5036 Heap* heap = isolate->heap(); |
| 5037 HandleScope scope(isolate); |
| 5038 |
| 5033 // Make sure that the top context does not change when doing | 5039 // Make sure that the top context does not change when doing |
| 5034 // callbacks or interceptor calls. | 5040 // callbacks or interceptor calls. |
| 5035 AssertNoContextChange ncc; | 5041 AssertNoContextChange ncc; |
| 5036 HandleScope scope(isolate); | 5042 |
| 5037 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 5043 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
| 5038 if (interceptor->deleter()->IsUndefined()) return heap->false_value(); | 5044 if (interceptor->deleter()->IsUndefined()) return heap->false_value(); |
| 5039 v8::IndexedPropertyDeleterCallback deleter = | 5045 v8::IndexedPropertyDeleterCallback deleter = |
| 5040 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter()); | 5046 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter()); |
| 5041 Handle<JSObject> this_handle(this); | 5047 Handle<JSObject> this_handle(this); |
| 5042 LOG(isolate, | 5048 LOG(isolate, |
| 5043 ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index)); | 5049 ApiIndexedPropertyAccess("interceptor-indexed-delete", this, index)); |
| 5044 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); | 5050 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); |
| 5045 v8::Handle<v8::Boolean> result = args.Call(deleter, index); | 5051 v8::Handle<v8::Boolean> result = args.Call(deleter, index); |
| 5046 RETURN_IF_SCHEDULED_EXCEPTION(isolate); | 5052 RETURN_IF_SCHEDULED_EXCEPTION(isolate); |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6137 name, | 6143 name, |
| 6138 getter, | 6144 getter, |
| 6139 setter, | 6145 setter, |
| 6140 attributes, | 6146 attributes, |
| 6141 access_control); | 6147 access_control); |
| 6142 return; | 6148 return; |
| 6143 } | 6149 } |
| 6144 | 6150 |
| 6145 // Make sure that the top context does not change when doing callbacks or | 6151 // Make sure that the top context does not change when doing callbacks or |
| 6146 // interceptor calls. | 6152 // interceptor calls. |
| 6147 AssertNoContextChange ncc; | 6153 AssertNoContextChangeWithHandleScope ncc; |
| 6148 | 6154 |
| 6149 // Try to flatten before operating on the string. | 6155 // Try to flatten before operating on the string. |
| 6150 if (name->IsString()) String::cast(*name)->TryFlatten(); | 6156 if (name->IsString()) String::cast(*name)->TryFlatten(); |
| 6151 | 6157 |
| 6152 if (!object->CanSetCallback(*name)) return; | 6158 if (!object->CanSetCallback(*name)) return; |
| 6153 | 6159 |
| 6154 uint32_t index = 0; | 6160 uint32_t index = 0; |
| 6155 bool is_element = name->AsArrayIndex(&index); | 6161 bool is_element = name->AsArrayIndex(&index); |
| 6156 | 6162 |
| 6157 Handle<Object> old_value = isolate->factory()->the_hole_value(); | 6163 Handle<Object> old_value = isolate->factory()->the_hole_value(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6320 | 6326 |
| 6321 if (IsJSGlobalProxy()) { | 6327 if (IsJSGlobalProxy()) { |
| 6322 Object* proto = GetPrototype(); | 6328 Object* proto = GetPrototype(); |
| 6323 if (proto->IsNull()) return this; | 6329 if (proto->IsNull()) return this; |
| 6324 ASSERT(proto->IsJSGlobalObject()); | 6330 ASSERT(proto->IsJSGlobalObject()); |
| 6325 return JSObject::cast(proto)->DefineAccessor(info); | 6331 return JSObject::cast(proto)->DefineAccessor(info); |
| 6326 } | 6332 } |
| 6327 | 6333 |
| 6328 // Make sure that the top context does not change when doing callbacks or | 6334 // Make sure that the top context does not change when doing callbacks or |
| 6329 // interceptor calls. | 6335 // interceptor calls. |
| 6330 AssertNoContextChange ncc; | 6336 AssertNoContextChangeWithHandleScope ncc; |
| 6331 | 6337 |
| 6332 // Try to flatten before operating on the string. | 6338 // Try to flatten before operating on the string. |
| 6333 if (name->IsString()) String::cast(name)->TryFlatten(); | 6339 if (name->IsString()) String::cast(name)->TryFlatten(); |
| 6334 | 6340 |
| 6335 if (!CanSetCallback(name)) return isolate->heap()->undefined_value(); | 6341 if (!CanSetCallback(name)) return isolate->heap()->undefined_value(); |
| 6336 | 6342 |
| 6337 uint32_t index = 0; | 6343 uint32_t index = 0; |
| 6338 bool is_element = name->AsArrayIndex(&index); | 6344 bool is_element = name->AsArrayIndex(&index); |
| 6339 | 6345 |
| 6340 if (is_element) { | 6346 if (is_element) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6388 | 6394 |
| 6389 return this; | 6395 return this; |
| 6390 } | 6396 } |
| 6391 | 6397 |
| 6392 | 6398 |
| 6393 MaybeObject* JSObject::LookupAccessor(Name* name, AccessorComponent component) { | 6399 MaybeObject* JSObject::LookupAccessor(Name* name, AccessorComponent component) { |
| 6394 Heap* heap = GetHeap(); | 6400 Heap* heap = GetHeap(); |
| 6395 | 6401 |
| 6396 // Make sure that the top context does not change when doing callbacks or | 6402 // Make sure that the top context does not change when doing callbacks or |
| 6397 // interceptor calls. | 6403 // interceptor calls. |
| 6398 AssertNoContextChange ncc; | 6404 AssertNoContextChangeWithHandleScope ncc; |
| 6399 | 6405 |
| 6400 // Check access rights if needed. | 6406 // Check access rights if needed. |
| 6401 if (IsAccessCheckNeeded() && | 6407 if (IsAccessCheckNeeded() && |
| 6402 !heap->isolate()->MayNamedAccess(this, name, v8::ACCESS_HAS)) { | 6408 !heap->isolate()->MayNamedAccess(this, name, v8::ACCESS_HAS)) { |
| 6403 heap->isolate()->ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 6409 heap->isolate()->ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
| 6404 RETURN_IF_SCHEDULED_EXCEPTION(heap->isolate()); | 6410 RETURN_IF_SCHEDULED_EXCEPTION(heap->isolate()); |
| 6405 return heap->undefined_value(); | 6411 return heap->undefined_value(); |
| 6406 } | 6412 } |
| 6407 | 6413 |
| 6408 // Make the lookup and include prototypes. | 6414 // Make the lookup and include prototypes. |
| (...skipping 5127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11536 } | 11542 } |
| 11537 | 11543 |
| 11538 | 11544 |
| 11539 MaybeObject* JSObject::SetElementWithInterceptor(uint32_t index, | 11545 MaybeObject* JSObject::SetElementWithInterceptor(uint32_t index, |
| 11540 Object* value, | 11546 Object* value, |
| 11541 PropertyAttributes attributes, | 11547 PropertyAttributes attributes, |
| 11542 StrictModeFlag strict_mode, | 11548 StrictModeFlag strict_mode, |
| 11543 bool check_prototype, | 11549 bool check_prototype, |
| 11544 SetPropertyMode set_mode) { | 11550 SetPropertyMode set_mode) { |
| 11545 Isolate* isolate = GetIsolate(); | 11551 Isolate* isolate = GetIsolate(); |
| 11552 HandleScope scope(isolate); |
| 11553 |
| 11546 // Make sure that the top context does not change when doing | 11554 // Make sure that the top context does not change when doing |
| 11547 // callbacks or interceptor calls. | 11555 // callbacks or interceptor calls. |
| 11548 AssertNoContextChange ncc; | 11556 AssertNoContextChange ncc; |
| 11549 HandleScope scope(isolate); | 11557 |
| 11550 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); | 11558 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor()); |
| 11551 Handle<JSObject> this_handle(this); | 11559 Handle<JSObject> this_handle(this); |
| 11552 Handle<Object> value_handle(value, isolate); | 11560 Handle<Object> value_handle(value, isolate); |
| 11553 if (!interceptor->setter()->IsUndefined()) { | 11561 if (!interceptor->setter()->IsUndefined()) { |
| 11554 v8::IndexedPropertySetterCallback setter = | 11562 v8::IndexedPropertySetterCallback setter = |
| 11555 v8::ToCData<v8::IndexedPropertySetterCallback>(interceptor->setter()); | 11563 v8::ToCData<v8::IndexedPropertySetterCallback>(interceptor->setter()); |
| 11556 LOG(isolate, | 11564 LOG(isolate, |
| 11557 ApiIndexedPropertyAccess("interceptor-indexed-set", this, index)); | 11565 ApiIndexedPropertyAccess("interceptor-indexed-set", this, index)); |
| 11558 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); | 11566 PropertyCallbackArguments args(isolate, interceptor->data(), this, this); |
| 11559 v8::Handle<v8::Value> result = | 11567 v8::Handle<v8::Value> result = |
| (...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12546 } | 12554 } |
| 12547 set_length(len); | 12555 set_length(len); |
| 12548 } | 12556 } |
| 12549 return value; | 12557 return value; |
| 12550 } | 12558 } |
| 12551 | 12559 |
| 12552 | 12560 |
| 12553 MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver, | 12561 MaybeObject* JSObject::GetElementWithInterceptor(Object* receiver, |
| 12554 uint32_t index) { | 12562 uint32_t index) { |
| 12555 Isolate* isolate = GetIsolate(); | 12563 Isolate* isolate = GetIsolate(); |
| 12564 HandleScope scope(isolate); |
| 12565 |
| 12556 // Make sure that the top context does not change when doing | 12566 // Make sure that the top context does not change when doing |
| 12557 // callbacks or interceptor calls. | 12567 // callbacks or interceptor calls. |
| 12558 AssertNoContextChange ncc; | 12568 AssertNoContextChange ncc; |
| 12559 HandleScope scope(isolate); | 12569 |
| 12560 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate); | 12570 Handle<InterceptorInfo> interceptor(GetIndexedInterceptor(), isolate); |
| 12561 Handle<Object> this_handle(receiver, isolate); | 12571 Handle<Object> this_handle(receiver, isolate); |
| 12562 Handle<JSObject> holder_handle(this, isolate); | 12572 Handle<JSObject> holder_handle(this, isolate); |
| 12563 if (!interceptor->getter()->IsUndefined()) { | 12573 if (!interceptor->getter()->IsUndefined()) { |
| 12564 v8::IndexedPropertyGetterCallback getter = | 12574 v8::IndexedPropertyGetterCallback getter = |
| 12565 v8::ToCData<v8::IndexedPropertyGetterCallback>(interceptor->getter()); | 12575 v8::ToCData<v8::IndexedPropertyGetterCallback>(interceptor->getter()); |
| 12566 LOG(isolate, | 12576 LOG(isolate, |
| 12567 ApiIndexedPropertyAccess("interceptor-indexed-get", this, index)); | 12577 ApiIndexedPropertyAccess("interceptor-indexed-get", this, index)); |
| 12568 PropertyCallbackArguments | 12578 PropertyCallbackArguments |
| 12569 args(isolate, interceptor->data(), receiver, this); | 12579 args(isolate, interceptor->data(), receiver, this); |
| (...skipping 3415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15985 #define ERROR_MESSAGES_TEXTS(C, T) T, | 15995 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 15986 static const char* error_messages_[] = { | 15996 static const char* error_messages_[] = { |
| 15987 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 15997 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 15988 }; | 15998 }; |
| 15989 #undef ERROR_MESSAGES_TEXTS | 15999 #undef ERROR_MESSAGES_TEXTS |
| 15990 return error_messages_[reason]; | 16000 return error_messages_[reason]; |
| 15991 } | 16001 } |
| 15992 | 16002 |
| 15993 | 16003 |
| 15994 } } // namespace v8::internal | 16004 } } // namespace v8::internal |
| OLD | NEW |