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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 typed_data_classes.SetAt(index, cls); | 1217 typed_data_classes.SetAt(index, cls); |
1218 RegisterPrivateClass(cls, Symbols::_ByteDataView(), lib); | 1218 RegisterPrivateClass(cls, Symbols::_ByteDataView(), lib); |
1219 pending_classes.Add(cls); | 1219 pending_classes.Add(cls); |
1220 #undef REGISTER_TYPED_DATA_VIEW_CLASS | 1220 #undef REGISTER_TYPED_DATA_VIEW_CLASS |
1221 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \ | 1221 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \ |
1222 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid); \ | 1222 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid); \ |
1223 index = kExternalTypedData##clazz##Cid - kTypedDataInt8ArrayCid; \ | 1223 index = kExternalTypedData##clazz##Cid - kTypedDataInt8ArrayCid; \ |
1224 typed_data_classes.SetAt(index, cls); \ | 1224 typed_data_classes.SetAt(index, cls); \ |
1225 RegisterPrivateClass(cls, Symbols::_External##clazz(), lib); \ | 1225 RegisterPrivateClass(cls, Symbols::_External##clazz(), lib); \ |
1226 | 1226 |
| 1227 cls = Class::New<Instance>(kByteBufferCid); |
| 1228 cls.set_instance_size(0); |
| 1229 cls.set_next_field_offset(-kWordSize); |
| 1230 index = kByteBufferCid - kTypedDataInt8ArrayCid; |
| 1231 typed_data_classes.SetAt(index, cls); |
| 1232 RegisterPrivateClass(cls, Symbols::_ByteBuffer(), lib); |
| 1233 pending_classes.Add(cls); |
| 1234 |
1227 CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); | 1235 CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); |
1228 #undef REGISTER_EXT_TYPED_DATA_CLASS | 1236 #undef REGISTER_EXT_TYPED_DATA_CLASS |
1229 // Register Float32x4 and Int32x4 in the object store. | 1237 // Register Float32x4 and Int32x4 in the object store. |
1230 cls = Class::New<Float32x4>(); | 1238 cls = Class::New<Float32x4>(); |
1231 object_store->set_float32x4_class(cls); | 1239 object_store->set_float32x4_class(cls); |
1232 RegisterPrivateClass(cls, Symbols::_Float32x4(), lib); | 1240 RegisterPrivateClass(cls, Symbols::_Float32x4(), lib); |
1233 cls = Class::New<Int32x4>(); | 1241 cls = Class::New<Int32x4>(); |
1234 object_store->set_int32x4_class(cls); | 1242 object_store->set_int32x4_class(cls); |
1235 RegisterPrivateClass(cls, Symbols::_Int32x4(), lib); | 1243 RegisterPrivateClass(cls, Symbols::_Int32x4(), lib); |
1236 cls = Class::New<Float64x2>(); | 1244 cls = Class::New<Float64x2>(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \ | 1449 #define REGISTER_TYPED_DATA_VIEW_CLASS(clazz) \ |
1442 cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid); | 1450 cls = Class::NewTypedDataViewClass(kTypedData##clazz##ViewCid); |
1443 CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS); | 1451 CLASS_LIST_TYPED_DATA(REGISTER_TYPED_DATA_VIEW_CLASS); |
1444 cls = Class::NewTypedDataViewClass(kByteDataViewCid); | 1452 cls = Class::NewTypedDataViewClass(kByteDataViewCid); |
1445 #undef REGISTER_TYPED_DATA_VIEW_CLASS | 1453 #undef REGISTER_TYPED_DATA_VIEW_CLASS |
1446 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \ | 1454 #define REGISTER_EXT_TYPED_DATA_CLASS(clazz) \ |
1447 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid); | 1455 cls = Class::NewExternalTypedDataClass(kExternalTypedData##clazz##Cid); |
1448 CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); | 1456 CLASS_LIST_TYPED_DATA(REGISTER_EXT_TYPED_DATA_CLASS); |
1449 #undef REGISTER_EXT_TYPED_DATA_CLASS | 1457 #undef REGISTER_EXT_TYPED_DATA_CLASS |
1450 | 1458 |
| 1459 cls = Class::New<Instance>(kByteBufferCid); |
| 1460 |
1451 cls = Class::New<Integer>(); | 1461 cls = Class::New<Integer>(); |
1452 object_store->set_integer_implementation_class(cls); | 1462 object_store->set_integer_implementation_class(cls); |
1453 | 1463 |
1454 cls = Class::New<Smi>(); | 1464 cls = Class::New<Smi>(); |
1455 object_store->set_smi_class(cls); | 1465 object_store->set_smi_class(cls); |
1456 | 1466 |
1457 cls = Class::New<Mint>(); | 1467 cls = Class::New<Mint>(); |
1458 object_store->set_mint_class(cls); | 1468 object_store->set_mint_class(cls); |
1459 | 1469 |
1460 cls = Class::New<Double>(); | 1470 cls = Class::New<Double>(); |
(...skipping 17704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19165 return tag_label.ToCString(); | 19175 return tag_label.ToCString(); |
19166 } | 19176 } |
19167 | 19177 |
19168 | 19178 |
19169 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19179 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19170 Instance::PrintJSONImpl(stream, ref); | 19180 Instance::PrintJSONImpl(stream, ref); |
19171 } | 19181 } |
19172 | 19182 |
19173 | 19183 |
19174 } // namespace dart | 19184 } // namespace dart |
OLD | NEW |