| 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 #ifndef VM_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
| 6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/token.h" | 10 #include "vm/token.h" |
| (...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array); | 1338 RAW_HEAP_OBJECT_IMPLEMENTATION(Float64Array); |
| 1339 | 1339 |
| 1340 // Variable length data follows here. | 1340 // Variable length data follows here. |
| 1341 double data_[0]; | 1341 double data_[0]; |
| 1342 }; | 1342 }; |
| 1343 | 1343 |
| 1344 | 1344 |
| 1345 template<typename T> | 1345 template<typename T> |
| 1346 class ExternalByteArrayData { | 1346 class ExternalByteArrayData { |
| 1347 public: | 1347 public: |
| 1348 static const int kAlignment = 16; |
| 1349 |
| 1348 ExternalByteArrayData(T* data, | 1350 ExternalByteArrayData(T* data, |
| 1349 void* peer, | 1351 void* peer, |
| 1350 Dart_PeerFinalizer callback) : | 1352 Dart_PeerFinalizer callback) : |
| 1351 data_(data), peer_(peer), callback_(callback) { | 1353 data_(data), peer_(peer), callback_(callback) { |
| 1352 } | 1354 } |
| 1353 ~ExternalByteArrayData() { | 1355 ~ExternalByteArrayData() { |
| 1354 if (callback_ != NULL) (*callback_)(peer_); | 1356 if (callback_ != NULL) (*callback_)(peer_); |
| 1355 } | 1357 } |
| 1356 | 1358 |
| 1357 T* data() { | 1359 T* data() { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && | 1637 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && |
| 1636 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && | 1638 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && |
| 1637 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && | 1639 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && |
| 1638 kStacktraceCid == kExternalInt8ArrayCid + 10); | 1640 kStacktraceCid == kExternalInt8ArrayCid + 10); |
| 1639 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); | 1641 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); |
| 1640 } | 1642 } |
| 1641 | 1643 |
| 1642 } // namespace dart | 1644 } // namespace dart |
| 1643 | 1645 |
| 1644 #endif // VM_RAW_OBJECT_H_ | 1646 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |