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

Unified Diff: runtime/vm/object.h

Issue 1301963003: VM: Clean up and fix bugs in instructions patterns (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: s/Pattern::InstructionLength/Pattern::pattern_length_in_bytes/g Created 5 years, 4 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
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:

Powered by Google App Engine
This is Rietveld 408576698