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

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

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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 | « dart/runtime/vm/parser.cc ('k') | dart/runtime/vm/raw_object.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 V(Double) \ 61 V(Double) \
62 V(Bool) \ 62 V(Bool) \
63 V(GrowableObjectArray) \ 63 V(GrowableObjectArray) \
64 V(TypedData) \ 64 V(TypedData) \
65 V(ExternalTypedData) \ 65 V(ExternalTypedData) \
66 V(Stacktrace) \ 66 V(Stacktrace) \
67 V(JSRegExp) \ 67 V(JSRegExp) \
68 V(WeakProperty) \ 68 V(WeakProperty) \
69 V(MirrorReference) \ 69 V(MirrorReference) \
70 V(Float32x4) \ 70 V(Float32x4) \
71 V(Uint32x4) \ 71 V(Int32x4) \
72 72
73 #define CLASS_LIST_ARRAYS(V) \ 73 #define CLASS_LIST_ARRAYS(V) \
74 V(Array) \ 74 V(Array) \
75 V(ImmutableArray) \ 75 V(ImmutableArray) \
76 76
77 #define CLASS_LIST_STRINGS(V) \ 77 #define CLASS_LIST_STRINGS(V) \
78 V(String) \ 78 V(String) \
79 V(OneByteString) \ 79 V(OneByteString) \
80 V(TwoByteString) \ 80 V(TwoByteString) \
81 V(ExternalOneByteString) \ 81 V(ExternalOneByteString) \
82 V(ExternalTwoByteString) 82 V(ExternalTwoByteString)
83 83
84 #define CLASS_LIST_TYPED_DATA(V) \ 84 #define CLASS_LIST_TYPED_DATA(V) \
85 V(Int8Array) \ 85 V(Int8Array) \
86 V(Uint8Array) \ 86 V(Uint8Array) \
87 V(Uint8ClampedArray) \ 87 V(Uint8ClampedArray) \
88 V(Int16Array) \ 88 V(Int16Array) \
89 V(Uint16Array) \ 89 V(Uint16Array) \
90 V(Int32Array) \ 90 V(Int32Array) \
91 V(Uint32Array) \ 91 V(Uint32Array) \
92 V(Int64Array) \ 92 V(Int64Array) \
93 V(Uint64Array) \ 93 V(Uint64Array) \
94 V(Float32Array) \ 94 V(Float32Array) \
95 V(Float64Array) \ 95 V(Float64Array) \
96 V(Float32x4Array) \ 96 V(Float32x4Array) \
97 V(Uint32x4Array) \ 97 V(Int32x4Array) \
98 98
99 #define CLASS_LIST_FOR_HANDLES(V) \ 99 #define CLASS_LIST_FOR_HANDLES(V) \
100 CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \ 100 CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \
101 V(Array) \ 101 V(Array) \
102 V(String) 102 V(String)
103 103
104 #define CLASS_LIST_NO_OBJECT(V) \ 104 #define CLASS_LIST_NO_OBJECT(V) \
105 CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \ 105 CLASS_LIST_NO_OBJECT_NOR_STRING_NOR_ARRAY(V) \
106 CLASS_LIST_ARRAYS(V) \ 106 CLASS_LIST_ARRAYS(V) \
107 CLASS_LIST_STRINGS(V) 107 CLASS_LIST_STRINGS(V)
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 1405
1406 friend class SnapshotReader; 1406 friend class SnapshotReader;
1407 public: 1407 public:
1408 float x() const { return value_[0]; } 1408 float x() const { return value_[0]; }
1409 float y() const { return value_[1]; } 1409 float y() const { return value_[1]; }
1410 float z() const { return value_[2]; } 1410 float z() const { return value_[2]; }
1411 float w() const { return value_[3]; } 1411 float w() const { return value_[3]; }
1412 }; 1412 };
1413 1413
1414 1414
1415 class RawUint32x4 : public RawInstance { 1415 class RawInt32x4 : public RawInstance {
1416 RAW_HEAP_OBJECT_IMPLEMENTATION(Uint32x4); 1416 RAW_HEAP_OBJECT_IMPLEMENTATION(Int32x4);
1417 1417
1418 uint32_t value_[4]; 1418 int32_t value_[4];
1419 1419
1420 friend class SnapshotReader; 1420 friend class SnapshotReader;
1421 public: 1421 public:
1422 uint32_t x() const { return value_[0]; } 1422 int32_t x() const { return value_[0]; }
1423 uint32_t y() const { return value_[1]; } 1423 int32_t y() const { return value_[1]; }
1424 uint32_t z() const { return value_[2]; } 1424 int32_t z() const { return value_[2]; }
1425 uint32_t w() const { return value_[3]; } 1425 int32_t w() const { return value_[3]; }
1426 }; 1426 };
1427 1427
1428 1428
1429 // Define an aliases for intptr_t. 1429 // Define an aliases for intptr_t.
1430 #if defined(ARCH_IS_32_BIT) 1430 #if defined(ARCH_IS_32_BIT)
1431 #define kIntPtrCid kTypedDataInt32ArrayCid 1431 #define kIntPtrCid kTypedDataInt32ArrayCid
1432 #define SetIntPtr SetInt32 1432 #define SetIntPtr SetInt32
1433 #elif defined(ARCH_IS_64_BIT) 1433 #elif defined(ARCH_IS_64_BIT)
1434 #define kIntPtrCid kTypedDataInt64ArrayCid 1434 #define kIntPtrCid kTypedDataInt64ArrayCid
1435 #define SetIntPtr SetInt64 1435 #define SetIntPtr SetInt64
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 kTypedDataUint8ClampedArrayCid == kTypedDataInt8ArrayCid + 2 && 1643 kTypedDataUint8ClampedArrayCid == kTypedDataInt8ArrayCid + 2 &&
1644 kTypedDataInt16ArrayCid == kTypedDataInt8ArrayCid + 3 && 1644 kTypedDataInt16ArrayCid == kTypedDataInt8ArrayCid + 3 &&
1645 kTypedDataUint16ArrayCid == kTypedDataInt8ArrayCid + 4 && 1645 kTypedDataUint16ArrayCid == kTypedDataInt8ArrayCid + 4 &&
1646 kTypedDataInt32ArrayCid == kTypedDataInt8ArrayCid + 5 && 1646 kTypedDataInt32ArrayCid == kTypedDataInt8ArrayCid + 5 &&
1647 kTypedDataUint32ArrayCid == kTypedDataInt8ArrayCid + 6 && 1647 kTypedDataUint32ArrayCid == kTypedDataInt8ArrayCid + 6 &&
1648 kTypedDataInt64ArrayCid == kTypedDataInt8ArrayCid + 7 && 1648 kTypedDataInt64ArrayCid == kTypedDataInt8ArrayCid + 7 &&
1649 kTypedDataUint64ArrayCid == kTypedDataInt8ArrayCid + 8 && 1649 kTypedDataUint64ArrayCid == kTypedDataInt8ArrayCid + 8 &&
1650 kTypedDataFloat32ArrayCid == kTypedDataInt8ArrayCid + 9 && 1650 kTypedDataFloat32ArrayCid == kTypedDataInt8ArrayCid + 9 &&
1651 kTypedDataFloat64ArrayCid == kTypedDataInt8ArrayCid + 10 && 1651 kTypedDataFloat64ArrayCid == kTypedDataInt8ArrayCid + 10 &&
1652 kTypedDataFloat32x4ArrayCid == kTypedDataInt8ArrayCid + 11 && 1652 kTypedDataFloat32x4ArrayCid == kTypedDataInt8ArrayCid + 11 &&
1653 kTypedDataUint32x4ArrayCid == kTypedDataInt8ArrayCid + 12 && 1653 kTypedDataInt32x4ArrayCid == kTypedDataInt8ArrayCid + 12 &&
1654 kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13); 1654 kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13);
1655 return (index >= kTypedDataInt8ArrayCid && 1655 return (index >= kTypedDataInt8ArrayCid &&
1656 index <= kTypedDataUint32x4ArrayCid); 1656 index <= kTypedDataInt32x4ArrayCid);
1657 } 1657 }
1658 1658
1659 1659
1660 inline bool RawObject::IsTypedDataViewClassId(intptr_t index) { 1660 inline bool RawObject::IsTypedDataViewClassId(intptr_t index) {
1661 // Make sure this is updated when new TypedData types are added. 1661 // Make sure this is updated when new TypedData types are added.
1662 ASSERT(kTypedDataUint8ArrayViewCid == kTypedDataInt8ArrayViewCid + 1 && 1662 ASSERT(kTypedDataUint8ArrayViewCid == kTypedDataInt8ArrayViewCid + 1 &&
1663 kTypedDataUint8ClampedArrayViewCid == kTypedDataInt8ArrayViewCid + 2 && 1663 kTypedDataUint8ClampedArrayViewCid == kTypedDataInt8ArrayViewCid + 2 &&
1664 kTypedDataInt16ArrayViewCid == kTypedDataInt8ArrayViewCid + 3 && 1664 kTypedDataInt16ArrayViewCid == kTypedDataInt8ArrayViewCid + 3 &&
1665 kTypedDataUint16ArrayViewCid == kTypedDataInt8ArrayViewCid + 4 && 1665 kTypedDataUint16ArrayViewCid == kTypedDataInt8ArrayViewCid + 4 &&
1666 kTypedDataInt32ArrayViewCid == kTypedDataInt8ArrayViewCid + 5 && 1666 kTypedDataInt32ArrayViewCid == kTypedDataInt8ArrayViewCid + 5 &&
1667 kTypedDataUint32ArrayViewCid == kTypedDataInt8ArrayViewCid + 6 && 1667 kTypedDataUint32ArrayViewCid == kTypedDataInt8ArrayViewCid + 6 &&
1668 kTypedDataInt64ArrayViewCid == kTypedDataInt8ArrayViewCid + 7 && 1668 kTypedDataInt64ArrayViewCid == kTypedDataInt8ArrayViewCid + 7 &&
1669 kTypedDataUint64ArrayViewCid == kTypedDataInt8ArrayViewCid + 8 && 1669 kTypedDataUint64ArrayViewCid == kTypedDataInt8ArrayViewCid + 8 &&
1670 kTypedDataFloat32ArrayViewCid == kTypedDataInt8ArrayViewCid + 9 && 1670 kTypedDataFloat32ArrayViewCid == kTypedDataInt8ArrayViewCid + 9 &&
1671 kTypedDataFloat64ArrayViewCid == kTypedDataInt8ArrayViewCid + 10 && 1671 kTypedDataFloat64ArrayViewCid == kTypedDataInt8ArrayViewCid + 10 &&
1672 kTypedDataFloat32x4ArrayViewCid == kTypedDataInt8ArrayViewCid + 11 && 1672 kTypedDataFloat32x4ArrayViewCid == kTypedDataInt8ArrayViewCid + 11 &&
1673 kTypedDataUint32x4ArrayViewCid == kTypedDataInt8ArrayViewCid + 12 && 1673 kTypedDataInt32x4ArrayViewCid == kTypedDataInt8ArrayViewCid + 12 &&
1674 kByteDataViewCid == kTypedDataInt8ArrayViewCid + 13 && 1674 kByteDataViewCid == kTypedDataInt8ArrayViewCid + 13 &&
1675 kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14); 1675 kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14);
1676 return (index >= kTypedDataInt8ArrayViewCid && 1676 return (index >= kTypedDataInt8ArrayViewCid &&
1677 index <= kByteDataViewCid); 1677 index <= kByteDataViewCid);
1678 } 1678 }
1679 1679
1680 1680
1681 inline bool RawObject::IsExternalTypedDataClassId(intptr_t index) { 1681 inline bool RawObject::IsExternalTypedDataClassId(intptr_t index) {
1682 // Make sure this is updated when new ExternalTypedData types are added. 1682 // Make sure this is updated when new ExternalTypedData types are added.
1683 ASSERT((kExternalTypedDataUint8ArrayCid == 1683 ASSERT((kExternalTypedDataUint8ArrayCid ==
(...skipping 11 matching lines...) Expand all
1695 (kExternalTypedDataInt64ArrayCid == 1695 (kExternalTypedDataInt64ArrayCid ==
1696 kExternalTypedDataInt8ArrayCid + 7) && 1696 kExternalTypedDataInt8ArrayCid + 7) &&
1697 (kExternalTypedDataUint64ArrayCid == 1697 (kExternalTypedDataUint64ArrayCid ==
1698 kExternalTypedDataInt8ArrayCid + 8) && 1698 kExternalTypedDataInt8ArrayCid + 8) &&
1699 (kExternalTypedDataFloat32ArrayCid == 1699 (kExternalTypedDataFloat32ArrayCid ==
1700 kExternalTypedDataInt8ArrayCid + 9) && 1700 kExternalTypedDataInt8ArrayCid + 9) &&
1701 (kExternalTypedDataFloat64ArrayCid == 1701 (kExternalTypedDataFloat64ArrayCid ==
1702 kExternalTypedDataInt8ArrayCid + 10) && 1702 kExternalTypedDataInt8ArrayCid + 10) &&
1703 (kExternalTypedDataFloat32x4ArrayCid == 1703 (kExternalTypedDataFloat32x4ArrayCid ==
1704 kExternalTypedDataInt8ArrayCid + 11) && 1704 kExternalTypedDataInt8ArrayCid + 11) &&
1705 (kExternalTypedDataUint32x4ArrayCid == 1705 (kExternalTypedDataInt32x4ArrayCid ==
1706 kExternalTypedDataInt8ArrayCid + 12) && 1706 kExternalTypedDataInt8ArrayCid + 12) &&
1707 (kNullCid == kExternalTypedDataInt8ArrayCid + 13)); 1707 (kNullCid == kExternalTypedDataInt8ArrayCid + 13));
1708 return (index >= kExternalTypedDataInt8ArrayCid && 1708 return (index >= kExternalTypedDataInt8ArrayCid &&
1709 index <= kExternalTypedDataUint32x4ArrayCid); 1709 index <= kExternalTypedDataInt32x4ArrayCid);
1710 } 1710 }
1711 1711
1712 1712
1713 inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) { 1713 inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) {
1714 return ((index < kNumPredefinedCids) && 1714 return ((index < kNumPredefinedCids) &&
1715 !RawObject::IsTypedDataViewClassId(index)); 1715 !RawObject::IsTypedDataViewClassId(index));
1716 } 1716 }
1717 1717
1718 1718
1719 inline intptr_t RawObject::NumberOfTypedDataClasses() { 1719 inline intptr_t RawObject::NumberOfTypedDataClasses() {
1720 // Make sure this is updated when new TypedData types are added. 1720 // Make sure this is updated when new TypedData types are added.
1721 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13); 1721 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13);
1722 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14); 1722 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14);
1723 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 13); 1723 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 13);
1724 return (kNullCid - kTypedDataInt8ArrayCid); 1724 return (kNullCid - kTypedDataInt8ArrayCid);
1725 } 1725 }
1726 1726
1727 } // namespace dart 1727 } // namespace dart
1728 1728
1729 #endif // VM_RAW_OBJECT_H_ 1729 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « dart/runtime/vm/parser.cc ('k') | dart/runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698