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

Side by Side Diff: src/objects.h

Issue 29353003: [Object.observe] Don't force normalization of elements for observed objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cr comments Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5654 matching lines...) Expand 10 before | Expand all | Expand 10 after
5665 // Bit field 3. 5665 // Bit field 3.
5666 inline uint32_t bit_field3(); 5666 inline uint32_t bit_field3();
5667 inline void set_bit_field3(uint32_t bits); 5667 inline void set_bit_field3(uint32_t bits);
5668 5668
5669 class EnumLengthBits: public BitField<int, 0, 11> {}; 5669 class EnumLengthBits: public BitField<int, 0, 11> {};
5670 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; 5670 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {};
5671 class IsShared: public BitField<bool, 22, 1> {}; 5671 class IsShared: public BitField<bool, 22, 1> {};
5672 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; 5672 class FunctionWithPrototype: public BitField<bool, 23, 1> {};
5673 class DictionaryMap: public BitField<bool, 24, 1> {}; 5673 class DictionaryMap: public BitField<bool, 24, 1> {};
5674 class OwnsDescriptors: public BitField<bool, 25, 1> {}; 5674 class OwnsDescriptors: public BitField<bool, 25, 1> {};
5675 class IsObserved: public BitField<bool, 26, 1> {}; 5675 class HasInstanceCallHandler: public BitField<bool, 26, 1> {};
5676 class Deprecated: public BitField<bool, 27, 1> {}; 5676 class Deprecated: public BitField<bool, 27, 1> {};
5677 class IsFrozen: public BitField<bool, 28, 1> {}; 5677 class IsFrozen: public BitField<bool, 28, 1> {};
5678 class IsUnstable: public BitField<bool, 29, 1> {}; 5678 class IsUnstable: public BitField<bool, 29, 1> {};
5679 class IsMigrationTarget: public BitField<bool, 30, 1> {}; 5679 class IsMigrationTarget: public BitField<bool, 30, 1> {};
5680 5680
5681 // Tells whether the object in the prototype property will be used 5681 // Tells whether the object in the prototype property will be used
5682 // for instances created from this function. If the prototype 5682 // for instances created from this function. If the prototype
5683 // property is set to a value that is not a JSObject, the prototype 5683 // property is set to a value that is not a JSObject, the prototype
5684 // property will not be used to create instances of the function. 5684 // property will not be used to create instances of the function.
5685 // See ECMA-262, 13.2.2. 5685 // See ECMA-262, 13.2.2.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
5728 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549. 5728 // See https://bugzilla.mozilla.org/show_bug.cgi?id=248549.
5729 inline void set_is_undetectable() { 5729 inline void set_is_undetectable() {
5730 set_bit_field(bit_field() | (1 << kIsUndetectable)); 5730 set_bit_field(bit_field() | (1 << kIsUndetectable));
5731 } 5731 }
5732 5732
5733 inline bool is_undetectable() { 5733 inline bool is_undetectable() {
5734 return ((1 << kIsUndetectable) & bit_field()) != 0; 5734 return ((1 << kIsUndetectable) & bit_field()) != 0;
5735 } 5735 }
5736 5736
5737 // Tells whether the instance has a call-as-function handler. 5737 // Tells whether the instance has a call-as-function handler.
5738 inline void set_has_instance_call_handler() { 5738 inline void set_is_observed() {
5739 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler)); 5739 set_bit_field(bit_field() | (1 << kIsObserved));
5740 } 5740 }
5741 5741
5742 inline bool has_instance_call_handler() { 5742 inline bool is_observed() {
5743 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0; 5743 return ((1 << kIsObserved) & bit_field()) != 0;
5744 } 5744 }
5745 5745
5746 inline void set_is_extensible(bool value); 5746 inline void set_is_extensible(bool value);
5747 inline bool is_extensible(); 5747 inline bool is_extensible();
5748 5748
5749 inline void set_elements_kind(ElementsKind elements_kind) { 5749 inline void set_elements_kind(ElementsKind elements_kind) {
5750 ASSERT(elements_kind < kElementsKindCount); 5750 ASSERT(elements_kind < kElementsKindCount);
5751 ASSERT(kElementsKindCount <= (1 << kElementsKindBitCount)); 5751 ASSERT(kElementsKindCount <= (1 << kElementsKindBitCount));
5752 ASSERT(!is_observed() ||
5753 elements_kind == DICTIONARY_ELEMENTS ||
5754 elements_kind == NON_STRICT_ARGUMENTS_ELEMENTS ||
5755 IsExternalArrayElementsKind(elements_kind));
5756 set_bit_field2((bit_field2() & ~kElementsKindMask) | 5752 set_bit_field2((bit_field2() & ~kElementsKindMask) |
5757 (elements_kind << kElementsKindShift)); 5753 (elements_kind << kElementsKindShift));
5758 ASSERT(this->elements_kind() == elements_kind); 5754 ASSERT(this->elements_kind() == elements_kind);
5759 } 5755 }
5760 5756
5761 inline ElementsKind elements_kind() { 5757 inline ElementsKind elements_kind() {
5762 return static_cast<ElementsKind>( 5758 return static_cast<ElementsKind>(
5763 (bit_field2() & kElementsKindMask) >> kElementsKindShift); 5759 (bit_field2() & kElementsKindMask) >> kElementsKindShift);
5764 } 5760 }
5765 5761
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
5998 if (length != kInvalidEnumCache) { 5994 if (length != kInvalidEnumCache) {
5999 ASSERT(length >= 0); 5995 ASSERT(length >= 0);
6000 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); 5996 ASSERT(length == 0 || instance_descriptors()->HasEnumCache());
6001 ASSERT(length <= NumberOfOwnDescriptors()); 5997 ASSERT(length <= NumberOfOwnDescriptors());
6002 } 5998 }
6003 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); 5999 set_bit_field3(EnumLengthBits::update(bit_field3(), length));
6004 } 6000 }
6005 6001
6006 inline bool owns_descriptors(); 6002 inline bool owns_descriptors();
6007 inline void set_owns_descriptors(bool is_shared); 6003 inline void set_owns_descriptors(bool is_shared);
6008 inline bool is_observed(); 6004 inline bool has_instance_call_handler();
6009 inline void set_is_observed(bool is_observed); 6005 inline void set_has_instance_call_handler();
6010 inline void freeze(); 6006 inline void freeze();
6011 inline bool is_frozen(); 6007 inline bool is_frozen();
6012 inline void mark_unstable(); 6008 inline void mark_unstable();
6013 inline bool is_stable(); 6009 inline bool is_stable();
6014 inline void set_migration_target(bool value); 6010 inline void set_migration_target(bool value);
6015 inline bool is_migration_target(); 6011 inline bool is_migration_target();
6016 inline void deprecate(); 6012 inline void deprecate();
6017 inline bool is_deprecated(); 6013 inline bool is_deprecated();
6018 inline bool CanBeDeprecated(); 6014 inline bool CanBeDeprecated();
6019 // Returns a non-deprecated version of the input. If the input was not 6015 // Returns a non-deprecated version of the input. If the input was not
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
6258 6254
6259 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset); 6255 STATIC_CHECK(kInstanceTypeOffset == Internals::kMapInstanceTypeOffset);
6260 6256
6261 // Bit positions for bit field. 6257 // Bit positions for bit field.
6262 static const int kUnused = 0; // To be used for marking recently used maps. 6258 static const int kUnused = 0; // To be used for marking recently used maps.
6263 static const int kHasNonInstancePrototype = 1; 6259 static const int kHasNonInstancePrototype = 1;
6264 static const int kIsHiddenPrototype = 2; 6260 static const int kIsHiddenPrototype = 2;
6265 static const int kHasNamedInterceptor = 3; 6261 static const int kHasNamedInterceptor = 3;
6266 static const int kHasIndexedInterceptor = 4; 6262 static const int kHasIndexedInterceptor = 4;
6267 static const int kIsUndetectable = 5; 6263 static const int kIsUndetectable = 5;
6268 static const int kHasInstanceCallHandler = 6; 6264 static const int kIsObserved = 6;
6269 static const int kIsAccessCheckNeeded = 7; 6265 static const int kIsAccessCheckNeeded = 7;
6270 6266
6271 // Bit positions for bit field 2 6267 // Bit positions for bit field 2
6272 static const int kIsExtensible = 0; 6268 static const int kIsExtensible = 0;
6273 static const int kStringWrapperSafeForDefaultValueOf = 1; 6269 static const int kStringWrapperSafeForDefaultValueOf = 1;
6274 static const int kAttachedToSharedFunctionInfo = 2; 6270 static const int kAttachedToSharedFunctionInfo = 2;
6275 // No bits can be used after kElementsKindFirstBit, they are all reserved for 6271 // No bits can be used after kElementsKindFirstBit, they are all reserved for
6276 // storing ElementKind. 6272 // storing ElementKind.
6277 static const int kElementsKindShift = 3; 6273 static const int kElementsKindShift = 3;
6278 static const int kElementsKindBitCount = 5; 6274 static const int kElementsKindBitCount = 5;
(...skipping 4206 matching lines...) Expand 10 before | Expand all | Expand 10 after
10485 } else { 10481 } else {
10486 value &= ~(1 << bit_position); 10482 value &= ~(1 << bit_position);
10487 } 10483 }
10488 return value; 10484 return value;
10489 } 10485 }
10490 }; 10486 };
10491 10487
10492 } } // namespace v8::internal 10488 } } // namespace v8::internal
10493 10489
10494 #endif // V8_OBJECTS_H_ 10490 #endif // V8_OBJECTS_H_
OLDNEW
« src/ia32/ic-ia32.cc ('K') | « src/mips/ic-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698