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

Unified Diff: src/ic.cc

Issue 12296026: ES6 symbols: Implement Symbol intrinsic and basic functionality (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed more comments Created 7 years, 10 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/ic-inl.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 728b053b45b149b28dfc7e5d6a2da11b2c2d4f80..2aa411327426a6296aabb1613b4a841448bb4091 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -179,8 +179,8 @@ static bool TryRemoveInvalidPrototypeDependentStub(Code* target,
// The stub was generated for JSObject but called for non-JSObject.
// IC::GetCodeCacheHolder is not applicable.
return false;
- } else if (cache_holder == PROTOTYPE_MAP &&
- receiver->GetPrototype()->IsNull()) {
+ } else if (cache_holder == DELEGATE_MAP &&
+ receiver->GetDelegate()->IsNull()) {
// IC::GetCodeCacheHolder is not applicable.
return false;
}
@@ -2371,6 +2371,7 @@ const char* CompareIC::GetStateName(State state) {
case KNOWN_OBJECTS: return "KNOWN_OBJECTS";
case INTERNALIZED_STRING: return "INTERNALIZED_STRING";
case STRING: return "STRING";
+ case UNIQUE_NAME: return "UNIQUE_NAME";
case GENERIC: return "GENERIC";
default:
UNREACHABLE();
@@ -2387,6 +2388,7 @@ static CompareIC::State InputState(CompareIC::State old_state,
if (value->IsHeapNumber()) return CompareIC::HEAP_NUMBER;
if (value->IsInternalizedString()) return CompareIC::INTERNALIZED_STRING;
if (value->IsString()) return CompareIC::STRING;
+ if (value->IsSymbol()) return CompareIC::UNIQUE_NAME;
if (value->IsJSObject()) return CompareIC::OBJECT;
break;
case CompareIC::SMI:
@@ -2399,10 +2401,13 @@ static CompareIC::State InputState(CompareIC::State old_state,
case CompareIC::INTERNALIZED_STRING:
if (value->IsInternalizedString()) return CompareIC::INTERNALIZED_STRING;
if (value->IsString()) return CompareIC::STRING;
+ if (value->IsSymbol()) return CompareIC::UNIQUE_NAME;
break;
case CompareIC::STRING:
- if (value->IsInternalizedString() || value->IsString())
- return CompareIC::STRING;
+ if (value->IsString()) return CompareIC::STRING;
+ break;
+ case CompareIC::UNIQUE_NAME:
+ if (value->IsUniqueName()) return CompareIC::UNIQUE_NAME;
break;
case CompareIC::OBJECT:
if (value->IsJSObject()) return CompareIC::OBJECT;
@@ -2442,10 +2447,10 @@ CompareIC::State CompareIC::TargetState(State old_state,
}
if (x->IsString() && y->IsString()) return STRING;
if (!Token::IsEqualityOp(op_)) return GENERIC;
+ if (x->IsUniqueName() && y->IsUniqueName()) return UNIQUE_NAME;
if (x->IsJSObject() && y->IsJSObject()) {
if (Handle<JSObject>::cast(x)->map() ==
- Handle<JSObject>::cast(y)->map() &&
- Token::IsEqualityOp(op_)) {
+ Handle<JSObject>::cast(y)->map()) {
return KNOWN_OBJECTS;
} else {
return OBJECT;
@@ -2453,16 +2458,20 @@ CompareIC::State CompareIC::TargetState(State old_state,
}
return GENERIC;
case SMI:
- return x->IsNumber() && y->IsNumber()
- ? HEAP_NUMBER
- : GENERIC;
+ return x->IsNumber() && y->IsNumber() ? HEAP_NUMBER : GENERIC;
case INTERNALIZED_STRING:
ASSERT(Token::IsEqualityOp(op_));
- return x->IsString() && y->IsString() ? STRING : GENERIC;
+ if (x->IsString() && y->IsString()) return STRING;
+ if (x->IsUniqueName() && y->IsUniqueName()) return UNIQUE_NAME;
+ return GENERIC;
case HEAP_NUMBER:
+ // If the failure was due to one side changing from smi to heap number,
+ // then keep the state (if other changed at the same time, we will get
+ // a second miss and then go to generic).
if (old_left == SMI && x->IsHeapNumber()) return HEAP_NUMBER;
if (old_right == SMI && y->IsHeapNumber()) return HEAP_NUMBER;
case STRING:
+ case UNIQUE_NAME:
case OBJECT:
case KNOWN_OBJECTS:
case GENERIC:
« no previous file with comments | « src/ic.h ('k') | src/ic-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698