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

Unified Diff: runtime/vm/raw_object.h

Issue 1175523002: Object pool with support for untagged entries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 349ad591e30cc73ac2bb7b5209ce0db66c02d8c0..f4b80b336f162ba78d1223c7868d99e744fec58d 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -31,6 +31,7 @@ namespace dart {
V(Namespace) \
V(Code) \
V(Instructions) \
+ V(ObjectPool) \
V(PcDescriptors) \
V(Stackmap) \
V(LocalVarDescriptors) \
@@ -1002,6 +1003,27 @@ class RawCode : public RawObject {
};
+class RawObjectPool : public RawObject {
+ RAW_HEAP_OBJECT_IMPLEMENTATION(ObjectPool);
+
+ intptr_t length_;
+ RawTypedData* info_array_;
+
+ struct Entry {
+ union {
+ RawObject* raw_obj_;
+ uword raw_value_;
+ };
+ };
+ Entry* data() { OPEN_ARRAY_START(Entry, Entry); }
+ Entry const* data() const { OPEN_ARRAY_START(Entry, Entry); }
+
+ Entry* first_entry() { return &ptr()->data()[0]; }
+
+ friend class Object;
+};
+
+
class RawInstructions : public RawObject {
RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions);
@@ -1009,7 +1031,7 @@ class RawInstructions : public RawObject {
return reinterpret_cast<RawObject**>(&ptr()->code_);
}
RawCode* code_;
- RawArray* object_pool_;
+ RawObjectPool* object_pool_;
RawObject** to() {
return reinterpret_cast<RawObject**>(&ptr()->object_pool_);
}
@@ -1780,6 +1802,8 @@ class RawTypedData : public RawInstance {
friend class Object;
friend class Instance;
friend class SnapshotReader;
+ friend class ObjectPool;
+ friend class RawObjectPool;
};
@@ -2112,6 +2136,7 @@ inline bool RawObject::IsVariableSizeClassId(intptr_t index) {
(index == kContextCid) ||
(index == kTypeArgumentsCid) ||
(index == kInstructionsCid) ||
+ (index == kObjectPoolCid) ||
(index == kPcDescriptorsCid) ||
(index == kStackmapCid) ||
(index == kLocalVarDescriptorsCid) ||
« 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