Chromium Code Reviews| 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 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1606 inline bool HasExternalShortElements(); | 1606 inline bool HasExternalShortElements(); |
| 1607 inline bool HasExternalUnsignedShortElements(); | 1607 inline bool HasExternalUnsignedShortElements(); |
| 1608 inline bool HasExternalIntElements(); | 1608 inline bool HasExternalIntElements(); |
| 1609 inline bool HasExternalUnsignedIntElements(); | 1609 inline bool HasExternalUnsignedIntElements(); |
| 1610 inline bool HasExternalFloatElements(); | 1610 inline bool HasExternalFloatElements(); |
| 1611 inline bool HasExternalDoubleElements(); | 1611 inline bool HasExternalDoubleElements(); |
| 1612 bool HasFastArgumentsElements(); | 1612 bool HasFastArgumentsElements(); |
| 1613 bool HasDictionaryArgumentsElements(); | 1613 bool HasDictionaryArgumentsElements(); |
| 1614 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. | 1614 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. |
| 1615 | 1615 |
| 1616 inline bool ShouldTrackAllocationInfo(); | |
| 1617 | |
| 1616 inline void set_map_and_elements( | 1618 inline void set_map_and_elements( |
| 1617 Map* map, | 1619 Map* map, |
| 1618 FixedArrayBase* value, | 1620 FixedArrayBase* value, |
| 1619 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 1621 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 1620 | 1622 |
| 1621 // Requires: HasFastElements(). | 1623 // Requires: HasFastElements(). |
| 1622 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); | 1624 MUST_USE_RESULT inline MaybeObject* EnsureWritableFastElements(); |
| 1623 | 1625 |
| 1624 // Collects elements starting at index 0. | 1626 // Collects elements starting at index 0. |
| 1625 // Undefined values are placed after non-undefined values. | 1627 // Undefined values are placed after non-undefined values. |
| (...skipping 6651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8277 // Set the content of the array to the content of storage. | 8279 // Set the content of the array to the content of storage. |
| 8278 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage); | 8280 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage); |
| 8279 | 8281 |
| 8280 // Casting. | 8282 // Casting. |
| 8281 static inline JSArray* cast(Object* obj); | 8283 static inline JSArray* cast(Object* obj); |
| 8282 | 8284 |
| 8283 // Uses handles. Ensures that the fixed array backing the JSArray has at | 8285 // Uses handles. Ensures that the fixed array backing the JSArray has at |
| 8284 // least the stated size. | 8286 // least the stated size. |
| 8285 inline void EnsureSize(int minimum_size_of_backing_fixed_array); | 8287 inline void EnsureSize(int minimum_size_of_backing_fixed_array); |
| 8286 | 8288 |
| 8289 inline bool ShouldTrackAllocationInfo(); | |
|
danno
2013/02/11 15:05:21
See previous comments, I think this method is supe
| |
| 8290 | |
| 8287 // Dispatched behavior. | 8291 // Dispatched behavior. |
| 8288 DECLARE_PRINTER(JSArray) | 8292 DECLARE_PRINTER(JSArray) |
| 8289 DECLARE_VERIFIER(JSArray) | 8293 DECLARE_VERIFIER(JSArray) |
| 8290 | 8294 |
| 8291 // Number of element slots to pre-allocate for an empty array. | 8295 // Number of element slots to pre-allocate for an empty array. |
| 8292 static const int kPreallocatedArrayElements = 4; | 8296 static const int kPreallocatedArrayElements = 4; |
| 8293 | 8297 |
| 8294 // Layout description. | 8298 // Layout description. |
| 8295 static const int kLengthOffset = JSObject::kHeaderSize; | 8299 static const int kLengthOffset = JSObject::kHeaderSize; |
| 8296 static const int kSize = kLengthOffset + kPointerSize; | 8300 static const int kSize = kLengthOffset + kPointerSize; |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8885 } else { | 8889 } else { |
| 8886 value &= ~(1 << bit_position); | 8890 value &= ~(1 << bit_position); |
| 8887 } | 8891 } |
| 8888 return value; | 8892 return value; |
| 8889 } | 8893 } |
| 8890 }; | 8894 }; |
| 8891 | 8895 |
| 8892 } } // namespace v8::internal | 8896 } } // namespace v8::internal |
| 8893 | 8897 |
| 8894 #endif // V8_OBJECTS_H_ | 8898 #endif // V8_OBJECTS_H_ |
| OLD | NEW |