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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // - FastPackedDoubleElementsAccessor | 49 // - FastPackedDoubleElementsAccessor |
50 // - FastHoleyDoubleElementsAccessor | 50 // - FastHoleyDoubleElementsAccessor |
51 // - ExternalElementsAccessor (abstract) | 51 // - ExternalElementsAccessor (abstract) |
52 // - ExternalByteElementsAccessor | 52 // - ExternalByteElementsAccessor |
53 // - ExternalUnsignedByteElementsAccessor | 53 // - ExternalUnsignedByteElementsAccessor |
54 // - ExternalShortElementsAccessor | 54 // - ExternalShortElementsAccessor |
55 // - ExternalUnsignedShortElementsAccessor | 55 // - ExternalUnsignedShortElementsAccessor |
56 // - ExternalIntElementsAccessor | 56 // - ExternalIntElementsAccessor |
57 // - ExternalUnsignedIntElementsAccessor | 57 // - ExternalUnsignedIntElementsAccessor |
58 // - ExternalFloatElementsAccessor | 58 // - ExternalFloatElementsAccessor |
| 59 // - ExternalFloat32x4ElementsAccessor |
59 // - ExternalDoubleElementsAccessor | 60 // - ExternalDoubleElementsAccessor |
60 // - PixelElementsAccessor | 61 // - PixelElementsAccessor |
61 // - DictionaryElementsAccessor | 62 // - DictionaryElementsAccessor |
62 // - NonStrictArgumentsElementsAccessor | 63 // - NonStrictArgumentsElementsAccessor |
63 | 64 |
64 | 65 |
65 namespace v8 { | 66 namespace v8 { |
66 namespace internal { | 67 namespace internal { |
67 | 68 |
68 | 69 |
(...skipping 26 matching lines...) Expand all Loading... |
95 V(ExternalShortElementsAccessor, EXTERNAL_SHORT_ELEMENTS, \ | 96 V(ExternalShortElementsAccessor, EXTERNAL_SHORT_ELEMENTS, \ |
96 ExternalShortArray) \ | 97 ExternalShortArray) \ |
97 V(ExternalUnsignedShortElementsAccessor, \ | 98 V(ExternalUnsignedShortElementsAccessor, \ |
98 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, ExternalUnsignedShortArray) \ | 99 EXTERNAL_UNSIGNED_SHORT_ELEMENTS, ExternalUnsignedShortArray) \ |
99 V(ExternalIntElementsAccessor, EXTERNAL_INT_ELEMENTS, \ | 100 V(ExternalIntElementsAccessor, EXTERNAL_INT_ELEMENTS, \ |
100 ExternalIntArray) \ | 101 ExternalIntArray) \ |
101 V(ExternalUnsignedIntElementsAccessor, \ | 102 V(ExternalUnsignedIntElementsAccessor, \ |
102 EXTERNAL_UNSIGNED_INT_ELEMENTS, ExternalUnsignedIntArray) \ | 103 EXTERNAL_UNSIGNED_INT_ELEMENTS, ExternalUnsignedIntArray) \ |
103 V(ExternalFloatElementsAccessor, \ | 104 V(ExternalFloatElementsAccessor, \ |
104 EXTERNAL_FLOAT_ELEMENTS, ExternalFloatArray) \ | 105 EXTERNAL_FLOAT_ELEMENTS, ExternalFloatArray) \ |
| 106 V(ExternalFloat32x4ElementsAccessor, \ |
| 107 EXTERNAL_FLOAT32x4_ELEMENTS, ExternalFloat32x4Array) \ |
| 108 V(ExternalInt32x4ElementsAccessor, \ |
| 109 EXTERNAL_INT32x4_ELEMENTS, ExternalInt32x4Array) \ |
105 V(ExternalDoubleElementsAccessor, \ | 110 V(ExternalDoubleElementsAccessor, \ |
106 EXTERNAL_DOUBLE_ELEMENTS, ExternalDoubleArray) \ | 111 EXTERNAL_DOUBLE_ELEMENTS, ExternalDoubleArray) \ |
107 V(PixelElementsAccessor, EXTERNAL_PIXEL_ELEMENTS, ExternalPixelArray) | 112 V(PixelElementsAccessor, EXTERNAL_PIXEL_ELEMENTS, ExternalPixelArray) |
108 | 113 |
109 | 114 |
110 template<ElementsKind Kind> class ElementsKindTraits { | 115 template<ElementsKind Kind> class ElementsKindTraits { |
111 public: | 116 public: |
112 typedef FixedArrayBase BackingStore; | 117 typedef FixedArrayBase BackingStore; |
113 }; | 118 }; |
114 | 119 |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 case EXTERNAL_SHORT_ARRAY_TYPE: | 1090 case EXTERNAL_SHORT_ARRAY_TYPE: |
1086 return EXTERNAL_SHORT_ELEMENTS; | 1091 return EXTERNAL_SHORT_ELEMENTS; |
1087 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: | 1092 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
1088 return EXTERNAL_UNSIGNED_SHORT_ELEMENTS; | 1093 return EXTERNAL_UNSIGNED_SHORT_ELEMENTS; |
1089 case EXTERNAL_INT_ARRAY_TYPE: | 1094 case EXTERNAL_INT_ARRAY_TYPE: |
1090 return EXTERNAL_INT_ELEMENTS; | 1095 return EXTERNAL_INT_ELEMENTS; |
1091 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 1096 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
1092 return EXTERNAL_UNSIGNED_INT_ELEMENTS; | 1097 return EXTERNAL_UNSIGNED_INT_ELEMENTS; |
1093 case EXTERNAL_FLOAT_ARRAY_TYPE: | 1098 case EXTERNAL_FLOAT_ARRAY_TYPE: |
1094 return EXTERNAL_FLOAT_ELEMENTS; | 1099 return EXTERNAL_FLOAT_ELEMENTS; |
| 1100 case EXTERNAL_FLOAT32x4_ARRAY_TYPE: |
| 1101 return EXTERNAL_FLOAT32x4_ELEMENTS; |
| 1102 case EXTERNAL_INT32x4_ARRAY_TYPE: |
| 1103 return EXTERNAL_INT32x4_ELEMENTS; |
1095 case EXTERNAL_DOUBLE_ARRAY_TYPE: | 1104 case EXTERNAL_DOUBLE_ARRAY_TYPE: |
1096 return EXTERNAL_DOUBLE_ELEMENTS; | 1105 return EXTERNAL_DOUBLE_ELEMENTS; |
1097 case EXTERNAL_PIXEL_ARRAY_TYPE: | 1106 case EXTERNAL_PIXEL_ARRAY_TYPE: |
1098 return EXTERNAL_PIXEL_ELEMENTS; | 1107 return EXTERNAL_PIXEL_ELEMENTS; |
1099 default: | 1108 default: |
1100 UNREACHABLE(); | 1109 UNREACHABLE(); |
1101 } | 1110 } |
1102 return FAST_HOLEY_ELEMENTS; | 1111 return FAST_HOLEY_ELEMENTS; |
1103 } | 1112 } |
1104 | 1113 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 return CopyElementsImpl(arguments, from_start, to, from_kind, | 1158 return CopyElementsImpl(arguments, from_start, to, from_kind, |
1150 to_start, packed_size, copy_size); | 1159 to_start, packed_size, copy_size); |
1151 } | 1160 } |
1152 case EXTERNAL_BYTE_ELEMENTS: | 1161 case EXTERNAL_BYTE_ELEMENTS: |
1153 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 1162 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
1154 case EXTERNAL_SHORT_ELEMENTS: | 1163 case EXTERNAL_SHORT_ELEMENTS: |
1155 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 1164 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
1156 case EXTERNAL_INT_ELEMENTS: | 1165 case EXTERNAL_INT_ELEMENTS: |
1157 case EXTERNAL_UNSIGNED_INT_ELEMENTS: | 1166 case EXTERNAL_UNSIGNED_INT_ELEMENTS: |
1158 case EXTERNAL_FLOAT_ELEMENTS: | 1167 case EXTERNAL_FLOAT_ELEMENTS: |
| 1168 case EXTERNAL_FLOAT32x4_ELEMENTS: |
| 1169 case EXTERNAL_INT32x4_ELEMENTS: |
1159 case EXTERNAL_DOUBLE_ELEMENTS: | 1170 case EXTERNAL_DOUBLE_ELEMENTS: |
1160 case EXTERNAL_PIXEL_ELEMENTS: | 1171 case EXTERNAL_PIXEL_ELEMENTS: |
1161 UNREACHABLE(); | 1172 UNREACHABLE(); |
1162 } | 1173 } |
1163 return NULL; | 1174 return NULL; |
1164 } | 1175 } |
1165 | 1176 |
1166 | 1177 |
1167 static MaybeObject* SetFastElementsCapacityAndLength(JSObject* obj, | 1178 static MaybeObject* SetFastElementsCapacityAndLength(JSObject* obj, |
1168 uint32_t capacity, | 1179 uint32_t capacity, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 from, from_start, to, to_start, copy_size); | 1285 from, from_start, to, to_start, copy_size); |
1275 break; | 1286 break; |
1276 case NON_STRICT_ARGUMENTS_ELEMENTS: | 1287 case NON_STRICT_ARGUMENTS_ELEMENTS: |
1277 case EXTERNAL_BYTE_ELEMENTS: | 1288 case EXTERNAL_BYTE_ELEMENTS: |
1278 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 1289 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
1279 case EXTERNAL_SHORT_ELEMENTS: | 1290 case EXTERNAL_SHORT_ELEMENTS: |
1280 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 1291 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
1281 case EXTERNAL_INT_ELEMENTS: | 1292 case EXTERNAL_INT_ELEMENTS: |
1282 case EXTERNAL_UNSIGNED_INT_ELEMENTS: | 1293 case EXTERNAL_UNSIGNED_INT_ELEMENTS: |
1283 case EXTERNAL_FLOAT_ELEMENTS: | 1294 case EXTERNAL_FLOAT_ELEMENTS: |
| 1295 case EXTERNAL_FLOAT32x4_ELEMENTS: |
| 1296 case EXTERNAL_INT32x4_ELEMENTS: |
1284 case EXTERNAL_DOUBLE_ELEMENTS: | 1297 case EXTERNAL_DOUBLE_ELEMENTS: |
1285 case EXTERNAL_PIXEL_ELEMENTS: | 1298 case EXTERNAL_PIXEL_ELEMENTS: |
1286 UNREACHABLE(); | 1299 UNREACHABLE(); |
1287 } | 1300 } |
1288 return to->GetHeap()->undefined_value(); | 1301 return to->GetHeap()->undefined_value(); |
1289 } | 1302 } |
1290 }; | 1303 }; |
1291 | 1304 |
1292 | 1305 |
1293 class FastPackedDoubleElementsAccessor | 1306 class FastPackedDoubleElementsAccessor |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 | 1468 |
1456 class ExternalFloatElementsAccessor | 1469 class ExternalFloatElementsAccessor |
1457 : public ExternalElementsAccessor<ExternalFloatElementsAccessor, | 1470 : public ExternalElementsAccessor<ExternalFloatElementsAccessor, |
1458 EXTERNAL_FLOAT_ELEMENTS> { | 1471 EXTERNAL_FLOAT_ELEMENTS> { |
1459 public: | 1472 public: |
1460 explicit ExternalFloatElementsAccessor(const char* name) | 1473 explicit ExternalFloatElementsAccessor(const char* name) |
1461 : ExternalElementsAccessor<ExternalFloatElementsAccessor, | 1474 : ExternalElementsAccessor<ExternalFloatElementsAccessor, |
1462 EXTERNAL_FLOAT_ELEMENTS>(name) {} | 1475 EXTERNAL_FLOAT_ELEMENTS>(name) {} |
1463 }; | 1476 }; |
1464 | 1477 |
| 1478 class ExternalFloat32x4ElementsAccessor |
| 1479 : public ExternalElementsAccessor<ExternalFloat32x4ElementsAccessor, |
| 1480 EXTERNAL_FLOAT32x4_ELEMENTS> { |
| 1481 public: |
| 1482 explicit ExternalFloat32x4ElementsAccessor(const char* name) |
| 1483 : ExternalElementsAccessor<ExternalFloat32x4ElementsAccessor, |
| 1484 EXTERNAL_FLOAT32x4_ELEMENTS>(name) {} |
| 1485 }; |
| 1486 |
| 1487 |
| 1488 class ExternalInt32x4ElementsAccessor |
| 1489 : public ExternalElementsAccessor<ExternalInt32x4ElementsAccessor, |
| 1490 EXTERNAL_INT32x4_ELEMENTS> { |
| 1491 public: |
| 1492 explicit ExternalInt32x4ElementsAccessor(const char* name) |
| 1493 : ExternalElementsAccessor<ExternalInt32x4ElementsAccessor, |
| 1494 EXTERNAL_INT32x4_ELEMENTS>(name) {} |
| 1495 }; |
| 1496 |
1465 | 1497 |
1466 class ExternalDoubleElementsAccessor | 1498 class ExternalDoubleElementsAccessor |
1467 : public ExternalElementsAccessor<ExternalDoubleElementsAccessor, | 1499 : public ExternalElementsAccessor<ExternalDoubleElementsAccessor, |
1468 EXTERNAL_DOUBLE_ELEMENTS> { | 1500 EXTERNAL_DOUBLE_ELEMENTS> { |
1469 public: | 1501 public: |
1470 explicit ExternalDoubleElementsAccessor(const char* name) | 1502 explicit ExternalDoubleElementsAccessor(const char* name) |
1471 : ExternalElementsAccessor<ExternalDoubleElementsAccessor, | 1503 : ExternalElementsAccessor<ExternalDoubleElementsAccessor, |
1472 EXTERNAL_DOUBLE_ELEMENTS>(name) {} | 1504 EXTERNAL_DOUBLE_ELEMENTS>(name) {} |
1473 }; | 1505 }; |
1474 | 1506 |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 UNREACHABLE(); | 2090 UNREACHABLE(); |
2059 break; | 2091 break; |
2060 } | 2092 } |
2061 | 2093 |
2062 array->set_elements(elms); | 2094 array->set_elements(elms); |
2063 array->set_length(Smi::FromInt(number_of_elements)); | 2095 array->set_length(Smi::FromInt(number_of_elements)); |
2064 return array; | 2096 return array; |
2065 } | 2097 } |
2066 | 2098 |
2067 } } // namespace v8::internal | 2099 } } // namespace v8::internal |
OLD | NEW |