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

Unified Diff: src/ic/ic-state.cc

Issue 1502963002: [ic] Change CompareIC to handle JSReceiver instead of JSObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/ic-state.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-state.cc
diff --git a/src/ic/ic-state.cc b/src/ic/ic-state.cc
index 911f538e3cee63fd853b05fdf4fa2454e76b832d..4bdaf3ff03608c9654dbb61e199b5222c1365460 100644
--- a/src/ic/ic-state.cc
+++ b/src/ic/ic-state.cc
@@ -356,10 +356,10 @@ const char* CompareICState::GetStateName(State state) {
return "STRING";
case UNIQUE_NAME:
return "UNIQUE_NAME";
- case OBJECT:
- return "OBJECT";
- case KNOWN_OBJECT:
- return "KNOWN_OBJECT";
+ case RECEIVER:
+ return "RECEIVER";
+ case KNOWN_RECEIVER:
+ return "KNOWN_RECEIVER";
case GENERIC:
return "GENERIC";
}
@@ -384,9 +384,9 @@ Type* CompareICState::StateToType(Zone* zone, State state, Handle<Map> map) {
return Type::InternalizedString(zone);
case UNIQUE_NAME:
return Type::UniqueName(zone);
- case OBJECT:
+ case RECEIVER:
return Type::Receiver(zone);
- case KNOWN_OBJECT:
+ case KNOWN_RECEIVER:
return map.is_null() ? Type::Receiver(zone) : Type::Class(map, zone);
case GENERIC:
return Type::Any(zone);
@@ -406,7 +406,7 @@ CompareICState::State CompareICState::NewInputState(State old_state,
if (value->IsInternalizedString()) return INTERNALIZED_STRING;
if (value->IsString()) return STRING;
if (value->IsSymbol()) return UNIQUE_NAME;
- if (value->IsJSObject()) return OBJECT;
+ if (value->IsJSReceiver()) return RECEIVER;
break;
case BOOLEAN:
if (value->IsBoolean()) return BOOLEAN;
@@ -429,12 +429,12 @@ CompareICState::State CompareICState::NewInputState(State old_state,
case UNIQUE_NAME:
if (value->IsUniqueName()) return UNIQUE_NAME;
break;
- case OBJECT:
- if (value->IsJSObject()) return OBJECT;
+ case RECEIVER:
+ if (value->IsJSReceiver()) return RECEIVER;
break;
case GENERIC:
break;
- case KNOWN_OBJECT:
+ case KNOWN_RECEIVER:
UNREACHABLE();
break;
}
@@ -465,12 +465,12 @@ CompareICState::State CompareICState::TargetState(
return Token::IsEqualityOp(op) ? INTERNALIZED_STRING : STRING;
}
if (x->IsString() && y->IsString()) return STRING;
- if (x->IsJSObject() && y->IsJSObject()) {
- if (Handle<JSObject>::cast(x)->map() ==
- Handle<JSObject>::cast(y)->map()) {
- return KNOWN_OBJECT;
+ if (x->IsJSReceiver() && y->IsJSReceiver()) {
+ if (Handle<JSReceiver>::cast(x)->map() ==
+ Handle<JSReceiver>::cast(y)->map()) {
+ return KNOWN_RECEIVER;
} else {
- return Token::IsEqualityOp(op) ? OBJECT : GENERIC;
+ return Token::IsEqualityOp(op) ? RECEIVER : GENERIC;
}
}
if (!Token::IsEqualityOp(op)) return GENERIC;
@@ -490,15 +490,15 @@ CompareICState::State CompareICState::TargetState(
if (old_left == SMI && x->IsHeapNumber()) return NUMBER;
if (old_right == SMI && y->IsHeapNumber()) return NUMBER;
return GENERIC;
- case KNOWN_OBJECT:
- if (x->IsJSObject() && y->IsJSObject()) {
- return Token::IsEqualityOp(op) ? OBJECT : GENERIC;
+ case KNOWN_RECEIVER:
+ if (x->IsJSReceiver() && y->IsJSReceiver()) {
+ return Token::IsEqualityOp(op) ? RECEIVER : GENERIC;
}
return GENERIC;
case BOOLEAN:
case STRING:
case UNIQUE_NAME:
- case OBJECT:
+ case RECEIVER:
case GENERIC:
return GENERIC;
}
« no previous file with comments | « src/ic/ic-state.h ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698