Changeset 175172 in webkit
- Timestamp:
- Oct 24, 2014, 12:16:29 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r175151 r175172 1 2014-10-24 Mark Lam <mark.lam@apple.com> 2 3 Simplified IndexingType's hasAnyArrayStorage(). 4 <https://webkit.org/b/138051> 5 6 Reviewed by Michael Saboff. 7 8 IndexingType's hasAnyArrayStorage() currently does subtraction of ArrayStorageShape 9 with the purpose of making non-ArrayStorage types underflow (with that subtraction) 10 and have a result that exceeds SlowPutArrayStorageShape. What it is doing is 11 basically checking for a shape value that is greater equal to ArrayStorageShape. 12 We can just simplify the code as such. 13 14 Also added a comment to describe the structure of the bits in IndexingType. 15 16 * runtime/IndexingType.h: 17 (JSC::hasAnyArrayStorage): 18 1 19 2014-10-23 Joseph Pecoraro <pecoraro@apple.com> 2 20 -
trunk/Source/JavaScriptCore/runtime/IndexingType.h
r166292 r175172 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 32 32 namespace JSC { 33 34 /* 35 Structure of the IndexingType 36 ============================= 37 Conceptually, the IndexingType looks like this: 38 39 struct IndexingType { 40 uint8_t isArray:1; // bit 0 41 uint8_t shape:4; // bit 1 - 4 42 uint8_t mayHaveIndexedAccessors:1; // bit 5 43 }; 44 45 The shape values (e.g. Int32Shape, ContiguousShape, etc) are an enumeration of 46 various shapes (though not necessarily sequential in terms of their values). 47 Hence, shape values are not bitwise exclusive with respect to each other. 48 */ 33 49 34 50 typedef uint8_t IndexingType; … … 129 145 static inline bool hasAnyArrayStorage(IndexingType indexingType) 130 146 { 131 return static_cast<uint8_t>( (indexingType & IndexingShapeMask) - ArrayStorageShape) <= static_cast<uint8_t>(SlowPutArrayStorageShape - ArrayStorageShape);147 return static_cast<uint8_t>(indexingType & IndexingShapeMask) >= ArrayStorageShape; 132 148 } 133 149
Note:
See TracChangeset
for help on using the changeset viewer.