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

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

Issue 27226003: Do not hide membership of implementation classes in dart:core. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 static bool IsNumberClassId(intptr_t index); 393 static bool IsNumberClassId(intptr_t index);
394 static bool IsIntegerClassId(intptr_t index); 394 static bool IsIntegerClassId(intptr_t index);
395 static bool IsStringClassId(intptr_t index); 395 static bool IsStringClassId(intptr_t index);
396 static bool IsOneByteStringClassId(intptr_t index); 396 static bool IsOneByteStringClassId(intptr_t index);
397 static bool IsTwoByteStringClassId(intptr_t index); 397 static bool IsTwoByteStringClassId(intptr_t index);
398 static bool IsExternalStringClassId(intptr_t index); 398 static bool IsExternalStringClassId(intptr_t index);
399 static bool IsBuiltinListClassId(intptr_t index); 399 static bool IsBuiltinListClassId(intptr_t index);
400 static bool IsTypedDataClassId(intptr_t index); 400 static bool IsTypedDataClassId(intptr_t index);
401 static bool IsTypedDataViewClassId(intptr_t index); 401 static bool IsTypedDataViewClassId(intptr_t index);
402 static bool IsExternalTypedDataClassId(intptr_t index); 402 static bool IsExternalTypedDataClassId(intptr_t index);
403 static bool IsImplementationClassId(intptr_t index);
404 static bool IsInternalVMdefinedClassId(intptr_t index); 403 static bool IsInternalVMdefinedClassId(intptr_t index);
405 404
406 static intptr_t NumberOfTypedDataClasses(); 405 static intptr_t NumberOfTypedDataClasses();
407 406
408 private: 407 private:
409 uword tags_; // Various object tags (bits). 408 uword tags_; // Various object tags (bits).
410 409
411 class WatchedBit : public BitField<bool, kWatchedBit, 1> {}; 410 class WatchedBit : public BitField<bool, kWatchedBit, 1> {};
412 411
413 class MarkBit : public BitField<bool, kMarkBit, 1> {}; 412 class MarkBit : public BitField<bool, kMarkBit, 1> {};
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1694 (kExternalTypedDataFloat64ArrayCid == 1693 (kExternalTypedDataFloat64ArrayCid ==
1695 kExternalTypedDataInt8ArrayCid + 10) && 1694 kExternalTypedDataInt8ArrayCid + 10) &&
1696 (kExternalTypedDataFloat32x4ArrayCid == 1695 (kExternalTypedDataFloat32x4ArrayCid ==
1697 kExternalTypedDataInt8ArrayCid + 11) && 1696 kExternalTypedDataInt8ArrayCid + 11) &&
1698 (kNullCid == kExternalTypedDataInt8ArrayCid + 12)); 1697 (kNullCid == kExternalTypedDataInt8ArrayCid + 12));
1699 return (index >= kExternalTypedDataInt8ArrayCid && 1698 return (index >= kExternalTypedDataInt8ArrayCid &&
1700 index <= kExternalTypedDataFloat32x4ArrayCid); 1699 index <= kExternalTypedDataFloat32x4ArrayCid);
1701 } 1700 }
1702 1701
1703 1702
1704 inline bool RawObject::IsImplementationClassId(intptr_t index) {
1705 return IsBuiltinListClassId(index) ||
1706 IsStringClassId(index) ||
1707 IsNumberClassId(index);
1708 }
1709
1710
1711 inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) { 1703 inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) {
1712 return ((index < kNumPredefinedCids) && 1704 return ((index < kNumPredefinedCids) &&
1713 !RawObject::IsTypedDataViewClassId(index)); 1705 !RawObject::IsTypedDataViewClassId(index));
1714 } 1706 }
1715 1707
1716 1708
1717 inline intptr_t RawObject::NumberOfTypedDataClasses() { 1709 inline intptr_t RawObject::NumberOfTypedDataClasses() {
1718 // Make sure this is updated when new TypedData types are added. 1710 // Make sure this is updated when new TypedData types are added.
1719 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); 1711 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12);
1720 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); 1712 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13);
1721 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); 1713 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12);
1722 return (kNullCid - kTypedDataInt8ArrayCid); 1714 return (kNullCid - kTypedDataInt8ArrayCid);
1723 } 1715 }
1724 1716
1725 } // namespace dart 1717 } // namespace dart
1726 1718
1727 #endif // VM_RAW_OBJECT_H_ 1719 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698