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-inl.h

Issue 1943303002: Make it possible to set a getter and a setter at the same time (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 7260 matching lines...) Expand 10 before | Expand all | Expand 10 after
7271 if (!setter->IsNull()) set_setter(setter); 7271 if (!setter->IsNull()) set_setter(setter);
7272 } 7272 }
7273 7273
7274 7274
7275 bool AccessorPair::Equals(AccessorPair* pair) { 7275 bool AccessorPair::Equals(AccessorPair* pair) {
7276 return (this == pair) || pair->Equals(getter(), setter()); 7276 return (this == pair) || pair->Equals(getter(), setter());
7277 } 7277 }
7278 7278
7279 7279
7280 bool AccessorPair::Equals(Object* getter_value, Object* setter_value) { 7280 bool AccessorPair::Equals(Object* getter_value, Object* setter_value) {
7281 return (getter() == getter_value) && (setter() == setter_value); 7281 return ((getter()->IsTheHole() && getter_value->IsNull()) ||
7282 (getter() == getter_value)) &&
7283 ((setter()->IsTheHole() && setter_value->IsNull()) ||
7284 (setter() == setter_value));
7282 } 7285 }
7283 7286
7284 7287
7285 bool AccessorPair::ContainsAccessor() { 7288 bool AccessorPair::ContainsAccessor() {
7286 return IsJSAccessor(getter()) || IsJSAccessor(setter()); 7289 return IsJSAccessor(getter()) || IsJSAccessor(setter());
7287 } 7290 }
7288 7291
7289 7292
7290 bool AccessorPair::IsJSAccessor(Object* obj) { 7293 bool AccessorPair::IsJSAccessor(Object* obj) {
7291 return obj->IsCallable() || obj->IsUndefined(); 7294 return obj->IsCallable() || obj->IsUndefined();
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
7851 #undef WRITE_INT64_FIELD 7854 #undef WRITE_INT64_FIELD
7852 #undef READ_BYTE_FIELD 7855 #undef READ_BYTE_FIELD
7853 #undef WRITE_BYTE_FIELD 7856 #undef WRITE_BYTE_FIELD
7854 #undef NOBARRIER_READ_BYTE_FIELD 7857 #undef NOBARRIER_READ_BYTE_FIELD
7855 #undef NOBARRIER_WRITE_BYTE_FIELD 7858 #undef NOBARRIER_WRITE_BYTE_FIELD
7856 7859
7857 } // namespace internal 7860 } // namespace internal
7858 } // namespace v8 7861 } // namespace v8
7859 7862
7860 #endif // V8_OBJECTS_INL_H_ 7863 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/objects.cc ('K') | « src/objects.cc ('k') | test/cctest/test-field-type-tracking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698