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

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

Issue 735723003: Implement enum types in VM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
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_OBJECT_H_ 5 #ifndef VM_OBJECT_H_
6 #define VM_OBJECT_H_ 6 #define VM_OBJECT_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/utils.h" 10 #include "platform/utils.h"
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 bool is_patch() const { 1165 bool is_patch() const {
1166 return PatchBit::decode(raw_ptr()->state_bits_); 1166 return PatchBit::decode(raw_ptr()->state_bits_);
1167 } 1167 }
1168 void set_is_patch() const; 1168 void set_is_patch() const;
1169 1169
1170 bool is_synthesized_class() const { 1170 bool is_synthesized_class() const {
1171 return SynthesizedClassBit::decode(raw_ptr()->state_bits_); 1171 return SynthesizedClassBit::decode(raw_ptr()->state_bits_);
1172 } 1172 }
1173 void set_is_synthesized_class() const; 1173 void set_is_synthesized_class() const;
1174 1174
1175 bool is_enum_class() const {
1176 return EnumBit::decode(raw_ptr()->state_bits_);
1177 }
1178 void set_is_enum_class() const;
1179
1175 bool is_finalized() const { 1180 bool is_finalized() const {
1176 return ClassFinalizedBits::decode(raw_ptr()->state_bits_) 1181 return ClassFinalizedBits::decode(raw_ptr()->state_bits_)
1177 == RawClass::kFinalized; 1182 == RawClass::kFinalized;
1178 } 1183 }
1179 void set_is_finalized() const; 1184 void set_is_finalized() const;
1180 1185
1181 bool is_prefinalized() const { 1186 bool is_prefinalized() const {
1182 return ClassFinalizedBits::decode(raw_ptr()->state_bits_) 1187 return ClassFinalizedBits::decode(raw_ptr()->state_bits_)
1183 == RawClass::kPreFinalized; 1188 == RawClass::kPreFinalized;
1184 } 1189 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 kClassFinalizedPos = 3, 1327 kClassFinalizedPos = 3,
1323 kClassFinalizedSize = 2, 1328 kClassFinalizedSize = 2,
1324 kAbstractBit = kClassFinalizedPos + kClassFinalizedSize, // = 5 1329 kAbstractBit = kClassFinalizedPos + kClassFinalizedSize, // = 5
1325 kPatchBit = 6, 1330 kPatchBit = 6,
1326 kSynthesizedClassBit = 7, 1331 kSynthesizedClassBit = 7,
1327 kMarkedForParsingBit = 8, 1332 kMarkedForParsingBit = 8,
1328 kMixinAppAliasBit = 9, 1333 kMixinAppAliasBit = 9,
1329 kMixinTypeAppliedBit = 10, 1334 kMixinTypeAppliedBit = 10,
1330 kFieldsMarkedNullableBit = 11, 1335 kFieldsMarkedNullableBit = 11,
1331 kCycleFreeBit = 12, 1336 kCycleFreeBit = 12,
1337 kEnumBit = 13,
1332 }; 1338 };
1333 class ConstBit : public BitField<bool, kConstBit, 1> {}; 1339 class ConstBit : public BitField<bool, kConstBit, 1> {};
1334 class ImplementedBit : public BitField<bool, kImplementedBit, 1> {}; 1340 class ImplementedBit : public BitField<bool, kImplementedBit, 1> {};
1335 class TypeFinalizedBit : public BitField<bool, kTypeFinalizedBit, 1> {}; 1341 class TypeFinalizedBit : public BitField<bool, kTypeFinalizedBit, 1> {};
1336 class ClassFinalizedBits : public BitField<RawClass::ClassFinalizedState, 1342 class ClassFinalizedBits : public BitField<RawClass::ClassFinalizedState,
1337 kClassFinalizedPos, kClassFinalizedSize> {}; // NOLINT 1343 kClassFinalizedPos, kClassFinalizedSize> {}; // NOLINT
1338 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; 1344 class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
1339 class PatchBit : public BitField<bool, kPatchBit, 1> {}; 1345 class PatchBit : public BitField<bool, kPatchBit, 1> {};
1340 class SynthesizedClassBit : public BitField<bool, kSynthesizedClassBit, 1> {}; 1346 class SynthesizedClassBit : public BitField<bool, kSynthesizedClassBit, 1> {};
1341 class MarkedForParsingBit : public BitField<bool, kMarkedForParsingBit, 1> {}; 1347 class MarkedForParsingBit : public BitField<bool, kMarkedForParsingBit, 1> {};
1342 class MixinAppAliasBit : public BitField<bool, kMixinAppAliasBit, 1> {}; 1348 class MixinAppAliasBit : public BitField<bool, kMixinAppAliasBit, 1> {};
1343 class MixinTypeAppliedBit : public BitField<bool, kMixinTypeAppliedBit, 1> {}; 1349 class MixinTypeAppliedBit : public BitField<bool, kMixinTypeAppliedBit, 1> {};
1344 class FieldsMarkedNullableBit : public BitField<bool, 1350 class FieldsMarkedNullableBit : public BitField<bool,
1345 kFieldsMarkedNullableBit, 1> {}; // NOLINT 1351 kFieldsMarkedNullableBit, 1> {}; // NOLINT
1346 class CycleFreeBit : public BitField<bool, kCycleFreeBit, 1> {}; 1352 class CycleFreeBit : public BitField<bool, kCycleFreeBit, 1> {};
1353 class EnumBit : public BitField<bool, kEnumBit, 1> {};
1347 1354
1348 void set_name(const String& value) const; 1355 void set_name(const String& value) const;
1349 void set_pretty_name(const String& value) const; 1356 void set_pretty_name(const String& value) const;
1350 void set_user_name(const String& value) const; 1357 void set_user_name(const String& value) const;
1351 RawString* GeneratePrettyName() const; 1358 RawString* GeneratePrettyName() const;
1352 RawString* GenerateUserVisibleName() const; 1359 RawString* GenerateUserVisibleName() const;
1353 void set_signature_function(const Function& value) const; 1360 void set_signature_function(const Function& value) const;
1354 void set_signature_type(const AbstractType& value) const; 1361 void set_signature_type(const AbstractType& value) const;
1355 void set_state_bits(intptr_t bits) const; 1362 void set_state_bits(intptr_t bits) const;
1356 1363
(...skipping 6175 matching lines...) Expand 10 before | Expand all | Expand 10 after
7532 7539
7533 7540
7534 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 7541 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
7535 intptr_t index) { 7542 intptr_t index) {
7536 return array.At((index * kEntryLength) + kTargetFunctionIndex); 7543 return array.At((index * kEntryLength) + kTargetFunctionIndex);
7537 } 7544 }
7538 7545
7539 } // namespace dart 7546 } // namespace dart
7540 7547
7541 #endif // VM_OBJECT_H_ 7548 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698