Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: runtime/vm/raw_object.h

Issue 12907010: Fix some of teh scalarlist tests to use the TypedData VM class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 class RawTypedData : public RawInstance { 1433 class RawTypedData : public RawInstance {
1434 RAW_HEAP_OBJECT_IMPLEMENTATION(TypedData); 1434 RAW_HEAP_OBJECT_IMPLEMENTATION(TypedData);
1435 1435
1436 protected: 1436 protected:
1437 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } 1437 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
1438 RawSmi* length_; 1438 RawSmi* length_;
1439 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } 1439 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
1440 1440
1441 // Variable length data follows here. 1441 // Variable length data follows here.
1442 uint8_t data_[0]; 1442 uint8_t data_[0];
1443
1444 friend class Object;
1443 }; 1445 };
1444 1446
1445 1447
1446 class RawExternalTypedData : public RawInstance { 1448 class RawExternalTypedData : public RawInstance {
1447 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTypedData); 1449 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTypedData);
1448 1450
1449 protected: 1451 protected:
1450 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } 1452 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
1451 RawSmi* length_; 1453 RawSmi* length_;
1452 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } 1454 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
(...skipping 11 matching lines...) Expand all
1464 RawSmi* length_; 1466 RawSmi* length_;
1465 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } 1467 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
1466 }; 1468 };
1467 1469
1468 1470
1469 class RawInt8Array : public RawByteArray { 1471 class RawInt8Array : public RawByteArray {
1470 RAW_HEAP_OBJECT_IMPLEMENTATION(Int8Array); 1472 RAW_HEAP_OBJECT_IMPLEMENTATION(Int8Array);
1471 1473
1472 // Variable length data follows here. 1474 // Variable length data follows here.
1473 int8_t data_[0]; 1475 int8_t data_[0];
1474
1475 friend class Object;
1476 }; 1476 };
1477 1477
1478 1478
1479 class RawUint8Array : public RawByteArray { 1479 class RawUint8Array : public RawByteArray {
1480 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint8Array); 1480 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint8Array);
1481 1481
1482 // Variable length data follows here. 1482 // Variable length data follows here.
1483 uint8_t data_[0]; 1483 uint8_t data_[0];
1484 }; 1484 };
1485 1485
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 // Make sure this is updated when new TypedData types are added. 1938 // Make sure this is updated when new TypedData types are added.
1939 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 11); 1939 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 11);
1940 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 12); 1940 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 12);
1941 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11); 1941 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11);
1942 return (kNullCid - kTypedDataInt8ArrayCid); 1942 return (kNullCid - kTypedDataInt8ArrayCid);
1943 } 1943 }
1944 1944
1945 } // namespace dart 1945 } // namespace dart
1946 1946
1947 #endif // VM_RAW_OBJECT_H_ 1947 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698