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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 4666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4677 | 4677 |
4678 Handle<ObjectHashTable> hashtable(ObjectHashTable::cast(inline_value)); | 4678 Handle<ObjectHashTable> hashtable(ObjectHashTable::cast(inline_value)); |
4679 bool was_present = false; | 4679 bool was_present = false; |
4680 ObjectHashTable::Remove(hashtable, key, &was_present); | 4680 ObjectHashTable::Remove(hashtable, key, &was_present); |
4681 } | 4681 } |
4682 | 4682 |
4683 | 4683 |
4684 bool JSObject::HasHiddenProperties(Handle<JSObject> object) { | 4684 bool JSObject::HasHiddenProperties(Handle<JSObject> object) { |
4685 Handle<Name> hidden = object->GetIsolate()->factory()->hidden_string(); | 4685 Handle<Name> hidden = object->GetIsolate()->factory()->hidden_string(); |
4686 LookupIterator it(object, hidden, LookupIterator::OWN_SKIP_INTERCEPTOR); | 4686 LookupIterator it(object, hidden, LookupIterator::OWN_SKIP_INTERCEPTOR); |
4687 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 4687 Maybe<PropertyAttributes> maybe = GetPropertyAttributes(&it); |
4688 return it.IsFound(); | 4688 // Cannot get an exception since the hidden_string isn't accessible to JS. |
| 4689 DCHECK(maybe.has_value); |
| 4690 return maybe.value != ABSENT; |
4689 } | 4691 } |
4690 | 4692 |
4691 | 4693 |
4692 Object* JSObject::GetHiddenPropertiesHashTable() { | 4694 Object* JSObject::GetHiddenPropertiesHashTable() { |
4693 DCHECK(!IsJSGlobalProxy()); | 4695 DCHECK(!IsJSGlobalProxy()); |
4694 if (HasFastProperties()) { | 4696 if (HasFastProperties()) { |
4695 // If the object has fast properties, check whether the first slot | 4697 // If the object has fast properties, check whether the first slot |
4696 // in the descriptor array matches the hidden string. Since the | 4698 // in the descriptor array matches the hidden string. Since the |
4697 // hidden strings hash code is zero (and no other name has hash | 4699 // hidden strings hash code is zero (and no other name has hash |
4698 // code zero) it will always occupy the first entry if present. | 4700 // code zero) it will always occupy the first entry if present. |
(...skipping 11707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16406 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16408 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16407 static const char* error_messages_[] = { | 16409 static const char* error_messages_[] = { |
16408 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16410 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16409 }; | 16411 }; |
16410 #undef ERROR_MESSAGES_TEXTS | 16412 #undef ERROR_MESSAGES_TEXTS |
16411 return error_messages_[reason]; | 16413 return error_messages_[reason]; |
16412 } | 16414 } |
16413 | 16415 |
16414 | 16416 |
16415 } } // namespace v8::internal | 16417 } } // namespace v8::internal |
OLD | NEW |