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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 inline bool HasExternalShortElements(); | 1730 inline bool HasExternalShortElements(); |
1731 inline bool HasExternalUnsignedShortElements(); | 1731 inline bool HasExternalUnsignedShortElements(); |
1732 inline bool HasExternalIntElements(); | 1732 inline bool HasExternalIntElements(); |
1733 inline bool HasExternalUnsignedIntElements(); | 1733 inline bool HasExternalUnsignedIntElements(); |
1734 inline bool HasExternalFloatElements(); | 1734 inline bool HasExternalFloatElements(); |
1735 inline bool HasExternalDoubleElements(); | 1735 inline bool HasExternalDoubleElements(); |
1736 bool HasFastArgumentsElements(); | 1736 bool HasFastArgumentsElements(); |
1737 bool HasDictionaryArgumentsElements(); | 1737 bool HasDictionaryArgumentsElements(); |
1738 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. | 1738 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. |
1739 | 1739 |
| 1740 inline bool ShouldTrackAllocationInfo(); |
| 1741 |
1740 inline void set_map_and_elements( | 1742 inline void set_map_and_elements( |
1741 Map* map, | 1743 Map* map, |
1742 FixedArrayBase* value, | 1744 FixedArrayBase* value, |
1743 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 1745 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
1744 | 1746 |
1745 // Requires: HasFastElements(). | 1747 // Requires: HasFastElements(). |
1746 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); | 1748 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); |
1747 | 1749 |
1748 // Collects elements starting at index 0. | 1750 // Collects elements starting at index 0. |
1749 // Undefined values are placed after non-undefined values. | 1751 // Undefined values are placed after non-undefined values. |
(...skipping 5512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7262 public: | 7264 public: |
7263 DECL_ACCESSORS(payload, Object) | 7265 DECL_ACCESSORS(payload, Object) |
7264 | 7266 |
7265 static inline AllocationSiteInfo* cast(Object* obj); | 7267 static inline AllocationSiteInfo* cast(Object* obj); |
7266 | 7268 |
7267 DECLARE_PRINTER(AllocationSiteInfo) | 7269 DECLARE_PRINTER(AllocationSiteInfo) |
7268 DECLARE_VERIFIER(AllocationSiteInfo) | 7270 DECLARE_VERIFIER(AllocationSiteInfo) |
7269 | 7271 |
7270 // Returns NULL if no AllocationSiteInfo is available for object. | 7272 // Returns NULL if no AllocationSiteInfo is available for object. |
7271 static AllocationSiteInfo* FindForJSObject(JSObject* object); | 7273 static AllocationSiteInfo* FindForJSObject(JSObject* object); |
7272 | 7274 static inline AllocationSiteMode GetMode( |
7273 static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind); | 7275 ElementsKind boilerplate_elements_kind); |
7274 static AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); | 7276 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); |
7275 | 7277 |
7276 static const int kPayloadOffset = HeapObject::kHeaderSize; | 7278 static const int kPayloadOffset = HeapObject::kHeaderSize; |
7277 static const int kSize = kPayloadOffset + kPointerSize; | 7279 static const int kSize = kPayloadOffset + kPointerSize; |
7278 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; | 7280 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; |
7279 | 7281 |
7280 bool GetElementsKindPayload(ElementsKind* kind); | 7282 bool GetElementsKindPayload(ElementsKind* kind); |
7281 private: | 7283 private: |
7282 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); | 7284 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); |
7283 }; | 7285 }; |
7284 | 7286 |
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8716 | 8718 |
8717 private: | 8719 private: |
8718 // Expand the fixed array backing of a fast-case JSArray to at least | 8720 // Expand the fixed array backing of a fast-case JSArray to at least |
8719 // the requested size. | 8721 // the requested size. |
8720 void Expand(int minimum_size_of_backing_fixed_array); | 8722 void Expand(int minimum_size_of_backing_fixed_array); |
8721 | 8723 |
8722 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 8724 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
8723 }; | 8725 }; |
8724 | 8726 |
8725 | 8727 |
| 8728 MUST_USE_RESULT MaybeObject* CacheInitialJSArrayMaps( |
| 8729 Context* native_context, Map* initial_map); |
| 8730 |
| 8731 |
8726 // JSRegExpResult is just a JSArray with a specific initial map. | 8732 // JSRegExpResult is just a JSArray with a specific initial map. |
8727 // This initial map adds in-object properties for "index" and "input" | 8733 // This initial map adds in-object properties for "index" and "input" |
8728 // properties, as assigned by RegExp.prototype.exec, which allows | 8734 // properties, as assigned by RegExp.prototype.exec, which allows |
8729 // faster creation of RegExp exec results. | 8735 // faster creation of RegExp exec results. |
8730 // This class just holds constants used when creating the result. | 8736 // This class just holds constants used when creating the result. |
8731 // After creation the result must be treated as a JSArray in all regards. | 8737 // After creation the result must be treated as a JSArray in all regards. |
8732 class JSRegExpResult: public JSArray { | 8738 class JSRegExpResult: public JSArray { |
8733 public: | 8739 public: |
8734 // Offsets of object fields. | 8740 // Offsets of object fields. |
8735 static const int kIndexOffset = JSArray::kSize; | 8741 static const int kIndexOffset = JSArray::kSize; |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9429 } else { | 9435 } else { |
9430 value &= ~(1 << bit_position); | 9436 value &= ~(1 << bit_position); |
9431 } | 9437 } |
9432 return value; | 9438 return value; |
9433 } | 9439 } |
9434 }; | 9440 }; |
9435 | 9441 |
9436 } } // namespace v8::internal | 9442 } } // namespace v8::internal |
9437 | 9443 |
9438 #endif // V8_OBJECTS_H_ | 9444 #endif // V8_OBJECTS_H_ |
OLD | NEW |