Chromium Code Reviews| Index: src/objects-inl.h |
| diff --git a/src/objects-inl.h b/src/objects-inl.h |
| index 01073ca7b08bd272520e1b1009d266a671411e7e..21a4bde2fd8238212574340dc1048fde89787416 100644 |
| --- a/src/objects-inl.h |
| +++ b/src/objects-inl.h |
| @@ -1313,6 +1313,12 @@ int JSObject::GetInternalFieldCount() { |
| } |
| +int JSObject::GetInternalFieldOffset(int index) { |
| + ASSERT(index < GetInternalFieldCount() && index >= 0); |
| + return 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 +1342,13 @@ 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. |
| +int JSObject::GetFastPropertyOffset(int index) { |
|
Vitaly Repeshko
2011/03/18 12:16:36
This should be called "GetInObjectPropertyOffset".
mnaganov (inactive)
2011/03/18 12:31:01
Done.
|
| + // Adjust for the number of properties stored in the object. |
| + index -= map()->inobject_properties(); |
| + return index < 0 ? map()->instance_size() + (index * kPointerSize) : -1; |
| +} |
| + |
| + |
| Object* JSObject::FastPropertyAt(int index) { |
| // Adjust for the number of properties stored in the object. |
| index -= map()->inobject_properties(); |