| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 cls = Class::New<ImmutableArray>(); | 1092 cls = Class::New<ImmutableArray>(); |
| 1093 object_store->set_immutable_array_class(cls); | 1093 object_store->set_immutable_array_class(cls); |
| 1094 | 1094 |
| 1095 cls = Class::New<GrowableObjectArray>(); | 1095 cls = Class::New<GrowableObjectArray>(); |
| 1096 object_store->set_growable_object_array_class(cls); | 1096 object_store->set_growable_object_array_class(cls); |
| 1097 | 1097 |
| 1098 #define REGISTER_SCALARLIST_CLASS(name, object_store_name) \ | 1098 #define REGISTER_SCALARLIST_CLASS(name, object_store_name) \ |
| 1099 cls = Class::New<name>(); \ | 1099 cls = Class::New<name>(); \ |
| 1100 object_store->set_##object_store_name##_class(cls); \ | 1100 object_store->set_##object_store_name##_class(cls); \ |
| 1101 | 1101 |
| 1102 REGISTER_SCALARLIST_CLASS(Float32x4, float32x4); | |
| 1103 REGISTER_SCALARLIST_CLASS(Uint32x4, uint32x4); | |
| 1104 REGISTER_SCALARLIST_CLASS(Int8Array, int8_array); | 1102 REGISTER_SCALARLIST_CLASS(Int8Array, int8_array); |
| 1105 REGISTER_SCALARLIST_CLASS(Uint8Array, uint8_array); | 1103 REGISTER_SCALARLIST_CLASS(Uint8Array, uint8_array); |
| 1106 REGISTER_SCALARLIST_CLASS(Uint8ClampedArray, uint8_clamped_array); | 1104 REGISTER_SCALARLIST_CLASS(Uint8ClampedArray, uint8_clamped_array); |
| 1107 REGISTER_SCALARLIST_CLASS(Int16Array, int16_array); | 1105 REGISTER_SCALARLIST_CLASS(Int16Array, int16_array); |
| 1108 REGISTER_SCALARLIST_CLASS(Uint16Array, uint16_array); | 1106 REGISTER_SCALARLIST_CLASS(Uint16Array, uint16_array); |
| 1109 REGISTER_SCALARLIST_CLASS(Int32Array, int32_array); | 1107 REGISTER_SCALARLIST_CLASS(Int32Array, int32_array); |
| 1110 REGISTER_SCALARLIST_CLASS(Uint32Array, uint32_array); | 1108 REGISTER_SCALARLIST_CLASS(Uint32Array, uint32_array); |
| 1111 REGISTER_SCALARLIST_CLASS(Int64Array, int64_array); | 1109 REGISTER_SCALARLIST_CLASS(Int64Array, int64_array); |
| 1112 REGISTER_SCALARLIST_CLASS(Uint64Array, uint64_array); | 1110 REGISTER_SCALARLIST_CLASS(Uint64Array, uint64_array); |
| 1113 REGISTER_SCALARLIST_CLASS(Float32x4Array, float32x4_array); | |
| 1114 REGISTER_SCALARLIST_CLASS(Float32Array, float32_array); | 1111 REGISTER_SCALARLIST_CLASS(Float32Array, float32_array); |
| 1115 REGISTER_SCALARLIST_CLASS(Float64Array, float64_array); | 1112 REGISTER_SCALARLIST_CLASS(Float64Array, float64_array); |
| 1116 REGISTER_SCALARLIST_CLASS(ExternalInt8Array, external_int8_array); | 1113 REGISTER_SCALARLIST_CLASS(ExternalInt8Array, external_int8_array); |
| 1117 REGISTER_SCALARLIST_CLASS(ExternalUint8Array, external_uint8_array); | 1114 REGISTER_SCALARLIST_CLASS(ExternalUint8Array, external_uint8_array); |
| 1118 REGISTER_SCALARLIST_CLASS(ExternalUint8ClampedArray, | 1115 REGISTER_SCALARLIST_CLASS(ExternalUint8ClampedArray, |
| 1119 external_uint8_clamped_array); | 1116 external_uint8_clamped_array); |
| 1120 REGISTER_SCALARLIST_CLASS(ExternalInt16Array, external_int16_array); | 1117 REGISTER_SCALARLIST_CLASS(ExternalInt16Array, external_int16_array); |
| 1121 REGISTER_SCALARLIST_CLASS(ExternalUint16Array, external_uint16_array); | 1118 REGISTER_SCALARLIST_CLASS(ExternalUint16Array, external_uint16_array); |
| 1122 REGISTER_SCALARLIST_CLASS(ExternalInt32Array, external_int32_array); | 1119 REGISTER_SCALARLIST_CLASS(ExternalInt32Array, external_int32_array); |
| 1123 REGISTER_SCALARLIST_CLASS(ExternalUint32Array, external_uint32_array); | 1120 REGISTER_SCALARLIST_CLASS(ExternalUint32Array, external_uint32_array); |
| 1124 REGISTER_SCALARLIST_CLASS(ExternalInt64Array, external_int64_array); | 1121 REGISTER_SCALARLIST_CLASS(ExternalInt64Array, external_int64_array); |
| 1125 REGISTER_SCALARLIST_CLASS(ExternalUint64Array, external_uint64_array); | 1122 REGISTER_SCALARLIST_CLASS(ExternalUint64Array, external_uint64_array); |
| 1126 REGISTER_SCALARLIST_CLASS(ExternalFloat32x4Array, external_float32x4_array); | |
| 1127 REGISTER_SCALARLIST_CLASS(ExternalFloat32Array, external_float32_array); | 1123 REGISTER_SCALARLIST_CLASS(ExternalFloat32Array, external_float32_array); |
| 1128 REGISTER_SCALARLIST_CLASS(ExternalFloat64Array, external_float64_array); | 1124 REGISTER_SCALARLIST_CLASS(ExternalFloat64Array, external_float64_array); |
| 1129 #undef REGISTER_SCALARLIST_CLASS | 1125 #undef REGISTER_SCALARLIST_CLASS |
| 1130 | 1126 |
| 1131 #define REGISTER_TYPED_DATA_CLASS(clazz) \ | 1127 #define REGISTER_TYPED_DATA_CLASS(clazz) \ |
| 1132 cls = Class::NewTypedDataClass(kTypedData##clazz##Cid); | 1128 cls = Class::NewTypedDataClass(kTypedData##clazz##Cid); |
| 1133 CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS); | 1129 CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_CLASS); |
| 1134 #undef REGISTER_TYPED_DATA_CLASS | 1130 #undef REGISTER_TYPED_DATA_CLASS |
| 1135 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \ | 1131 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \ |
| 1136 cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid); | 1132 cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid); |
| 1137 CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS); | 1133 CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS); |
| 1138 cls = Class::NewTypedDataViewClass(kByteDataViewCid); | 1134 cls = Class::NewTypedDataViewClass(kByteDataViewCid); |
| 1139 #undef REGISTER_TYPED_DATA_VIEW_CLASS | 1135 #undef REGISTER_TYPED_DATA_VIEW_CLASS |
| 1140 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \ | 1136 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \ |
| 1141 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid); | 1137 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid); |
| 1142 CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); | 1138 CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); |
| 1143 #undef REGISTER_EXT_TYPED_DATA_CLASS | 1139 #undef REGISTER_EXT_TYPED_DATA_CLASS |
| 1140 // Add Float32x4 and Uint32x4 to the object store. |
| 1141 cls = Class::New<Float32x4>(); |
| 1142 object_store->set_float32x4_class(cls); |
| 1143 cls = Class::New<Uint32x4>(); |
| 1144 object_store->set_uint32x4_class(cls); |
| 1144 | 1145 |
| 1145 cls = Class::New<Integer>(); | 1146 cls = Class::New<Integer>(); |
| 1146 object_store->set_integer_implementation_class(cls); | 1147 object_store->set_integer_implementation_class(cls); |
| 1147 | 1148 |
| 1148 cls = Class::New<Smi>(); | 1149 cls = Class::New<Smi>(); |
| 1149 object_store->set_smi_class(cls); | 1150 object_store->set_smi_class(cls); |
| 1150 | 1151 |
| 1151 cls = Class::New<Mint>(); | 1152 cls = Class::New<Mint>(); |
| 1152 object_store->set_mint_class(cls); | 1153 object_store->set_mint_class(cls); |
| 1153 | 1154 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 return Symbols::Int32List().raw(); | 1363 return Symbols::Int32List().raw(); |
| 1363 case kUint32ArrayCid: | 1364 case kUint32ArrayCid: |
| 1364 case kExternalUint32ArrayCid: | 1365 case kExternalUint32ArrayCid: |
| 1365 return Symbols::Uint32List().raw(); | 1366 return Symbols::Uint32List().raw(); |
| 1366 case kInt64ArrayCid: | 1367 case kInt64ArrayCid: |
| 1367 case kExternalInt64ArrayCid: | 1368 case kExternalInt64ArrayCid: |
| 1368 return Symbols::Int64List().raw(); | 1369 return Symbols::Int64List().raw(); |
| 1369 case kUint64ArrayCid: | 1370 case kUint64ArrayCid: |
| 1370 case kExternalUint64ArrayCid: | 1371 case kExternalUint64ArrayCid: |
| 1371 return Symbols::Uint64List().raw(); | 1372 return Symbols::Uint64List().raw(); |
| 1372 case kFloat32x4ArrayCid: | |
| 1373 case kExternalFloat32x4ArrayCid: | |
| 1374 return Symbols::Float32x4List().raw(); | |
| 1375 case kFloat32ArrayCid: | 1373 case kFloat32ArrayCid: |
| 1376 case kExternalFloat32ArrayCid: | 1374 case kExternalFloat32ArrayCid: |
| 1377 return Symbols::Float32List().raw(); | 1375 return Symbols::Float32List().raw(); |
| 1378 case kFloat64ArrayCid: | 1376 case kFloat64ArrayCid: |
| 1379 case kExternalFloat64ArrayCid: | 1377 case kExternalFloat64ArrayCid: |
| 1380 return Symbols::Float64List().raw(); | 1378 return Symbols::Float64List().raw(); |
| 1381 default: | 1379 default: |
| 1382 if (!IsSignatureClass()) { | 1380 if (!IsSignatureClass()) { |
| 1383 const String& name = String::Handle(Name()); | 1381 const String& name = String::Handle(Name()); |
| 1384 return IdentifierPrettyName(name); | 1382 return IdentifierPrettyName(name); |
| (...skipping 11663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13048 Class::null()); | 13046 Class::null()); |
| 13049 return NewImpl<Uint64Array, RawUint64Array>(kClassId, data, len, space); | 13047 return NewImpl<Uint64Array, RawUint64Array>(kClassId, data, len, space); |
| 13050 } | 13048 } |
| 13051 | 13049 |
| 13052 | 13050 |
| 13053 const char* Uint64Array::ToCString() const { | 13051 const char* Uint64Array::ToCString() const { |
| 13054 return "_Uint64Array"; | 13052 return "_Uint64Array"; |
| 13055 } | 13053 } |
| 13056 | 13054 |
| 13057 | 13055 |
| 13058 RawFloat32x4Array* Float32x4Array::New(intptr_t len, | |
| 13059 Heap::Space space) { | |
| 13060 ASSERT(Isolate::Current()->object_store()->float32x4_array_class() != | |
| 13061 Class::null()); | |
| 13062 return NewImpl<Float32x4Array, RawFloat32x4Array>(kClassId, len, | |
| 13063 space); | |
| 13064 } | |
| 13065 | |
| 13066 | |
| 13067 RawFloat32x4Array* Float32x4Array::New(const simd128_value_t* data, | |
| 13068 intptr_t len, | |
| 13069 Heap::Space space) { | |
| 13070 ASSERT(Isolate::Current()->object_store()->float32_array_class() != | |
| 13071 Class::null()); | |
| 13072 return NewImpl<Float32x4Array, RawFloat32x4Array>(kClassId, data, | |
| 13073 len, space); | |
| 13074 } | |
| 13075 | |
| 13076 | |
| 13077 const char* Float32x4Array::ToCString() const { | |
| 13078 return "_Float32x4Array"; | |
| 13079 } | |
| 13080 | |
| 13081 | |
| 13082 RawFloat32Array* Float32Array::New(intptr_t len, Heap::Space space) { | 13056 RawFloat32Array* Float32Array::New(intptr_t len, Heap::Space space) { |
| 13083 ASSERT(Isolate::Current()->object_store()->float32_array_class() != | 13057 ASSERT(Isolate::Current()->object_store()->float32_array_class() != |
| 13084 Class::null()); | 13058 Class::null()); |
| 13085 return NewImpl<Float32Array, RawFloat32Array>(kClassId, len, space); | 13059 return NewImpl<Float32Array, RawFloat32Array>(kClassId, len, space); |
| 13086 } | 13060 } |
| 13087 | 13061 |
| 13088 | 13062 |
| 13089 RawFloat32Array* Float32Array::New(const float* data, | 13063 RawFloat32Array* Float32Array::New(const float* data, |
| 13090 intptr_t len, | 13064 intptr_t len, |
| 13091 Heap::Space space) { | 13065 Heap::Space space) { |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13252 return NewExternalImpl<ExternalUint64Array, | 13226 return NewExternalImpl<ExternalUint64Array, |
| 13253 RawExternalUint64Array>(kClassId, data, len, space); | 13227 RawExternalUint64Array>(kClassId, data, len, space); |
| 13254 } | 13228 } |
| 13255 | 13229 |
| 13256 | 13230 |
| 13257 const char* ExternalUint64Array::ToCString() const { | 13231 const char* ExternalUint64Array::ToCString() const { |
| 13258 return "_ExternalUint64Array"; | 13232 return "_ExternalUint64Array"; |
| 13259 } | 13233 } |
| 13260 | 13234 |
| 13261 | 13235 |
| 13262 RawExternalFloat32x4Array* ExternalFloat32x4Array::New(simd128_value_t* data, | |
| 13263 intptr_t len, | |
| 13264 Heap::Space space) { | |
| 13265 RawClass* cls = | |
| 13266 Isolate::Current()->object_store()->external_float32x4_array_class(); | |
| 13267 ASSERT(cls != Class::null()); | |
| 13268 return NewExternalImpl<ExternalFloat32x4Array, | |
| 13269 RawExternalFloat32x4Array>(kClassId, data, len, | |
| 13270 space); | |
| 13271 } | |
| 13272 | |
| 13273 | |
| 13274 const char* ExternalFloat32x4Array::ToCString() const { | |
| 13275 return "_ExternalFloat32x4Array"; | |
| 13276 } | |
| 13277 | |
| 13278 | |
| 13279 RawExternalFloat32Array* ExternalFloat32Array::New(float* data, | 13236 RawExternalFloat32Array* ExternalFloat32Array::New(float* data, |
| 13280 intptr_t len, | 13237 intptr_t len, |
| 13281 Heap::Space space) { | 13238 Heap::Space space) { |
| 13282 ASSERT(Isolate::Current()->object_store()->external_float32_array_class() != | 13239 ASSERT(Isolate::Current()->object_store()->external_float32_array_class() != |
| 13283 Class::null()); | 13240 Class::null()); |
| 13284 return NewExternalImpl<ExternalFloat32Array, | 13241 return NewExternalImpl<ExternalFloat32Array, |
| 13285 RawExternalFloat32Array>(kClassId, data, len, space); | 13242 RawExternalFloat32Array>(kClassId, data, len, space); |
| 13286 } | 13243 } |
| 13287 | 13244 |
| 13288 | 13245 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13690 } | 13647 } |
| 13691 return result.raw(); | 13648 return result.raw(); |
| 13692 } | 13649 } |
| 13693 | 13650 |
| 13694 | 13651 |
| 13695 const char* WeakProperty::ToCString() const { | 13652 const char* WeakProperty::ToCString() const { |
| 13696 return "_WeakProperty"; | 13653 return "_WeakProperty"; |
| 13697 } | 13654 } |
| 13698 | 13655 |
| 13699 } // namespace dart | 13656 } // namespace dart |
| OLD | NEW |