OLD | NEW |
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 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2005 // Retrieves a permanent object identity hash code. The undefined value might | 2005 // Retrieves a permanent object identity hash code. The undefined value might |
2006 // be returned in case no hash was created yet and OMIT_CREATION was used. | 2006 // be returned in case no hash was created yet and OMIT_CREATION was used. |
2007 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 2007 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
2008 | 2008 |
2009 // Lookup a property. If found, the result is valid and has | 2009 // Lookup a property. If found, the result is valid and has |
2010 // detailed information. | 2010 // detailed information. |
2011 void LocalLookup(Name* name, LookupResult* result, | 2011 void LocalLookup(Name* name, LookupResult* result, |
2012 bool search_hidden_prototypes = false); | 2012 bool search_hidden_prototypes = false); |
2013 void Lookup(Name* name, LookupResult* result); | 2013 void Lookup(Name* name, LookupResult* result); |
2014 | 2014 |
| 2015 bool MayHaveIndexedCallbacksInPrototypeChain(); |
| 2016 |
2015 protected: | 2017 protected: |
2016 Smi* GenerateIdentityHash(); | 2018 Smi* GenerateIdentityHash(); |
2017 | 2019 |
2018 static Handle<Object> SetPropertyWithDefinedSetter(Handle<JSReceiver> object, | 2020 static Handle<Object> SetPropertyWithDefinedSetter(Handle<JSReceiver> object, |
2019 Handle<JSReceiver> setter, | 2021 Handle<JSReceiver> setter, |
2020 Handle<Object> value); | 2022 Handle<Object> value); |
2021 | 2023 |
2022 private: | 2024 private: |
2023 PropertyAttributes GetPropertyAttributeForResult(JSReceiver* receiver, | 2025 PropertyAttributes GetPropertyAttributeForResult(JSReceiver* receiver, |
2024 LookupResult* result, | 2026 LookupResult* result, |
(...skipping 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5282 int CodeSize() { return SizeFor(body_size()); } | 5284 int CodeSize() { return SizeFor(body_size()); } |
5283 inline void CodeIterateBody(ObjectVisitor* v); | 5285 inline void CodeIterateBody(ObjectVisitor* v); |
5284 | 5286 |
5285 template<typename StaticVisitor> | 5287 template<typename StaticVisitor> |
5286 inline void CodeIterateBody(Heap* heap); | 5288 inline void CodeIterateBody(Heap* heap); |
5287 | 5289 |
5288 DECLARE_PRINTER(Code) | 5290 DECLARE_PRINTER(Code) |
5289 DECLARE_VERIFIER(Code) | 5291 DECLARE_VERIFIER(Code) |
5290 | 5292 |
5291 void ClearInlineCaches(); | 5293 void ClearInlineCaches(); |
| 5294 void ClearInlineCaches(Kind* kind); |
| 5295 void ClearInlineCaches(Kind kind); |
| 5296 |
5292 void ClearTypeFeedbackCells(Heap* heap); | 5297 void ClearTypeFeedbackCells(Heap* heap); |
5293 | 5298 |
5294 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); | 5299 BailoutId TranslatePcOffsetToAstId(uint32_t pc_offset); |
5295 | 5300 |
5296 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, | 5301 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge, |
5297 enum Age { | 5302 enum Age { |
5298 kNoAge = 0, | 5303 kNoAge = 0, |
5299 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) | 5304 CODE_AGE_LIST(DECLARE_CODE_AGE_ENUM) |
5300 kAfterLastCodeAge, | 5305 kAfterLastCodeAge, |
5301 kLastCodeAge = kAfterLastCodeAge - 1, | 5306 kLastCodeAge = kAfterLastCodeAge - 1, |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5606 class IsShared: public BitField<bool, 22, 1> {}; | 5611 class IsShared: public BitField<bool, 22, 1> {}; |
5607 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; | 5612 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; |
5608 class DictionaryMap: public BitField<bool, 24, 1> {}; | 5613 class DictionaryMap: public BitField<bool, 24, 1> {}; |
5609 class OwnsDescriptors: public BitField<bool, 25, 1> {}; | 5614 class OwnsDescriptors: public BitField<bool, 25, 1> {}; |
5610 class IsObserved: public BitField<bool, 26, 1> {}; | 5615 class IsObserved: public BitField<bool, 26, 1> {}; |
5611 class Deprecated: public BitField<bool, 27, 1> {}; | 5616 class Deprecated: public BitField<bool, 27, 1> {}; |
5612 class IsFrozen: public BitField<bool, 28, 1> {}; | 5617 class IsFrozen: public BitField<bool, 28, 1> {}; |
5613 class IsUnstable: public BitField<bool, 29, 1> {}; | 5618 class IsUnstable: public BitField<bool, 29, 1> {}; |
5614 class IsMigrationTarget: public BitField<bool, 30, 1> {}; | 5619 class IsMigrationTarget: public BitField<bool, 30, 1> {}; |
5615 | 5620 |
| 5621 // Bit field 4. |
| 5622 inline uint32_t bit_field4(); |
| 5623 inline void set_bit_field4(uint32_t bits); |
| 5624 |
| 5625 class HasElementCallbacks: public BitField<int, 0, 1> {}; |
| 5626 |
| 5627 inline void set_has_element_callbacks(bool value); |
| 5628 inline bool has_element_callbacks(); |
| 5629 |
5616 // Tells whether the object in the prototype property will be used | 5630 // Tells whether the object in the prototype property will be used |
5617 // for instances created from this function. If the prototype | 5631 // for instances created from this function. If the prototype |
5618 // property is set to a value that is not a JSObject, the prototype | 5632 // property is set to a value that is not a JSObject, the prototype |
5619 // property will not be used to create instances of the function. | 5633 // property will not be used to create instances of the function. |
5620 // See ECMA-262, 13.2.2. | 5634 // See ECMA-262, 13.2.2. |
5621 inline void set_non_instance_prototype(bool value); | 5635 inline void set_non_instance_prototype(bool value); |
5622 inline bool has_non_instance_prototype(); | 5636 inline bool has_non_instance_prototype(); |
5623 | 5637 |
5624 // Tells whether function has special prototype property. If not, prototype | 5638 // Tells whether function has special prototype property. If not, prototype |
5625 // property will not be created when accessed (will return undefined), | 5639 // property will not be created when accessed (will return undefined), |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6152 // pointer if unused. When the map has transitions, the back pointer is | 6166 // pointer if unused. When the map has transitions, the back pointer is |
6153 // transferred to the transition array and accessed through an extra | 6167 // transferred to the transition array and accessed through an extra |
6154 // indirection. | 6168 // indirection. |
6155 static const int kTransitionsOrBackPointerOffset = | 6169 static const int kTransitionsOrBackPointerOffset = |
6156 kConstructorOffset + kPointerSize; | 6170 kConstructorOffset + kPointerSize; |
6157 static const int kDescriptorsOffset = | 6171 static const int kDescriptorsOffset = |
6158 kTransitionsOrBackPointerOffset + kPointerSize; | 6172 kTransitionsOrBackPointerOffset + kPointerSize; |
6159 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; | 6173 static const int kCodeCacheOffset = kDescriptorsOffset + kPointerSize; |
6160 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; | 6174 static const int kDependentCodeOffset = kCodeCacheOffset + kPointerSize; |
6161 static const int kBitField3Offset = kDependentCodeOffset + kPointerSize; | 6175 static const int kBitField3Offset = kDependentCodeOffset + kPointerSize; |
6162 static const int kSize = kBitField3Offset + kPointerSize; | 6176 static const int kBitField4Offset = kBitField3Offset + kPointerSize; |
| 6177 static const int kSize = kBitField4Offset + kPointerSize; |
6163 | 6178 |
6164 // Layout of pointer fields. Heap iteration code relies on them | 6179 // Layout of pointer fields. Heap iteration code relies on them |
6165 // being continuously allocated. | 6180 // being continuously allocated. |
6166 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; | 6181 static const int kPointerFieldsBeginOffset = Map::kPrototypeOffset; |
6167 static const int kPointerFieldsEndOffset = kBitField3Offset + kPointerSize; | 6182 static const int kPointerFieldsEndOffset = kBitField3Offset + kPointerSize; |
6168 | 6183 |
6169 // Byte offsets within kInstanceSizesOffset. | 6184 // Byte offsets within kInstanceSizesOffset. |
6170 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; | 6185 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0; |
6171 static const int kInObjectPropertiesByte = 1; | 6186 static const int kInObjectPropertiesByte = 1; |
6172 static const int kInObjectPropertiesOffset = | 6187 static const int kInObjectPropertiesOffset = |
(...skipping 4245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10418 } else { | 10433 } else { |
10419 value &= ~(1 << bit_position); | 10434 value &= ~(1 << bit_position); |
10420 } | 10435 } |
10421 return value; | 10436 return value; |
10422 } | 10437 } |
10423 }; | 10438 }; |
10424 | 10439 |
10425 } } // namespace v8::internal | 10440 } } // namespace v8::internal |
10426 | 10441 |
10427 #endif // V8_OBJECTS_H_ | 10442 #endif // V8_OBJECTS_H_ |
OLD | NEW |