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

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

Issue 26565006: Rearrange bits in the bitfields to get better compaction, this reduces (Closed) Base URL: http://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 | « no previous file | runtime/vm/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_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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 enum { 1026 enum {
1027 kAny = 0, 1027 kAny = 0,
1028 kStatic, 1028 kStatic,
1029 kInstance, 1029 kInstance,
1030 kConstructor, 1030 kConstructor,
1031 kFactory, 1031 kFactory,
1032 }; 1032 };
1033 enum { 1033 enum {
1034 kConstBit = 0, 1034 kConstBit = 0,
1035 kImplementedBit = 1, 1035 kImplementedBit = 1,
1036 kAbstractBit = 2, 1036 kTypeFinalizedBit = 2,
1037 kPatchBit = 3, 1037 kClassFinalizedBits = 3,
1038 kSynthesizedClassBit = 4,
1039 kTypeFinalizedBit = 5,
1040 kClassFinalizedBits = 6,
1041 kClassFinalizedSize = 2, 1038 kClassFinalizedSize = 2,
1039 kAbstractBit = 5,
1040 kPatchBit = 6,
1041 kSynthesizedClassBit = 7,
1042 kMarkedForParsingBit = 8, 1042 kMarkedForParsingBit = 8,
1043 kMixinTypedefBit = 9, 1043 kMixinTypedefBit = 9,
1044 kMixinTypeAppliedBit = 10, 1044 kMixinTypeAppliedBit = 10,
1045 }; 1045 };
1046 class ConstBit : public BitField<bool, kConstBit, 1> {}; 1046 class ConstBit : public BitField<bool, kConstBit, 1> {};
1047 class ImplementedBit : public BitField<bool, kImplementedBit, 1> {}; 1047 class ImplementedBit : public BitField<bool, kImplementedBit, 1> {};
1048 class TypeFinalizedBit : public BitField<bool, kTypeFinalizedBit, 1> {};
1049 class ClassFinalizedBits : public BitField<RawClass::ClassFinalizedState,
1050 kClassFinalizedBits, kClassFinalizedSize> {}; // NOLINT
1048 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; 1051 class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
1049 class PatchBit : public BitField<bool, kPatchBit, 1> {}; 1052 class PatchBit : public BitField<bool, kPatchBit, 1> {};
1050 class SynthesizedClassBit : public BitField<bool, kSynthesizedClassBit, 1> {}; 1053 class SynthesizedClassBit : public BitField<bool, kSynthesizedClassBit, 1> {};
1051 class TypeFinalizedBit : public BitField<bool, kTypeFinalizedBit, 1> {};
1052 class ClassFinalizedBits : public BitField<RawClass::ClassFinalizedState,
1053 kClassFinalizedBits, kClassFinalizedSize> {}; // NOLINT
1054 class MarkedForParsingBit : public BitField<bool, kMarkedForParsingBit, 1> {}; 1054 class MarkedForParsingBit : public BitField<bool, kMarkedForParsingBit, 1> {};
1055 class MixinTypedefBit : public BitField<bool, kMixinTypedefBit, 1> {}; 1055 class MixinTypedefBit : public BitField<bool, kMixinTypedefBit, 1> {};
1056 class MixinTypeAppliedBit : public BitField<bool, kMixinTypeAppliedBit, 1> {}; 1056 class MixinTypeAppliedBit : public BitField<bool, kMixinTypeAppliedBit, 1> {};
1057 1057
1058 void set_name(const String& value) const; 1058 void set_name(const String& value) const;
1059 void set_signature_function(const Function& value) const; 1059 void set_signature_function(const Function& value) const;
1060 void set_signature_type(const AbstractType& value) const; 1060 void set_signature_type(const AbstractType& value) const;
1061 void set_state_bits(intptr_t bits) const; 1061 void set_state_bits(intptr_t bits) const;
1062 1062
1063 void set_constants(const Array& value) const; 1063 void set_constants(const Array& value) const;
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 1858
1859 // Return false and report an error if the fingerprint does not match. 1859 // Return false and report an error if the fingerprint does not match.
1860 bool CheckSourceFingerprint(int32_t fp) const; 1860 bool CheckSourceFingerprint(int32_t fp) const;
1861 1861
1862 static const int kCtorPhaseInit = 1 << 0; 1862 static const int kCtorPhaseInit = 1 << 0;
1863 static const int kCtorPhaseBody = 1 << 1; 1863 static const int kCtorPhaseBody = 1 << 1;
1864 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); 1864 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody);
1865 1865
1866 private: 1866 private:
1867 enum KindTagBits { 1867 enum KindTagBits {
1868 kStaticBit = 0, 1868 kKindTagBit = 0,
1869 kConstBit = 1, 1869 kKindTagSize = 4,
1870 kOptimizableBit = 2, 1870 kStaticBit = 4,
1871 kInlinableBit = 3, 1871 kConstBit = 5,
1872 kHasFinallyBit = 4,
1873 kNativeBit = 5,
1874 kAbstractBit = 6, 1872 kAbstractBit = 6,
1875 kExternalBit = 7, 1873 kVisibleBit = 7,
1876 kVisibleBit = 8, 1874 kOptimizableBit = 8,
1877 kIntrinsicBit = 9, 1875 kInlinableBit = 9,
1878 kRecognizedBit = 10, 1876 kIntrinsicBit = 10,
1879 kRedirectingBit = 11, 1877 kRecognizedBit = 11,
1880 kKindTagBit = 12, 1878 kHasFinallyBit = 12,
1881 kKindTagSize = 4, 1879 kNativeBit = 13,
1880 kRedirectingBit = 14,
1881 kExternalBit = 15,
1882 }; 1882 };
1883 class KindBits :
1884 public BitField<RawFunction::Kind, kKindTagBit, kKindTagSize> {}; // NOLINT
1883 class StaticBit : public BitField<bool, kStaticBit, 1> {}; 1885 class StaticBit : public BitField<bool, kStaticBit, 1> {};
1884 class ConstBit : public BitField<bool, kConstBit, 1> {}; 1886 class ConstBit : public BitField<bool, kConstBit, 1> {};
1887 class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
1888 class VisibleBit : public BitField<bool, kVisibleBit, 1> {};
1885 class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {}; 1889 class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {};
1886 class InlinableBit : public BitField<bool, kInlinableBit, 1> {}; 1890 class InlinableBit : public BitField<bool, kInlinableBit, 1> {};
1891 class IntrinsicBit : public BitField<bool, kIntrinsicBit, 1> {};
1892 class RecognizedBit : public BitField<bool, kRecognizedBit, 1> {};
1887 class HasFinallyBit : public BitField<bool, kHasFinallyBit, 1> {}; 1893 class HasFinallyBit : public BitField<bool, kHasFinallyBit, 1> {};
1888 class NativeBit : public BitField<bool, kNativeBit, 1> {}; 1894 class NativeBit : public BitField<bool, kNativeBit, 1> {};
1889 class AbstractBit : public BitField<bool, kAbstractBit, 1> {};
1890 class ExternalBit : public BitField<bool, kExternalBit, 1> {}; 1895 class ExternalBit : public BitField<bool, kExternalBit, 1> {};
1891 class VisibleBit : public BitField<bool, kVisibleBit, 1> {};
1892 class IntrinsicBit : public BitField<bool, kIntrinsicBit, 1> {};
1893 class RecognizedBit : public BitField<bool, kRecognizedBit, 1> {};
1894 class RedirectingBit : public BitField<bool, kRedirectingBit, 1> {}; 1896 class RedirectingBit : public BitField<bool, kRedirectingBit, 1> {};
1895 class KindBits :
1896 public BitField<RawFunction::Kind, kKindTagBit, kKindTagSize> {}; // NOLINT
1897 1897
1898 void set_name(const String& value) const; 1898 void set_name(const String& value) const;
1899 void set_kind(RawFunction::Kind value) const; 1899 void set_kind(RawFunction::Kind value) const;
1900 void set_is_static(bool value) const; 1900 void set_is_static(bool value) const;
1901 void set_is_const(bool value) const; 1901 void set_is_const(bool value) const;
1902 void set_is_external(bool value) const; 1902 void set_is_external(bool value) const;
1903 void set_parent_function(const Function& value) const; 1903 void set_parent_function(const Function& value) const;
1904 void set_owner(const Object& value) const; 1904 void set_owner(const Object& value) const;
1905 RawFunction* implicit_closure_function() const; 1905 RawFunction* implicit_closure_function() const;
1906 void set_implicit_closure_function(const Function& value) const; 1906 void set_implicit_closure_function(const Function& value) const;
(...skipping 4365 matching lines...) Expand 10 before | Expand all | Expand 10 after
6272 6272
6273 6273
6274 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 6274 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
6275 intptr_t index) { 6275 intptr_t index) {
6276 return array.At((index * kEntryLength) + kTargetFunctionIndex); 6276 return array.At((index * kEntryLength) + kTargetFunctionIndex);
6277 } 6277 }
6278 6278
6279 } // namespace dart 6279 } // namespace dart
6280 6280
6281 #endif // VM_OBJECT_H_ 6281 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698