Index: runtime/vm/object.h |
diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
index bdfab97cd5745c957ab6ab8ed107a36b363f1301..8431674cfa11d66865b13632e1ee2b3ff979dfb0 100644 |
--- a/runtime/vm/object.h |
+++ b/runtime/vm/object.h |
@@ -3625,10 +3625,16 @@ class ObjectPool : public Object { |
static RawObjectPool* New(intptr_t len); |
+ // Returns the pool index from the offset relative to a tagged RawObjectPool*, |
+ // adjusting for the tag-bit. |
static intptr_t IndexFromOffset(intptr_t offset) { |
return (offset + kHeapObjectTag - data_offset()) / kBytesPerElement; |
} |
+ static intptr_t OffsetFromIndex(intptr_t index) { |
+ return element_offset(index) - kHeapObjectTag; |
+ } |
+ |
void DebugPrint() const; |
private: |