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

Side by Side Diff: src/objects.cc

Issue 8161014: Change implementation of JSObject::HasHiddenProperties to work as before 9510. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3418 if (entry == StringDictionary::kNotFound) { 3418 if (entry == StringDictionary::kNotFound) {
3419 // Key wasn't in dictionary. Deletion is a success. 3419 // Key wasn't in dictionary. Deletion is a success.
3420 return; 3420 return;
3421 } 3421 }
3422 // Key was in the dictionary. Remove it. 3422 // Key was in the dictionary. Remove it.
3423 dictionary->DeleteProperty(entry, JSReceiver::FORCE_DELETION); 3423 dictionary->DeleteProperty(entry, JSReceiver::FORCE_DELETION);
3424 } 3424 }
3425 3425
3426 3426
3427 bool JSObject::HasHiddenProperties() { 3427 bool JSObject::HasHiddenProperties() {
3428 LookupResult lookup; 3428 return GetPropertyAttributePostInterceptor(this,
3429 LocalLookupRealNamedProperty(GetHeap()->hidden_symbol(), &lookup); 3429 GetHeap()->hidden_symbol(),
3430 return lookup.IsFound(); 3430 false) != ABSENT;
3431 } 3431 }
3432 3432
3433 3433
3434 MaybeObject* JSObject::GetHiddenPropertiesDictionary(bool create_if_absent) { 3434 MaybeObject* JSObject::GetHiddenPropertiesDictionary(bool create_if_absent) {
3435 ASSERT(!IsJSGlobalProxy()); 3435 ASSERT(!IsJSGlobalProxy());
3436 if (HasFastProperties()) { 3436 if (HasFastProperties()) {
3437 // If the object has fast properties, check whether the first slot 3437 // If the object has fast properties, check whether the first slot
3438 // in the descriptor array matches the hidden symbol. Since the 3438 // in the descriptor array matches the hidden symbol. Since the
3439 // hidden symbols hash code is zero (and no other string has hash 3439 // hidden symbols hash code is zero (and no other string has hash
3440 // code zero) it will always occupy the first entry if present. 3440 // code zero) it will always occupy the first entry if present.
(...skipping 8739 matching lines...) Expand 10 before | Expand all | Expand 10 after
12180 if (break_point_objects()->IsUndefined()) return 0; 12180 if (break_point_objects()->IsUndefined()) return 0;
12181 // Single break point. 12181 // Single break point.
12182 if (!break_point_objects()->IsFixedArray()) return 1; 12182 if (!break_point_objects()->IsFixedArray()) return 1;
12183 // Multiple break points. 12183 // Multiple break points.
12184 return FixedArray::cast(break_point_objects())->length(); 12184 return FixedArray::cast(break_point_objects())->length();
12185 } 12185 }
12186 #endif 12186 #endif
12187 12187
12188 12188
12189 } } // namespace v8::internal 12189 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698