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 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 inline MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( | 2022 inline MUST_USE_RESULT MaybeObject* GetElementsTransitionMap( |
2023 Isolate* isolate, | 2023 Isolate* isolate, |
2024 ElementsKind elements_kind); | 2024 ElementsKind elements_kind); |
2025 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( | 2025 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( |
2026 ElementsKind elements_kind); | 2026 ElementsKind elements_kind); |
2027 | 2027 |
2028 static Handle<Object> TransitionElementsKind(Handle<JSObject> object, | 2028 static Handle<Object> TransitionElementsKind(Handle<JSObject> object, |
2029 ElementsKind to_kind); | 2029 ElementsKind to_kind); |
2030 | 2030 |
2031 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); | 2031 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); |
2032 MUST_USE_RESULT MaybeObject* PossiblyTransitionArrayBoilerplate( | 2032 MUST_USE_RESULT MaybeObject* UpdateAllocationSiteInfo( |
2033 ElementsKind to_kind); | 2033 ElementsKind to_kind); |
2034 | 2034 |
2035 // Replaces an existing transition with a transition to a map with a FIELD. | 2035 // Replaces an existing transition with a transition to a map with a FIELD. |
2036 MUST_USE_RESULT MaybeObject* ConvertTransitionToMapTransition( | 2036 MUST_USE_RESULT MaybeObject* ConvertTransitionToMapTransition( |
2037 int transition_index, | 2037 int transition_index, |
2038 String* name, | 2038 String* name, |
2039 Object* new_value, | 2039 Object* new_value, |
2040 PropertyAttributes attributes); | 2040 PropertyAttributes attributes); |
2041 | 2041 |
2042 // Converts a descriptor of any other type to a real field, backed by the | 2042 // Converts a descriptor of any other type to a real field, backed by the |
(...skipping 5015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7058 DECLARE_VERIFIER(AllocationSiteInfo) | 7058 DECLARE_VERIFIER(AllocationSiteInfo) |
7059 | 7059 |
7060 // Returns NULL if no AllocationSiteInfo is available for object. | 7060 // Returns NULL if no AllocationSiteInfo is available for object. |
7061 static AllocationSiteInfo* FindForJSObject(JSObject* object); | 7061 static AllocationSiteInfo* FindForJSObject(JSObject* object); |
7062 | 7062 |
7063 static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind); | 7063 static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind); |
7064 static AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); | 7064 static AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); |
7065 | 7065 |
7066 static const int kPayloadOffset = HeapObject::kHeaderSize; | 7066 static const int kPayloadOffset = HeapObject::kHeaderSize; |
7067 static const int kSize = kPayloadOffset + kPointerSize; | 7067 static const int kSize = kPayloadOffset + kPointerSize; |
| 7068 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; |
7068 | 7069 |
7069 bool GetElementsKindPayload(ElementsKind* kind); | 7070 bool GetElementsKindPayload(ElementsKind* kind); |
7070 private: | 7071 private: |
7071 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); | 7072 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSiteInfo); |
7072 }; | 7073 }; |
7073 | 7074 |
7074 | 7075 |
7075 // Representation of a slow alias as part of a non-strict arguments objects. | 7076 // Representation of a slow alias as part of a non-strict arguments objects. |
7076 // For fast aliases (if HasNonStrictArgumentsElements()): | 7077 // For fast aliases (if HasNonStrictArgumentsElements()): |
7077 // - the parameter map contains an index into the context | 7078 // - the parameter map contains an index into the context |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8343 // Overload the length setter to skip write barrier when the length | 8344 // Overload the length setter to skip write barrier when the length |
8344 // is set to a smi. This matches the set function on FixedArray. | 8345 // is set to a smi. This matches the set function on FixedArray. |
8345 inline void set_length(Smi* length); | 8346 inline void set_length(Smi* length); |
8346 | 8347 |
8347 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index, | 8348 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index, |
8348 Object* value); | 8349 Object* value); |
8349 | 8350 |
8350 // Initialize the array with the given capacity. The function may | 8351 // Initialize the array with the given capacity. The function may |
8351 // fail due to out-of-memory situations, but only if the requested | 8352 // fail due to out-of-memory situations, but only if the requested |
8352 // capacity is non-zero. | 8353 // capacity is non-zero. |
8353 MUST_USE_RESULT MaybeObject* Initialize(int capacity); | 8354 MUST_USE_RESULT MaybeObject* Initialize(int capacity, int length = 0); |
8354 | 8355 |
8355 // Initializes the array to a certain length. | 8356 // Initializes the array to a certain length. |
8356 inline bool AllowsSetElementsLength(); | 8357 inline bool AllowsSetElementsLength(); |
8357 // Can cause GC. | 8358 // Can cause GC. |
8358 MUST_USE_RESULT MaybeObject* SetElementsLength(Object* length); | 8359 MUST_USE_RESULT MaybeObject* SetElementsLength(Object* length); |
8359 | 8360 |
8360 // Set the content of the array to the content of storage. | 8361 // Set the content of the array to the content of storage. |
8361 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage); | 8362 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage); |
8362 | 8363 |
8363 // Casting. | 8364 // Casting. |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9021 } else { | 9022 } else { |
9022 value &= ~(1 << bit_position); | 9023 value &= ~(1 << bit_position); |
9023 } | 9024 } |
9024 return value; | 9025 return value; |
9025 } | 9026 } |
9026 }; | 9027 }; |
9027 | 9028 |
9028 } } // namespace v8::internal | 9029 } } // namespace v8::internal |
9029 | 9030 |
9030 #endif // V8_OBJECTS_H_ | 9031 #endif // V8_OBJECTS_H_ |
OLD | NEW |