| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <iomanip> | 5 #include <iomanip> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 13385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13396 if (result.IsEmpty()) return MaybeHandle<JSObject>(); | 13396 if (result.IsEmpty()) return MaybeHandle<JSObject>(); |
| 13397 DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() || | 13397 DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() || |
| 13398 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements()); | 13398 v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements()); |
| 13399 // Rebox before returning. | 13399 // Rebox before returning. |
| 13400 return handle(*v8::Utils::OpenHandle(*result), isolate); | 13400 return handle(*v8::Utils::OpenHandle(*result), isolate); |
| 13401 } | 13401 } |
| 13402 | 13402 |
| 13403 | 13403 |
| 13404 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object, | 13404 Maybe<bool> JSObject::HasRealNamedProperty(Handle<JSObject> object, |
| 13405 Handle<Name> name) { | 13405 Handle<Name> name) { |
| 13406 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); | 13406 LookupIterator it = LookupIterator::PropertyOrElement( |
| 13407 name->GetIsolate(), object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 13407 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); | 13408 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); |
| 13408 if (!maybe_result.IsJust()) return Nothing<bool>(); | 13409 if (!maybe_result.IsJust()) return Nothing<bool>(); |
| 13409 return Just(it.IsFound()); | 13410 return Just(it.IsFound()); |
| 13410 } | 13411 } |
| 13411 | 13412 |
| 13412 | 13413 |
| 13413 Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object, | 13414 Maybe<bool> JSObject::HasRealElementProperty(Handle<JSObject> object, |
| 13414 uint32_t index) { | 13415 uint32_t index) { |
| 13415 Isolate* isolate = object->GetIsolate(); | 13416 Isolate* isolate = object->GetIsolate(); |
| 13416 LookupIterator it(isolate, object, index, | 13417 LookupIterator it(isolate, object, index, |
| 13417 LookupIterator::OWN_SKIP_INTERCEPTOR); | 13418 LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 13418 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); | 13419 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); |
| 13419 if (!maybe_result.IsJust()) return Nothing<bool>(); | 13420 if (!maybe_result.IsJust()) return Nothing<bool>(); |
| 13420 return Just(it.IsFound()); | 13421 return Just(it.IsFound()); |
| 13421 } | 13422 } |
| 13422 | 13423 |
| 13423 | 13424 |
| 13424 Maybe<bool> JSObject::HasRealNamedCallbackProperty(Handle<JSObject> object, | 13425 Maybe<bool> JSObject::HasRealNamedCallbackProperty(Handle<JSObject> object, |
| 13425 Handle<Name> name) { | 13426 Handle<Name> name) { |
| 13426 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); | 13427 LookupIterator it = LookupIterator::PropertyOrElement( |
| 13428 name->GetIsolate(), object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 13427 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); | 13429 Maybe<PropertyAttributes> maybe_result = GetPropertyAttributes(&it); |
| 13428 return maybe_result.IsJust() ? Just(it.state() == LookupIterator::ACCESSOR) | 13430 return maybe_result.IsJust() ? Just(it.state() == LookupIterator::ACCESSOR) |
| 13429 : Nothing<bool>(); | 13431 : Nothing<bool>(); |
| 13430 } | 13432 } |
| 13431 | 13433 |
| 13432 | 13434 |
| 13433 int JSObject::NumberOfOwnProperties(PropertyAttributes filter) { | 13435 int JSObject::NumberOfOwnProperties(PropertyAttributes filter) { |
| 13434 if (HasFastProperties()) { | 13436 if (HasFastProperties()) { |
| 13435 Map* map = this->map(); | 13437 Map* map = this->map(); |
| 13436 if (filter == NONE) return map->NumberOfOwnDescriptors(); | 13438 if (filter == NONE) return map->NumberOfOwnDescriptors(); |
| (...skipping 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16625 Handle<Object> new_value) { | 16627 Handle<Object> new_value) { |
| 16626 if (cell->value() != *new_value) { | 16628 if (cell->value() != *new_value) { |
| 16627 cell->set_value(*new_value); | 16629 cell->set_value(*new_value); |
| 16628 Isolate* isolate = cell->GetIsolate(); | 16630 Isolate* isolate = cell->GetIsolate(); |
| 16629 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16631 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 16630 isolate, DependentCode::kPropertyCellChangedGroup); | 16632 isolate, DependentCode::kPropertyCellChangedGroup); |
| 16631 } | 16633 } |
| 16632 } | 16634 } |
| 16633 } // namespace internal | 16635 } // namespace internal |
| 16634 } // namespace v8 | 16636 } // namespace v8 |
| OLD | NEW |