Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index 11efb72bb66874b90c7215a940995b0ae3b6c87c..6a9cd99b5e20ff82d30689f97e8a7056d4af99bd 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -376,18 +376,23 @@ void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, |
Register dst, |
Register src, |
Handle<JSObject> holder, |
- int index) { |
- // Adjust for the number of properties stored in the holder. |
- index -= holder->map()->inobject_properties(); |
- if (index < 0) { |
- // Get the property straight out of the holder. |
- int offset = holder->map()->instance_size() + (index * kPointerSize); |
+ PropertyIndex index) { |
+ if (index.IsHeaderIndex()) { |
+ int offset = index.HeaderIndex() * kPointerSize; |
__ mov(dst, FieldOperand(src, offset)); |
} else { |
- // Calculate the offset into the properties array. |
- int offset = index * kPointerSize + FixedArray::kHeaderSize; |
- __ mov(dst, FieldOperand(src, JSObject::kPropertiesOffset)); |
- __ mov(dst, FieldOperand(dst, offset)); |
+ // Adjust for the number of properties stored in the holder. |
+ int slot = index.FieldIndex() - holder->map()->inobject_properties(); |
+ if (slot < 0) { |
+ // Get the property straight out of the holder. |
+ int offset = holder->map()->instance_size() + (slot * kPointerSize); |
+ __ mov(dst, FieldOperand(src, offset)); |
+ } else { |
+ // Calculate the offset into the properties array. |
+ int offset = slot * kPointerSize + FixedArray::kHeaderSize; |
+ __ mov(dst, FieldOperand(src, JSObject::kPropertiesOffset)); |
+ __ mov(dst, FieldOperand(dst, offset)); |
+ } |
} |
} |
@@ -1036,7 +1041,7 @@ void StubCompiler::GenerateLoadField(Handle<JSObject> object, |
Register scratch1, |
Register scratch2, |
Register scratch3, |
- int index, |
+ PropertyIndex index, |
Handle<String> name, |
Label* miss) { |
// Check that the receiver isn't a smi. |
@@ -1423,7 +1428,7 @@ void CallStubCompiler::GenerateMissBranch() { |
Handle<Code> CallStubCompiler::CompileCallField(Handle<JSObject> object, |
Handle<JSObject> holder, |
- int index, |
+ PropertyIndex index, |
Handle<String> name) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
@@ -2956,7 +2961,7 @@ Handle<Code> LoadStubCompiler::CompileLoadNonexistent(Handle<String> name, |
Handle<Code> LoadStubCompiler::CompileLoadField(Handle<JSObject> object, |
Handle<JSObject> holder, |
- int index, |
+ PropertyIndex index, |
Handle<String> name) { |
// ----------- S t a t e ------------- |
// -- ecx : name |
@@ -3156,7 +3161,7 @@ Handle<Code> LoadStubCompiler::CompileLoadGlobal( |
Handle<Code> KeyedLoadStubCompiler::CompileLoadField(Handle<String> name, |
Handle<JSObject> receiver, |
Handle<JSObject> holder, |
- int index) { |
+ PropertyIndex index) { |
// ----------- S t a t e ------------- |
// -- ecx : key |
// -- edx : receiver |