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

Unified Diff: runtime/vm/raw_object.h

Issue 2889723005: Revert "More compact string representation on 64 bit." (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.h
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 488739cfbf2f115848aa9a7b095500405043f7be..95288b1e1407513aceb2514fe2abea4016cd6c76 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -266,11 +266,21 @@ class RawObject {
kVMHeapObjectBit = 2,
kRememberedBit = 3,
kReservedTagPos = 4, // kReservedBit{100K,1M,10M}
+#if defined(ARCH_IS_32_BIT)
kReservedTagSize = 4,
kSizeTagPos = kReservedTagPos + kReservedTagSize, // = 8
kSizeTagSize = 8,
kClassIdTagPos = kSizeTagPos + kSizeTagSize, // = 16
kClassIdTagSize = 16,
+#elif defined(ARCH_IS_64_BIT)
+ kReservedTagSize = 12,
+ kSizeTagPos = kReservedTagPos + kReservedTagSize, // = 16
+ kSizeTagSize = 16,
+ kClassIdTagPos = kSizeTagPos + kSizeTagSize, // = 32
+ kClassIdTagSize = 32,
+#else
+#error Unexpected architecture word size
+#endif
};
COMPILE_ASSERT(kClassIdTagSize == (sizeof(classid_t) * kBitsPerByte));
@@ -604,7 +614,6 @@ class RawObject {
friend class RawExternalTypedData;
friend class RawInstructions;
friend class RawInstance;
- friend class RawString;
friend class RawTypedData;
friend class Scavenger;
friend class ScavengerVisitor;
@@ -1854,20 +1863,10 @@ class RawString : public RawInstance {
protected:
RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
RawSmi* length_;
-#if !defined(HASH_IN_OBJECT_HEADER)
RawSmi* hash_;
RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); }
-#else
- RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); }
-#endif
- private:
friend class Library;
- friend class OneByteStringSerializationCluster;
- friend class TwoByteStringSerializationCluster;
- friend class OneByteStringDeserializationCluster;
- friend class TwoByteStringDeserializationCluster;
- friend class RODataSerializationCluster;
};
@@ -2454,7 +2453,6 @@ inline intptr_t RawObject::NumberOfTypedDataClasses() {
return (kNullCid - kTypedDataInt8ArrayCid);
}
-
} // namespace dart
#endif // RUNTIME_VM_RAW_OBJECT_H_
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698