Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 01073ca7b08bd272520e1b1009d266a671411e7e..be57e1ea83afd699e27ae6e0add93acf1860a409 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -861,6 +861,11 @@ MaybeObject* Object::GetProperty(String* key, PropertyAttributes* attributes) { |
(*reinterpret_cast<byte*>(FIELD_ADDR(p, offset)) = value) |
+Address HeapObject::GetFieldAddress(int offset) { |
+ return reinterpret_cast<Address>(RawField(this, offset)); |
+} |
+ |
+ |
Object** HeapObject::RawField(HeapObject* obj, int byte_offset) { |
return &READ_FIELD(obj, byte_offset); |
} |
@@ -1313,6 +1318,13 @@ int JSObject::GetInternalFieldCount() { |
} |
+Address JSObject::GetInternalFieldOffset(int index) { |
+ ASSERT(index < GetInternalFieldCount() && index >= 0); |
+ return reinterpret_cast<Address>( |
+ &READ_FIELD(this, GetHeaderSize() + (kPointerSize * index))); |
+} |
+ |
+ |
Object* JSObject::GetInternalField(int index) { |
ASSERT(index < GetInternalFieldCount() && index >= 0); |
// Internal objects do follow immediately after the header, whereas in-object |
@@ -1336,6 +1348,18 @@ void JSObject::SetInternalField(int index, Object* value) { |
// Access fast-case object properties at index. The use of these routines |
// is needed to correctly distinguish between properties stored in-object and |
// properties stored in the properties array. |
+Address JSObject::GetFastPropertyAddress(int index) { |
+ // Adjust for the number of properties stored in the object. |
+ index -= map()->inobject_properties(); |
+ if (index < 0) { |
+ int offset = map()->instance_size() + (index * kPointerSize); |
+ return reinterpret_cast<Address>(&READ_FIELD(this, offset)); |
+ } else { |
+ return NULL; |
+ } |
+} |
+ |
+ |
Object* JSObject::FastPropertyAt(int index) { |
// Adjust for the number of properties stored in the object. |
index -= map()->inobject_properties(); |