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

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
« no previous file with comments | « runtime/lib/mirrors_patch.dart ('k') | tests/lib/lib.status » ('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 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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 (kExternalTypedDataFloat64ArrayCid == 1695 (kExternalTypedDataFloat64ArrayCid ==
1697 kExternalTypedDataInt8ArrayCid + 10) && 1696 kExternalTypedDataInt8ArrayCid + 10) &&
1698 (kExternalTypedDataFloat32x4ArrayCid == 1697 (kExternalTypedDataFloat32x4ArrayCid ==
1699 kExternalTypedDataInt8ArrayCid + 11) && 1698 kExternalTypedDataInt8ArrayCid + 11) &&
1700 (kNullCid == kExternalTypedDataInt8ArrayCid + 12)); 1699 (kNullCid == kExternalTypedDataInt8ArrayCid + 12));
1701 return (index >= kExternalTypedDataInt8ArrayCid && 1700 return (index >= kExternalTypedDataInt8ArrayCid &&
1702 index <= kExternalTypedDataFloat32x4ArrayCid); 1701 index <= kExternalTypedDataFloat32x4ArrayCid);
1703 } 1702 }
1704 1703
1705 1704
1706 inline bool RawObject::IsImplementationClassId(intptr_t index) {
1707 return IsBuiltinListClassId(index) ||
1708 IsStringClassId(index) ||
1709 IsNumberClassId(index);
1710 }
1711
1712
1713 inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) { 1705 inline bool RawObject::IsInternalVMdefinedClassId(intptr_t index) {
1714 return ((index < kNumPredefinedCids) && 1706 return ((index < kNumPredefinedCids) &&
1715 !RawObject::IsTypedDataViewClassId(index)); 1707 !RawObject::IsTypedDataViewClassId(index));
1716 } 1708 }
1717 1709
1718 1710
1719 inline intptr_t RawObject::NumberOfTypedDataClasses() { 1711 inline intptr_t RawObject::NumberOfTypedDataClasses() {
1720 // Make sure this is updated when new TypedData types are added. 1712 // Make sure this is updated when new TypedData types are added.
1721 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12); 1713 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 12);
1722 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13); 1714 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 13);
1723 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12); 1715 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 12);
1724 return (kNullCid - kTypedDataInt8ArrayCid); 1716 return (kNullCid - kTypedDataInt8ArrayCid);
1725 } 1717 }
1726 1718
1727 } // namespace dart 1719 } // namespace dart
1728 1720
1729 #endif // VM_RAW_OBJECT_H_ 1721 #endif // VM_RAW_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_patch.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698