Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index 1a6ab41e4fdf076da121eb1dca88950540b2246b..0040b1d352f2ac1a43c92a1f1f55c67dd283a50d 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -838,12 +838,14 @@ Handle<Code> LoadIC::megamorphic_stub() { |
} |
-Handle<Code> LoadIC::SimpleFieldLoad(FieldIndex index) { |
+Handle<Code> LoadIC::SimpleFieldLoad(int offset, |
+ bool inobject, |
+ Representation representation) { |
if (kind() == Code::LOAD_IC) { |
- LoadFieldStub stub(isolate(), index); |
+ LoadFieldStub stub(isolate(), inobject, offset, representation); |
return stub.GetCode(); |
} else { |
- KeyedLoadFieldStub stub(isolate(), index); |
+ KeyedLoadFieldStub stub(isolate(), inobject, offset, representation); |
return stub.GetCode(); |
} |
} |
@@ -922,8 +924,8 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, |
InlineCacheHolderFlag cache_holder) { |
if (object->IsString() && |
String::Equals(isolate()->factory()->length_string(), name)) { |
- FieldIndex index = FieldIndex::ForInObjectOffset(String::kLengthOffset); |
- return SimpleFieldLoad(index); |
+ int length_index = String::kLengthOffset / kPointerSize; |
+ return SimpleFieldLoad(length_index); |
} |
if (object->IsStringWrapper() && |
@@ -943,9 +945,11 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, |
switch (lookup->type()) { |
case FIELD: { |
- FieldIndex field = lookup->GetFieldIndex(); |
+ PropertyIndex field = lookup->GetFieldIndex(); |
if (object.is_identical_to(holder)) { |
- return SimpleFieldLoad(field); |
+ return SimpleFieldLoad(field.translate(holder), |
+ field.is_inobject(holder), |
+ lookup->representation()); |
} |
return compiler.CompileLoadField( |
type, holder, name, field, lookup->representation()); |
@@ -981,15 +985,12 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, |
// Use simple field loads for some well-known callback properties. |
if (object->IsJSObject()) { |
Handle<JSObject> receiver = Handle<JSObject>::cast(object); |
- Handle<Map> map(receiver->map()); |
Handle<HeapType> type = IC::MapToType<HeapType>( |
handle(receiver->map()), isolate()); |
int object_offset; |
if (Accessors::IsJSObjectFieldAccessor<HeapType>( |
type, name, &object_offset)) { |
- FieldIndex index = FieldIndex::ForInObjectOffset( |
- object_offset, receiver->map()); |
- return SimpleFieldLoad(index); |
+ return SimpleFieldLoad(object_offset / kPointerSize); |
} |
} |