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

Unified Diff: runtime/vm/raw_object.cc

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/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.cc
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 04378e71a9bef9fdda6a42bda2119b5fb7c44436..67f0afc13733f31483bd1737916cfa10678c363d 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -115,6 +115,13 @@ intptr_t RawObject::SizeFromClass() const {
instance_size = Array::InstanceSize(array_length);
break;
}
+ case kObjectPoolCid: {
+ const RawObjectPool* raw_object_pool =
+ reinterpret_cast<const RawObjectPool*>(this);
+ intptr_t len = raw_object_pool->ptr()->length_;
+ instance_size = ObjectPool::InstanceSize(len);
+ break;
+ }
#define SIZE_FROM_CLASS(clazz) \
case kTypedData##clazz##Cid:
CLASS_LIST_TYPED_DATA(SIZE_FROM_CLASS) {
@@ -523,6 +530,24 @@ intptr_t RawCode::VisitCodePointers(RawCode* raw_obj,
}
+intptr_t RawObjectPool::VisitObjectPoolPointers(
+ RawObjectPool* raw_obj, ObjectPointerVisitor* visitor) {
+ visitor->VisitPointer(
+ reinterpret_cast<RawObject**>(&raw_obj->ptr()->info_array_));
+ const intptr_t len = raw_obj->ptr()->length_;
+ RawTypedData* info_array = raw_obj->ptr()->info_array_->ptr();
+ Entry* first = raw_obj->first_entry();
+ for (intptr_t i = 0; i < len; ++i) {
+ ObjectPool::EntryType entry_type =
+ static_cast<ObjectPool::EntryType>(info_array->data()[i]);
+ if (entry_type == ObjectPool::kTaggedObject) {
+ visitor->VisitPointer(&(first + i)->raw_obj_);
+ }
+ }
+ return ObjectPool::InstanceSize(raw_obj->ptr()->length_);
+}
+
+
intptr_t RawInstructions::VisitInstructionsPointers(
RawInstructions* raw_obj, ObjectPointerVisitor* visitor) {
RawInstructions* obj = raw_obj->ptr();
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698