Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/objects.cc

Issue 1611313003: Revert of Array length reduction should throw in strict mode if it can't delete an element. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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);
1164 v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name)); 1163 v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name));
1165 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); 1164 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
1166 if (result.IsEmpty()) { 1165 if (result.IsEmpty()) {
1167 return ReadAbsentProperty(isolate, receiver, name, language_mode); 1166 return ReadAbsentProperty(isolate, receiver, name, language_mode);
1168 } 1167 }
1169 Handle<Object> return_value = v8::Utils::OpenHandle(*result); 1168 Handle<Object> return_value = v8::Utils::OpenHandle(*result);
1170 return_value->VerifyApiCallResultType(); 1169 return_value->VerifyApiCallResultType();
1171 // Rebox handle before return. 1170 // Rebox handle before return.
1172 return handle(*return_value, isolate); 1171 return handle(*return_value, isolate);
1173 } 1172 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 1217
1219 v8::AccessorNameSetterCallback call_fun = 1218 v8::AccessorNameSetterCallback call_fun =
1220 v8::ToCData<v8::AccessorNameSetterCallback>(info->setter()); 1219 v8::ToCData<v8::AccessorNameSetterCallback>(info->setter());
1221 if (call_fun == nullptr) return Just(true); 1220 if (call_fun == nullptr) return Just(true);
1222 // TODO(verwaest): Shouldn't this case be unreachable (at least in the long 1221 // TODO(verwaest): Shouldn't this case be unreachable (at least in the long
1223 // run?) Should we have AccessorInfo with missing setter that are 1222 // run?) Should we have AccessorInfo with missing setter that are
1224 // "writable"? If they aren't writable, shouldn't we have bailed out already 1223 // "writable"? If they aren't writable, shouldn't we have bailed out already
1225 // earlier? 1224 // earlier?
1226 1225
1227 LOG(isolate, ApiNamedPropertyAccess("store", *holder, *name)); 1226 LOG(isolate, ApiNamedPropertyAccess("store", *holder, *name));
1228 PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder, 1227 PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder);
1229 should_throw);
1230 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); 1228 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value));
1231 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); 1229 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
1232 return Just(true); 1230 return Just(true);
1233 } 1231 }
1234 1232
1235 // Regular accessor. 1233 // Regular accessor.
1236 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); 1234 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate);
1237 if (setter->IsCallable()) { 1235 if (setter->IsCallable()) {
1238 // TODO(rossberg): nicer would be to cast to some JSCallable here... 1236 // TODO(rossberg): nicer would be to cast to some JSCallable here...
1239 return SetPropertyWithDefinedSetter( 1237 return SetPropertyWithDefinedSetter(
(...skipping 2751 matching lines...) Expand 10 before | Expand all | Expand 10 after
3991 // static 3989 // static
3992 Handle<Map> Map::Update(Handle<Map> map) { 3990 Handle<Map> Map::Update(Handle<Map> map) {
3993 if (!map->is_deprecated()) return map; 3991 if (!map->is_deprecated()) return map;
3994 return ReconfigureProperty(map, -1, kData, NONE, Representation::None(), 3992 return ReconfigureProperty(map, -1, kData, NONE, Representation::None(),
3995 HeapType::None(map->GetIsolate()), 3993 HeapType::None(map->GetIsolate()),
3996 ALLOW_IN_DESCRIPTOR); 3994 ALLOW_IN_DESCRIPTOR);
3997 } 3995 }
3998 3996
3999 3997
4000 Maybe<bool> JSObject::SetPropertyWithInterceptor(LookupIterator* it, 3998 Maybe<bool> JSObject::SetPropertyWithInterceptor(LookupIterator* it,
4001 ShouldThrow should_throw,
4002 Handle<Object> value) { 3999 Handle<Object> value) {
4003 Isolate* isolate = it->isolate(); 4000 Isolate* isolate = it->isolate();
4004 // Make sure that the top context does not change when doing callbacks or 4001 // Make sure that the top context does not change when doing callbacks or
4005 // interceptor calls. 4002 // interceptor calls.
4006 AssertNoContextChange ncc(isolate); 4003 AssertNoContextChange ncc(isolate);
4007 4004
4008 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); 4005 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
4009 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); 4006 Handle<InterceptorInfo> interceptor(it->GetInterceptor());
4010 if (interceptor->setter()->IsUndefined()) return Just(false); 4007 if (interceptor->setter()->IsUndefined()) return Just(false);
4011 4008
4012 Handle<JSObject> holder = it->GetHolder<JSObject>(); 4009 Handle<JSObject> holder = it->GetHolder<JSObject>();
4013 v8::Local<v8::Value> result; 4010 v8::Local<v8::Value> result;
4014 PropertyCallbackArguments args(isolate, interceptor->data(), 4011 PropertyCallbackArguments args(isolate, interceptor->data(),
4015 *it->GetReceiver(), *holder, should_throw); 4012 *it->GetReceiver(), *holder);
4016 4013
4017 if (it->IsElement()) { 4014 if (it->IsElement()) {
4018 uint32_t index = it->index(); 4015 uint32_t index = it->index();
4019 v8::IndexedPropertySetterCallback setter = 4016 v8::IndexedPropertySetterCallback setter =
4020 v8::ToCData<v8::IndexedPropertySetterCallback>(interceptor->setter()); 4017 v8::ToCData<v8::IndexedPropertySetterCallback>(interceptor->setter());
4021 LOG(isolate, 4018 LOG(isolate,
4022 ApiIndexedPropertyAccess("interceptor-indexed-set", *holder, index)); 4019 ApiIndexedPropertyAccess("interceptor-indexed-set", *holder, index));
4023 result = args.Call(setter, index, v8::Utils::ToLocal(value)); 4020 result = args.Call(setter, index, v8::Utils::ToLocal(value));
4024 } else { 4021 } else {
4025 Handle<Name> name = it->name(); 4022 Handle<Name> name = it->name();
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
4086 // might still call into setters up the prototype chain. 4083 // might still call into setters up the prototype chain.
4087 return JSObject::SetPropertyWithFailedAccessCheck(it, value, 4084 return JSObject::SetPropertyWithFailedAccessCheck(it, value,
4088 should_throw); 4085 should_throw);
4089 4086
4090 case LookupIterator::JSPROXY: 4087 case LookupIterator::JSPROXY:
4091 return JSProxy::SetProperty(it->GetHolder<JSProxy>(), it->GetName(), 4088 return JSProxy::SetProperty(it->GetHolder<JSProxy>(), it->GetName(),
4092 value, it->GetReceiver(), language_mode); 4089 value, it->GetReceiver(), language_mode);
4093 4090
4094 case LookupIterator::INTERCEPTOR: 4091 case LookupIterator::INTERCEPTOR:
4095 if (it->HolderIsReceiverOrHiddenPrototype()) { 4092 if (it->HolderIsReceiverOrHiddenPrototype()) {
4096 Maybe<bool> result = 4093 Maybe<bool> result = JSObject::SetPropertyWithInterceptor(it, value);
4097 JSObject::SetPropertyWithInterceptor(it, should_throw, value);
4098 if (result.IsNothing() || result.FromJust()) return result; 4094 if (result.IsNothing() || result.FromJust()) return result;
4099 } else { 4095 } else {
4100 Maybe<PropertyAttributes> maybe_attributes = 4096 Maybe<PropertyAttributes> maybe_attributes =
4101 JSObject::GetPropertyAttributesWithInterceptor(it); 4097 JSObject::GetPropertyAttributesWithInterceptor(it);
4102 if (!maybe_attributes.IsJust()) return Nothing<bool>(); 4098 if (!maybe_attributes.IsJust()) return Nothing<bool>();
4103 done = maybe_attributes.FromJust() != ABSENT; 4099 done = maybe_attributes.FromJust() != ABSENT;
4104 if (done && (maybe_attributes.FromJust() & READ_ONLY) != 0) { 4100 if (done && (maybe_attributes.FromJust() & READ_ONLY) != 0) {
4105 return WriteToReadOnlyProperty(it, value, should_throw); 4101 return WriteToReadOnlyProperty(it, value, should_throw);
4106 } 4102 }
4107 } 4103 }
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
5247 // If there's an interceptor, try to store the property with the 5243 // If there's an interceptor, try to store the property with the
5248 // interceptor. 5244 // interceptor.
5249 // In case of success, the attributes will have been reset to the default 5245 // In case of success, the attributes will have been reset to the default
5250 // attributes of the interceptor, rather than the incoming attributes. 5246 // attributes of the interceptor, rather than the incoming attributes.
5251 // 5247 //
5252 // TODO(verwaest): JSProxy afterwards verify the attributes that the 5248 // TODO(verwaest): JSProxy afterwards verify the attributes that the
5253 // JSProxy claims it has, and verifies that they are compatible. If not, 5249 // JSProxy claims it has, and verifies that they are compatible. If not,
5254 // they throw. Here we should do the same. 5250 // they throw. Here we should do the same.
5255 case LookupIterator::INTERCEPTOR: 5251 case LookupIterator::INTERCEPTOR:
5256 if (handling == DONT_FORCE_FIELD) { 5252 if (handling == DONT_FORCE_FIELD) {
5257 Maybe<bool> result = 5253 Maybe<bool> result = JSObject::SetPropertyWithInterceptor(it, value);
5258 JSObject::SetPropertyWithInterceptor(it, should_throw, value);
5259 if (result.IsNothing() || result.FromJust()) return result; 5254 if (result.IsNothing() || result.FromJust()) return result;
5260 } 5255 }
5261 break; 5256 break;
5262 5257
5263 case LookupIterator::ACCESSOR: { 5258 case LookupIterator::ACCESSOR: {
5264 Handle<Object> accessors = it->GetAccessors(); 5259 Handle<Object> accessors = it->GetAccessors();
5265 5260
5266 // Special handling for AccessorInfo, which behaves like a data 5261 // Special handling for AccessorInfo, which behaves like a data
5267 // property. 5262 // property.
5268 if (accessors->IsAccessorInfo() && handling == DONT_FORCE_FIELD) { 5263 if (accessors->IsAccessorInfo() && handling == DONT_FORCE_FIELD) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
5371 AssertNoContextChange ncc(isolate); 5366 AssertNoContextChange ncc(isolate);
5372 HandleScope scope(isolate); 5367 HandleScope scope(isolate);
5373 5368
5374 Handle<JSObject> holder = it->GetHolder<JSObject>(); 5369 Handle<JSObject> holder = it->GetHolder<JSObject>();
5375 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); 5370 Handle<InterceptorInfo> interceptor(it->GetInterceptor());
5376 if (!it->IsElement() && it->name()->IsSymbol() && 5371 if (!it->IsElement() && it->name()->IsSymbol() &&
5377 !interceptor->can_intercept_symbols()) { 5372 !interceptor->can_intercept_symbols()) {
5378 return Just(ABSENT); 5373 return Just(ABSENT);
5379 } 5374 }
5380 PropertyCallbackArguments args(isolate, interceptor->data(), 5375 PropertyCallbackArguments args(isolate, interceptor->data(),
5381 *it->GetReceiver(), *holder, 5376 *it->GetReceiver(), *holder);
5382 Object::DONT_THROW);
5383 if (!interceptor->query()->IsUndefined()) { 5377 if (!interceptor->query()->IsUndefined()) {
5384 v8::Local<v8::Integer> result; 5378 v8::Local<v8::Integer> result;
5385 if (it->IsElement()) { 5379 if (it->IsElement()) {
5386 uint32_t index = it->index(); 5380 uint32_t index = it->index();
5387 v8::IndexedPropertyQueryCallback query = 5381 v8::IndexedPropertyQueryCallback query =
5388 v8::ToCData<v8::IndexedPropertyQueryCallback>(interceptor->query()); 5382 v8::ToCData<v8::IndexedPropertyQueryCallback>(interceptor->query());
5389 LOG(isolate, 5383 LOG(isolate,
5390 ApiIndexedPropertyAccess("interceptor-indexed-has", *holder, index)); 5384 ApiIndexedPropertyAccess("interceptor-indexed-has", *holder, index));
5391 result = args.Call(query, index); 5385 result = args.Call(query, index);
5392 } else { 5386 } else {
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
6128 Handle<Object> JSObject::SetHiddenPropertiesHashTable(Handle<JSObject> object, 6122 Handle<Object> JSObject::SetHiddenPropertiesHashTable(Handle<JSObject> object,
6129 Handle<Object> value) { 6123 Handle<Object> value) {
6130 DCHECK(!object->IsJSGlobalProxy()); 6124 DCHECK(!object->IsJSGlobalProxy());
6131 Isolate* isolate = object->GetIsolate(); 6125 Isolate* isolate = object->GetIsolate();
6132 Handle<Name> name = isolate->factory()->hidden_string(); 6126 Handle<Name> name = isolate->factory()->hidden_string();
6133 SetOwnPropertyIgnoreAttributes(object, name, value, DONT_ENUM).Assert(); 6127 SetOwnPropertyIgnoreAttributes(object, name, value, DONT_ENUM).Assert();
6134 return object; 6128 return object;
6135 } 6129 }
6136 6130
6137 6131
6138 Maybe<bool> JSObject::DeletePropertyWithInterceptor(LookupIterator* it, 6132 Maybe<bool> JSObject::DeletePropertyWithInterceptor(LookupIterator* it) {
6139 ShouldThrow should_throw) {
6140 Isolate* isolate = it->isolate(); 6133 Isolate* isolate = it->isolate();
6141 // Make sure that the top context does not change when doing callbacks or 6134 // Make sure that the top context does not change when doing callbacks or
6142 // interceptor calls. 6135 // interceptor calls.
6143 AssertNoContextChange ncc(isolate); 6136 AssertNoContextChange ncc(isolate);
6144 6137
6145 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); 6138 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
6146 Handle<InterceptorInfo> interceptor(it->GetInterceptor()); 6139 Handle<InterceptorInfo> interceptor(it->GetInterceptor());
6147 if (interceptor->deleter()->IsUndefined()) return Nothing<bool>(); 6140 if (interceptor->deleter()->IsUndefined()) return Nothing<bool>();
6148 6141
6149 Handle<JSObject> holder = it->GetHolder<JSObject>(); 6142 Handle<JSObject> holder = it->GetHolder<JSObject>();
6150 6143
6151 PropertyCallbackArguments args(isolate, interceptor->data(), 6144 PropertyCallbackArguments args(isolate, interceptor->data(),
6152 *it->GetReceiver(), *holder, should_throw); 6145 *it->GetReceiver(), *holder);
6153 v8::Local<v8::Boolean> result; 6146 v8::Local<v8::Boolean> result;
6154 if (it->IsElement()) { 6147 if (it->IsElement()) {
6155 uint32_t index = it->index(); 6148 uint32_t index = it->index();
6156 v8::IndexedPropertyDeleterCallback deleter = 6149 v8::IndexedPropertyDeleterCallback deleter =
6157 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter()); 6150 v8::ToCData<v8::IndexedPropertyDeleterCallback>(interceptor->deleter());
6158 LOG(isolate, 6151 LOG(isolate,
6159 ApiIndexedPropertyAccess("interceptor-indexed-delete", *holder, index)); 6152 ApiIndexedPropertyAccess("interceptor-indexed-delete", *holder, index));
6160 result = args.Call(deleter, index); 6153 result = args.Call(deleter, index);
6161 } else if (it->name()->IsSymbol() && !interceptor->can_intercept_symbols()) { 6154 } else if (it->name()->IsSymbol() && !interceptor->can_intercept_symbols()) {
6162 return Nothing<bool>(); 6155 return Nothing<bool>();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
6240 case LookupIterator::JSPROXY: 6233 case LookupIterator::JSPROXY:
6241 case LookupIterator::NOT_FOUND: 6234 case LookupIterator::NOT_FOUND:
6242 case LookupIterator::TRANSITION: 6235 case LookupIterator::TRANSITION:
6243 UNREACHABLE(); 6236 UNREACHABLE();
6244 case LookupIterator::ACCESS_CHECK: 6237 case LookupIterator::ACCESS_CHECK:
6245 if (it->HasAccess()) break; 6238 if (it->HasAccess()) break;
6246 isolate->ReportFailedAccessCheck(it->GetHolder<JSObject>()); 6239 isolate->ReportFailedAccessCheck(it->GetHolder<JSObject>());
6247 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); 6240 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
6248 return Just(false); 6241 return Just(false);
6249 case LookupIterator::INTERCEPTOR: { 6242 case LookupIterator::INTERCEPTOR: {
6250 ShouldThrow should_throw = 6243 Maybe<bool> result = JSObject::DeletePropertyWithInterceptor(it);
6251 is_sloppy(language_mode) ? DONT_THROW : THROW_ON_ERROR;
6252 Maybe<bool> result =
6253 JSObject::DeletePropertyWithInterceptor(it, should_throw);
6254 // An exception was thrown in the interceptor. Propagate. 6244 // An exception was thrown in the interceptor. Propagate.
6255 if (isolate->has_pending_exception()) return Nothing<bool>(); 6245 if (isolate->has_pending_exception()) return Nothing<bool>();
6256 // Delete with interceptor succeeded. Return result. 6246 // Delete with interceptor succeeded. Return result.
6257 // TODO(neis): In strict mode, we should probably throw if the 6247 // TODO(neis): In strict mode, we should probably throw if the
6258 // interceptor returns false. 6248 // interceptor returns false.
6259 if (result.IsJust()) return result; 6249 if (result.IsJust()) return result;
6260 break; 6250 break;
6261 } 6251 }
6262 case LookupIterator::INTEGER_INDEXED_EXOTIC: 6252 case LookupIterator::INTEGER_INDEXED_EXOTIC:
6263 return Just(true); 6253 return Just(true);
(...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after
8550 if (!object->HasNamedInterceptor()) return Just(true); 8540 if (!object->HasNamedInterceptor()) return Just(true);
8551 } 8541 }
8552 Handle<InterceptorInfo> interceptor(type == kIndexed 8542 Handle<InterceptorInfo> interceptor(type == kIndexed
8553 ? object->GetIndexedInterceptor() 8543 ? object->GetIndexedInterceptor()
8554 : object->GetNamedInterceptor(), 8544 : object->GetNamedInterceptor(),
8555 isolate); 8545 isolate);
8556 if ((filter & ONLY_ALL_CAN_READ) && !interceptor->all_can_read()) { 8546 if ((filter & ONLY_ALL_CAN_READ) && !interceptor->all_can_read()) {
8557 return Just(true); 8547 return Just(true);
8558 } 8548 }
8559 PropertyCallbackArguments args(isolate, interceptor->data(), *receiver, 8549 PropertyCallbackArguments args(isolate, interceptor->data(), *receiver,
8560 *object, Object::DONT_THROW); 8550 *object);
8561 v8::Local<v8::Object> result; 8551 v8::Local<v8::Object> result;
8562 if (!interceptor->enumerator()->IsUndefined()) { 8552 if (!interceptor->enumerator()->IsUndefined()) {
8563 Callback enum_fun = v8::ToCData<Callback>(interceptor->enumerator()); 8553 Callback enum_fun = v8::ToCData<Callback>(interceptor->enumerator());
8564 const char* log_tag = type == kIndexed ? "interceptor-indexed-enum" 8554 const char* log_tag = type == kIndexed ? "interceptor-indexed-enum"
8565 : "interceptor-named-enum"; 8555 : "interceptor-named-enum";
8566 LOG(isolate, ApiObjectAccess(log_tag, *object)); 8556 LOG(isolate, ApiObjectAccess(log_tag, *object));
8567 result = args.Call(enum_fun); 8557 result = args.Call(enum_fun);
8568 } 8558 }
8569 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); 8559 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>());
8570 if (result.IsEmpty()) return Just(true); 8560 if (result.IsEmpty()) return Just(true);
(...skipping 7606 matching lines...) Expand 10 before | Expand all | Expand 10 after
16177 16167
16178 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state()); 16168 DCHECK_EQ(LookupIterator::INTERCEPTOR, it->state());
16179 Handle<InterceptorInfo> interceptor = it->GetInterceptor(); 16169 Handle<InterceptorInfo> interceptor = it->GetInterceptor();
16180 if (interceptor->getter()->IsUndefined()) { 16170 if (interceptor->getter()->IsUndefined()) {
16181 return isolate->factory()->undefined_value(); 16171 return isolate->factory()->undefined_value();
16182 } 16172 }
16183 16173
16184 Handle<JSObject> holder = it->GetHolder<JSObject>(); 16174 Handle<JSObject> holder = it->GetHolder<JSObject>();
16185 v8::Local<v8::Value> result; 16175 v8::Local<v8::Value> result;
16186 PropertyCallbackArguments args(isolate, interceptor->data(), 16176 PropertyCallbackArguments args(isolate, interceptor->data(),
16187 *it->GetReceiver(), *holder, 16177 *it->GetReceiver(), *holder);
16188 Object::DONT_THROW);
16189 16178
16190 if (it->IsElement()) { 16179 if (it->IsElement()) {
16191 uint32_t index = it->index(); 16180 uint32_t index = it->index();
16192 v8::IndexedPropertyGetterCallback getter = 16181 v8::IndexedPropertyGetterCallback getter =
16193 v8::ToCData<v8::IndexedPropertyGetterCallback>(interceptor->getter()); 16182 v8::ToCData<v8::IndexedPropertyGetterCallback>(interceptor->getter());
16194 LOG(isolate, 16183 LOG(isolate,
16195 ApiIndexedPropertyAccess("interceptor-indexed-get", *holder, index)); 16184 ApiIndexedPropertyAccess("interceptor-indexed-get", *holder, index));
16196 result = args.Call(getter, index); 16185 result = args.Call(getter, index);
16197 } else { 16186 } else {
16198 Handle<Name> name = it->name(); 16187 Handle<Name> name = it->name();
(...skipping 3554 matching lines...) Expand 10 before | Expand all | Expand 10 after
19753 if (cell->value() != *new_value) { 19742 if (cell->value() != *new_value) {
19754 cell->set_value(*new_value); 19743 cell->set_value(*new_value);
19755 Isolate* isolate = cell->GetIsolate(); 19744 Isolate* isolate = cell->GetIsolate();
19756 cell->dependent_code()->DeoptimizeDependentCodeGroup( 19745 cell->dependent_code()->DeoptimizeDependentCodeGroup(
19757 isolate, DependentCode::kPropertyCellChangedGroup); 19746 isolate, DependentCode::kPropertyCellChangedGroup);
19758 } 19747 }
19759 } 19748 }
19760 19749
19761 } // namespace internal 19750 } // namespace internal
19762 } // namespace v8 19751 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698