OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, | 1152 NewTypeError(MessageTemplate::kIncompatibleMethodReceiver, |
1153 name, receiver), | 1153 name, receiver), |
1154 Object); | 1154 Object); |
1155 } | 1155 } |
1156 | 1156 |
1157 v8::AccessorNameGetterCallback call_fun = | 1157 v8::AccessorNameGetterCallback call_fun = |
1158 v8::ToCData<v8::AccessorNameGetterCallback>(info->getter()); | 1158 v8::ToCData<v8::AccessorNameGetterCallback>(info->getter()); |
1159 if (call_fun == nullptr) return isolate->factory()->undefined_value(); | 1159 if (call_fun == nullptr) return isolate->factory()->undefined_value(); |
1160 | 1160 |
1161 LOG(isolate, ApiNamedPropertyAccess("load", *holder, *name)); | 1161 LOG(isolate, ApiNamedPropertyAccess("load", *holder, *name)); |
1162 PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder); | 1162 PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder, |
| 1163 Object::DONT_THROW); |
1163 v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name)); | 1164 v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name)); |
1164 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); | 1165 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); |
1165 if (result.IsEmpty()) { | 1166 if (result.IsEmpty()) { |
1166 return ReadAbsentProperty(isolate, receiver, name, language_mode); | 1167 return ReadAbsentProperty(isolate, receiver, name, language_mode); |
1167 } | 1168 } |
1168 Handle<Object> return_value = v8::Utils::OpenHandle(*result); | 1169 Handle<Object> return_value = v8::Utils::OpenHandle(*result); |
1169 return_value->VerifyApiCallResultType(); | 1170 return_value->VerifyApiCallResultType(); |
1170 // Rebox handle before return. | 1171 // Rebox handle before return. |
1171 return handle(*return_value, isolate); | 1172 return handle(*return_value, isolate); |
1172 } | 1173 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 | 1218 |
1218 v8::AccessorNameSetterCallback call_fun = | 1219 v8::AccessorNameSetterCallback call_fun = |
1219 v8::ToCData<v8::AccessorNameSetterCallback>(info->setter()); | 1220 v8::ToCData<v8::AccessorNameSetterCallback>(info->setter()); |
1220 if (call_fun == nullptr) return Just(true); | 1221 if (call_fun == nullptr) return Just(true); |
1221 // TODO(verwaest): Shouldn't this case be unreachable (at least in the long | 1222 // TODO(verwaest): Shouldn't this case be unreachable (at least in the long |
1222 // run?) Should we have AccessorInfo with missing setter that are | 1223 // run?) Should we have AccessorInfo with missing setter that are |
1223 // "writable"? If they aren't writable, shouldn't we have bailed out already | 1224 // "writable"? If they aren't writable, shouldn't we have bailed out already |
1224 // earlier? | 1225 // earlier? |
1225 | 1226 |
1226 LOG(isolate, ApiNamedPropertyAccess("store", *holder, *name)); | 1227 LOG(isolate, ApiNamedPropertyAccess("store", *holder, *name)); |
1227 PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder); | 1228 PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder, |
| 1229 should_throw); |
1228 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); | 1230 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); |
1229 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); | 1231 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); |
1230 return Just(true); | 1232 return Just(true); |
1231 } | 1233 } |
1232 | 1234 |
1233 // Regular accessor. | 1235 // Regular accessor. |
1234 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); | 1236 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); |
1235 if (setter->IsCallable()) { | 1237 if (setter->IsCallable()) { |
1236 // TODO(rossberg): nicer would be to cast to some JSCallable here... | 1238 // TODO(rossberg): nicer would be to cast to some JSCallable here... |
1237 return SetPropertyWithDefinedSetter( | 1239 return SetPropertyWithDefinedSetter( |
(...skipping 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3989 // static | 3991 // static |
3990 Handle<Map> Map::Update(Handle<Map> map) { | 3992 Handle<Map> Map::Update(Handle<Map> map) { |
3991 if (!map->is_deprecated()) return map; | 3993 if (!map->is_deprecated()) return map; |
3992 return ReconfigureProperty(map, -1, kData, NONE, Representation::None(), | 3994 return ReconfigureProperty(map, -1, kData, NONE, Representation::None(), |
3993 HeapType::None(map->GetIsolate()), | 3995 HeapType::None(map->GetIsolate()), |
3994 ALLOW_IN_DESCRIPTOR); | 3996 ALLOW_IN_DESCRIPTOR); |
3995 } | 3997 } |
3996 | 3998 |
3997 | 3999 |
3998 Maybe<bool> JSObject::SetPropertyWithInterceptor(LookupIterator* it, | 4000 Maybe<bool> JSObject::SetPropertyWithInterceptor(LookupIterator* it, |
| 4001 ShouldThrow should_throw, |
3999 Handle<Object> value) { | 4002 Handle<Object> value) { |
4000 Isolate* isolate = it->isolate(); | 4003 Isolate* isolate = it->isolate(); |
4001 // Make sure that the top context does not change when doing callbacks or | 4004 // Make sure that the top context does not change when doing callbacks or |
4002 // interceptor calls. | 4005 // interceptor calls. |
4003 AssertNoContextChange ncc(isolate); | 4006 AssertNoContextChange ncc(isolate); |
4004 | 4007 |
4005 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); | 4008 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); |
4006 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); | 4009 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); |
4007 if (interceptor->setter()->IsUndefined()) return Just(false); | 4010 if (interceptor->setter()->IsUndefined()) return Just(false); |
4008 | 4011 |
4009 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 4012 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
4010 v8::Local<v8::Value> result; | 4013 v8::Local<v8::Value> result; |
4011 PropertyCallbackArguments args(isolate, interceptor->data(), | 4014 PropertyCallbackArguments args(isolate, interceptor->data(), |
4012 *it->GetReceiver(), *holder); | 4015 *it->GetReceiver(), *holder, should_throw); |
4013 | 4016 |
4014 if (it->IsElement()) { | 4017 if (it->IsElement()) { |
4015 uint32_t index = it->index(); | 4018 uint32_t index = it->index(); |
4016 v8::IndexedPropertySetterCallback setter = | 4019 v8::IndexedPropertySetterCallback setter = |
4017 v8::ToCData<v8::IndexedPropertySetterCallback>(interceptor->setter()); | 4020 v8::ToCData<v8::IndexedPropertySetterCallback>(interceptor->setter()); |
4018 LOG(isolate, | 4021 LOG(isolate, |
4019 ApiIndexedPropertyAccess("interceptor-indexed-set", *holder, index)); | 4022 ApiIndexedPropertyAccess("interceptor-indexed-set", *holder, index)); |
4020 result = args.Call(setter, index, v8::Utils::ToLocal(value)); | 4023 result = args.Call(setter, index, v8::Utils::ToLocal(value)); |
4021 } else { | 4024 } else { |
4022 Handle<Name> name = it->name(); | 4025 Handle<Name> name = it->name(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4083 // might still call into setters up the prototype chain. | 4086 // might still call into setters up the prototype chain. |
4084 return JSObject::SetPropertyWithFailedAccessCheck(it, value, | 4087 return JSObject::SetPropertyWithFailedAccessCheck(it, value, |
4085 should_throw); | 4088 should_throw); |
4086 | 4089 |
4087 case LookupIterator::JSPROXY: | 4090 case LookupIterator::JSPROXY: |
4088 return JSProxy::SetProperty(it->GetHolder<JSProxy>(), it->GetName(), | 4091 return JSProxy::SetProperty(it->GetHolder<JSProxy>(), it->GetName(), |
4089 value, it->GetReceiver(), language_mode); | 4092 value, it->GetReceiver(), language_mode); |
4090 | 4093 |
4091 case LookupIterator::INTERCEPTOR: | 4094 case LookupIterator::INTERCEPTOR: |
4092 if (it->HolderIsReceiverOrHiddenPrototype()) { | 4095 if (it->HolderIsReceiverOrHiddenPrototype()) { |
4093 Maybe<bool> result = JSObject::SetPropertyWithInterceptor(it, value); | 4096 Maybe<bool> result = |
| 4097 JSObject::SetPropertyWithInterceptor(it, should_throw, value); |
4094 if (result.IsNothing() || result.FromJust()) return result; | 4098 if (result.IsNothing() || result.FromJust()) return result; |
4095 } else { | 4099 } else { |
4096 Maybe<PropertyAttributes> maybe_attributes = | 4100 Maybe<PropertyAttributes> maybe_attributes = |
4097 JSObject::GetPropertyAttributesWithInterceptor(it); | 4101 JSObject::GetPropertyAttributesWithInterceptor(it); |
4098 if (!maybe_attributes.IsJust()) return Nothing<bool>(); | 4102 if (!maybe_attributes.IsJust()) return Nothing<bool>(); |
4099 done = maybe_attributes.FromJust() != ABSENT; | 4103 done = maybe_attributes.FromJust() != ABSENT; |
4100 if (done && (maybe_attributes.FromJust() & READ_ONLY) != 0) { | 4104 if (done && (maybe_attributes.FromJust() & READ_ONLY) != 0) { |
4101 return WriteToReadOnlyProperty(it, value, should_throw); | 4105 return WriteToReadOnlyProperty(it, value, should_throw); |
4102 } | 4106 } |
4103 } | 4107 } |
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5243 // If there's an interceptor, try to store the property with the | 5247 // If there's an interceptor, try to store the property with the |
5244 // interceptor. | 5248 // interceptor. |
5245 // In case of success, the attributes will have been reset to the default | 5249 // In case of success, the attributes will have been reset to the default |
5246 // attributes of the interceptor, rather than the incoming attributes. | 5250 // attributes of the interceptor, rather than the incoming attributes. |
5247 // | 5251 // |
5248 // TODO(verwaest): JSProxy afterwards verify the attributes that the | 5252 // TODO(verwaest): JSProxy afterwards verify the attributes that the |
5249 // JSProxy claims it has, and verifies that they are compatible. If not, | 5253 // JSProxy claims it has, and verifies that they are compatible. If not, |
5250 // they throw. Here we should do the same. | 5254 // they throw. Here we should do the same. |
5251 case LookupIterator::INTERCEPTOR: | 5255 case LookupIterator::INTERCEPTOR: |
5252 if (handling == DONT_FORCE_FIELD) { | 5256 if (handling == DONT_FORCE_FIELD) { |
5253 Maybe<bool> result = JSObject::SetPropertyWithInterceptor(it, value); | 5257 Maybe<bool> result = |
| 5258 JSObject::SetPropertyWithInterceptor(it, should_throw, value); |
5254 if (result.IsNothing() || result.FromJust()) return result; | 5259 if (result.IsNothing() || result.FromJust()) return result; |
5255 } | 5260 } |
5256 break; | 5261 break; |
5257 | 5262 |
5258 case LookupIterator::ACCESSOR: { | 5263 case LookupIterator::ACCESSOR: { |
5259 Handle<Object> accessors = it->GetAccessors(); | 5264 Handle<Object> accessors = it->GetAccessors(); |
5260 | 5265 |
5261 // Special handling for AccessorInfo, which behaves like a data | 5266 // Special handling for AccessorInfo, which behaves like a data |
5262 // property. | 5267 // property. |
5263 if (accessors->IsAccessorInfo() && handling == DONT_FORCE_FIELD) { | 5268 if (accessors->IsAccessorInfo() && handling == DONT_FORCE_FIELD) { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5366 AssertNoContextChange ncc(isolate); | 5371 AssertNoContextChange ncc(isolate); |
5367 HandleScope scope(isolate); | 5372 HandleScope scope(isolate); |
5368 | 5373 |
5369 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 5374 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
5370 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); | 5375 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); |
5371 if (!it->IsElement() && it->name()->IsSymbol() && | 5376 if (!it->IsElement() && it->name()->IsSymbol() && |
5372 !interceptor->can_intercept_symbols()) { | 5377 !interceptor->can_intercept_symbols()) { |
5373 return Just(ABSENT); | 5378 return Just(ABSENT); |
5374 } | 5379 } |
5375 PropertyCallbackArguments args(isolate, interceptor->data(), | 5380 PropertyCallbackArguments args(isolate, interceptor->data(), |
5376 *it->GetReceiver(), *holder); | 5381 *it->GetReceiver(), *holder, |
| 5382 Object::DONT_THROW); |
5377 if (!interceptor->query()->IsUndefined()) { | 5383 if (!interceptor->query()->IsUndefined()) { |
5378 v8::Local<v8::Integer> result; | 5384 v8::Local<v8::Integer> result; |
5379 if (it->IsElement()) { | 5385 if (it->IsElement()) { |
5380 uint32_t index = it->index(); | 5386 uint32_t index = it->index(); |
5381 v8::IndexedPropertyQueryCallback query = | 5387 v8::IndexedPropertyQueryCallback query = |
5382 v8::ToCData<v8::IndexedPropertyQueryCallback>(interceptor->query()); | 5388 v8::ToCData<v8::IndexedPropertyQueryCallback>(interceptor->query()); |
5383 LOG(isolate, | 5389 LOG(isolate, |
5384 ApiIndexedPropertyAccess("interceptor-indexed-has", *holder, index)); | 5390 ApiIndexedPropertyAccess("interceptor-indexed-has", *holder, index)); |
5385 result = args.Call(query, index); | 5391 result = args.Call(query, index); |
5386 } else { | 5392 } else { |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6122 Handle<Object> JSObject::SetHiddenPropertiesHashTable(Handle<JSObject> object, | 6128 Handle<Object> JSObject::SetHiddenPropertiesHashTable(Handle<JSObject> object, |
6123 Handle<Object> value) { | 6129 Handle<Object> value) { |
6124 DCHECK(!object->IsJSGlobalProxy()); | 6130 DCHECK(!object->IsJSGlobalProxy()); |
6125 Isolate* isolate = object->GetIsolate(); | 6131 Isolate* isolate = object->GetIsolate(); |
6126 Handle<Name> name = isolate->factory()->hidden_string(); | 6132 Handle<Name> name = isolate->factory()->hidden_string(); |
6127 SetOwnPropertyIgnoreAttributes(object, name, value, DONT_ENUM).Assert(); | 6133 SetOwnPropertyIgnoreAttributes(object, name, value, DONT_ENUM).Assert(); |
6128 return object; | 6134 return object; |
6129 } | 6135 } |
6130 | 6136 |
6131 | 6137 |
6132 Maybe<bool> JSObject::DeletePropertyWithInterceptor(LookupIterator* it) { | 6138 Maybe<bool> JSObject::DeletePropertyWithInterceptor(LookupIterator* it, |
| 6139 ShouldThrow should_throw) { |
6133 Isolate* isolate = it->isolate(); | 6140 Isolate* isolate = it->isolate(); |
6134 // Make sure that the top context does not change when doing callbacks or | 6141 // Make sure that the top context does not change when doing callbacks or |
6135 // interceptor calls. | 6142 // interceptor calls. |
6136 AssertNoContextChange ncc(isolate); | 6143 AssertNoContextChange ncc(isolate); |
6137 | 6144 |
6138 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); | 6145 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); |
6139 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); | 6146 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); |
6140 if (interceptor->deleter()->IsUndefined()) return Nothing<bool>(); | 6147 if (interceptor->deleter()->IsUndefined()) return Nothing<bool>(); |
6141 | 6148 |
6142 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 6149 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
6143 | 6150 |
6144 PropertyCallbackArguments args(isolate, interceptor->data(), | 6151 PropertyCallbackArguments args(isolate, interceptor->data(), |
6145 *it->GetReceiver(), *holder); | 6152 *it->GetReceiver(), *holder, should_throw); |
6146 v8::Local<v8::Boolean> result; | 6153 v8::Local<v8::Boolean> result; |
6147 if (it->IsElement()) { | 6154 if (it->IsElement()) { |
6148 uint32_t index = it->index(); | 6155 uint32_t index = it->index(); |
6149 v8::IndexedPropertyDeleterCallback deleter = | 6156 v8::IndexedPropertyDeleterCallback deleter = |
6150 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter()); | 6157 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter()); |
6151 LOG(isolate, | 6158 LOG(isolate, |
6152 ApiIndexedPropertyAccess("interceptor-indexed-delete", *holder, index)); | 6159 ApiIndexedPropertyAccess("interceptor-indexed-delete", *holder, index)); |
6153 result = args.Call(deleter, index); | 6160 result = args.Call(deleter, index); |
6154 } else if (it->name()->IsSymbol() && !interceptor->can_intercept_symbols()) { | 6161 } else if (it->name()->IsSymbol() && !interceptor->can_intercept_symbols()) { |
6155 return Nothing<bool>(); | 6162 return Nothing<bool>(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6233 case LookupIterator::JSPROXY: | 6240 case LookupIterator::JSPROXY: |
6234 case LookupIterator::NOT_FOUND: | 6241 case LookupIterator::NOT_FOUND: |
6235 case LookupIterator::TRANSITION: | 6242 case LookupIterator::TRANSITION: |
6236 UNREACHABLE(); | 6243 UNREACHABLE(); |
6237 case LookupIterator::ACCESS_CHECK: | 6244 case LookupIterator::ACCESS_CHECK: |
6238 if (it->HasAccess()) break; | 6245 if (it->HasAccess()) break; |
6239 isolate->ReportFailedAccessCheck(it->GetHolder<JSObject>()); | 6246 isolate->ReportFailedAccessCheck(it->GetHolder<JSObject>()); |
6240 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); | 6247 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); |
6241 return Just(false); | 6248 return Just(false); |
6242 case LookupIterator::INTERCEPTOR: { | 6249 case LookupIterator::INTERCEPTOR: { |
6243 Maybe<bool> result = JSObject::DeletePropertyWithInterceptor(it); | 6250 ShouldThrow should_throw = |
| 6251 is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR; |
| 6252 Maybe<bool> result = |
| 6253 JSObject::DeletePropertyWithInterceptor(it, should_throw); |
6244 // An exception was thrown in the interceptor. Propagate. | 6254 // An exception was thrown in the interceptor. Propagate. |
6245 if (isolate->has_pending_exception()) return Nothing<bool>(); | 6255 if (isolate->has_pending_exception()) return Nothing<bool>(); |
6246 // Delete with interceptor succeeded. Return result. | 6256 // Delete with interceptor succeeded. Return result. |
6247 // TODO(neis): In strict mode, we should probably throw if the | 6257 // TODO(neis): In strict mode, we should probably throw if the |
6248 // interceptor returns false. | 6258 // interceptor returns false. |
6249 if (result.IsJust()) return result; | 6259 if (result.IsJust()) return result; |
6250 break; | 6260 break; |
6251 } | 6261 } |
6252 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 6262 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
6253 return Just(true); | 6263 return Just(true); |
(...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8558 if (!object->HasNamedInterceptor()) return Just(true); | 8568 if (!object->HasNamedInterceptor()) return Just(true); |
8559 } | 8569 } |
8560 Handle<InterceptorInfo> interceptor(type == kIndexed | 8570 Handle<InterceptorInfo> interceptor(type == kIndexed |
8561 ? object->GetIndexedInterceptor() | 8571 ? object->GetIndexedInterceptor() |
8562 : object->GetNamedInterceptor(), | 8572 : object->GetNamedInterceptor(), |
8563 isolate); | 8573 isolate); |
8564 if ((filter & ONLY_ALL_CAN_READ) && !interceptor->all_can_read()) { | 8574 if ((filter & ONLY_ALL_CAN_READ) && !interceptor->all_can_read()) { |
8565 return Just(true); | 8575 return Just(true); |
8566 } | 8576 } |
8567 PropertyCallbackArguments args(isolate, interceptor->data(), *receiver, | 8577 PropertyCallbackArguments args(isolate, interceptor->data(), *receiver, |
8568 *object); | 8578 *object, Object::DONT_THROW); |
8569 v8::Local<v8::Object> result; | 8579 v8::Local<v8::Object> result; |
8570 if (!interceptor->enumerator()->IsUndefined()) { | 8580 if (!interceptor->enumerator()->IsUndefined()) { |
8571 Callback enum_fun = v8::ToCData<Callback>(interceptor->enumerator()); | 8581 Callback enum_fun = v8::ToCData<Callback>(interceptor->enumerator()); |
8572 const char* log_tag = type == kIndexed ? "interceptor-indexed-enum" | 8582 const char* log_tag = type == kIndexed ? "interceptor-indexed-enum" |
8573 : "interceptor-named-enum"; | 8583 : "interceptor-named-enum"; |
8574 LOG(isolate, ApiObjectAccess(log_tag, *object)); | 8584 LOG(isolate, ApiObjectAccess(log_tag, *object)); |
8575 result = args.Call(enum_fun); | 8585 result = args.Call(enum_fun); |
8576 } | 8586 } |
8577 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); | 8587 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); |
8578 if (result.IsEmpty()) return Just(true); | 8588 if (result.IsEmpty()) return Just(true); |
(...skipping 7629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16208 | 16218 |
16209 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); | 16219 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); |
16210 Handle<InterceptorInfo> interceptor = it->GetInterceptor(); | 16220 Handle<InterceptorInfo> interceptor = it->GetInterceptor(); |
16211 if (interceptor->getter()->IsUndefined()) { | 16221 if (interceptor->getter()->IsUndefined()) { |
16212 return isolate->factory()->undefined_value(); | 16222 return isolate->factory()->undefined_value(); |
16213 } | 16223 } |
16214 | 16224 |
16215 Handle<JSObject> holder = it->GetHolder<JSObject>(); | 16225 Handle<JSObject> holder = it->GetHolder<JSObject>(); |
16216 v8::Local<v8::Value> result; | 16226 v8::Local<v8::Value> result; |
16217 PropertyCallbackArguments args(isolate, interceptor->data(), | 16227 PropertyCallbackArguments args(isolate, interceptor->data(), |
16218 *it->GetReceiver(), *holder); | 16228 *it->GetReceiver(), *holder, |
| 16229 Object::DONT_THROW); |
16219 | 16230 |
16220 if (it->IsElement()) { | 16231 if (it->IsElement()) { |
16221 uint32_t index = it->index(); | 16232 uint32_t index = it->index(); |
16222 v8::IndexedPropertyGetterCallback getter = | 16233 v8::IndexedPropertyGetterCallback getter = |
16223 v8::ToCData<v8::IndexedPropertyGetterCallback>(interceptor->getter()); | 16234 v8::ToCData<v8::IndexedPropertyGetterCallback>(interceptor->getter()); |
16224 LOG(isolate, | 16235 LOG(isolate, |
16225 ApiIndexedPropertyAccess("interceptor-indexed-get", *holder, index)); | 16236 ApiIndexedPropertyAccess("interceptor-indexed-get", *holder, index)); |
16226 result = args.Call(getter, index); | 16237 result = args.Call(getter, index); |
16227 } else { | 16238 } else { |
16228 Handle<Name> name = it->name(); | 16239 Handle<Name> name = it->name(); |
(...skipping 3495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19724 if (cell->value() != *new_value) { | 19735 if (cell->value() != *new_value) { |
19725 cell->set_value(*new_value); | 19736 cell->set_value(*new_value); |
19726 Isolate* isolate = cell->GetIsolate(); | 19737 Isolate* isolate = cell->GetIsolate(); |
19727 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19738 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19728 isolate, DependentCode::kPropertyCellChangedGroup); | 19739 isolate, DependentCode::kPropertyCellChangedGroup); |
19729 } | 19740 } |
19730 } | 19741 } |
19731 | 19742 |
19732 } // namespace internal | 19743 } // namespace internal |
19733 } // namespace v8 | 19744 } // namespace v8 |
OLD | NEW |