Chromium Code Reviews| 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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1228 RawSmi* length_; | 1228 RawSmi* length_; |
| 1229 RawArray* data_; | 1229 RawArray* data_; |
| 1230 RawObject** to() { | 1230 RawObject** to() { |
| 1231 return reinterpret_cast<RawObject**>(&ptr()->data_); | 1231 return reinterpret_cast<RawObject**>(&ptr()->data_); |
| 1232 } | 1232 } |
| 1233 | 1233 |
| 1234 friend class SnapshotReader; | 1234 friend class SnapshotReader; |
| 1235 }; | 1235 }; |
| 1236 | 1236 |
| 1237 | 1237 |
| 1238 // Define an aliases for intptr_t. | |
| 1239 #if defined(ARCH_IS_32_BIT) | |
| 1240 #define RawIntPtrArray RawInt32Array | |
|
cshapiro
2012/11/12 18:48:45
Feel free to disregard this but... given that this
Ivan Posva
2012/11/12 22:01:03
The external API defines it as intptr_t, which is
| |
| 1241 #define IntPtrArray Int32Array | |
| 1242 #elif defined(ARCH_IS_64_BIT) | |
| 1243 #define RawIntPtrArray RawInt64Array | |
| 1244 #define IntPtrArray Int64Array | |
| 1245 #else | |
| 1246 #error Architecture is not 32-bit or 64-bit. | |
| 1247 #endif // ARCH_IS_32_BIT | |
| 1248 | |
|
cshapiro
2012/11/12 18:48:45
2 spaces?
Ivan Posva
2012/11/12 22:01:03
Done.
| |
| 1238 class RawByteArray : public RawInstance { | 1249 class RawByteArray : public RawInstance { |
| 1239 RAW_HEAP_OBJECT_IMPLEMENTATION(ByteArray); | 1250 RAW_HEAP_OBJECT_IMPLEMENTATION(ByteArray); |
| 1240 | 1251 |
| 1241 protected: | 1252 protected: |
| 1242 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1253 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
| 1243 RawSmi* length_; | 1254 RawSmi* length_; |
| 1244 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1255 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
| 1245 }; | 1256 }; |
| 1246 | 1257 |
| 1247 | 1258 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1614 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && | 1625 kExternalUint64ArrayCid == kExternalInt8ArrayCid + 7 && |
| 1615 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && | 1626 kExternalFloat32ArrayCid == kExternalInt8ArrayCid + 8 && |
| 1616 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && | 1627 kExternalFloat64ArrayCid == kExternalInt8ArrayCid + 9 && |
| 1617 kStacktraceCid == kExternalInt8ArrayCid + 10); | 1628 kStacktraceCid == kExternalInt8ArrayCid + 10); |
| 1618 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); | 1629 return (index >= kExternalInt8ArrayCid && index <= kExternalFloat64ArrayCid); |
| 1619 } | 1630 } |
| 1620 | 1631 |
| 1621 } // namespace dart | 1632 } // namespace dart |
| 1622 | 1633 |
| 1623 #endif // VM_RAW_OBJECT_H_ | 1634 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |