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

Unified Diff: src/ic.cc

Issue 329463005: Revert 21720: "Introduce FieldIndex to unify and abstract property/field offset" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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
« no previous file with comments | « src/ic.h ('k') | src/json-parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « src/ic.h ('k') | src/json-parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698