 Chromium Code Reviews
 Chromium Code Reviews Issue 23615012:
  Properly filter types using the initial map from HAllocate.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 23615012:
  Properly filter types using the initial map from HAllocate.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| Index: src/ast.cc | 
| diff --git a/src/ast.cc b/src/ast.cc | 
| index cbadb75c61f3f58527dbcc612ae97fd0b30f4908..6d1dc12054419dc27e14c3f5a13fa90952d5e364 100644 | 
| --- a/src/ast.cc | 
| +++ b/src/ast.cc | 
| @@ -646,8 +646,15 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle, | 
| Literal* key = property->key()->AsLiteral(); | 
| ASSERT(key != NULL && key->value()->IsString()); | 
| Handle<String> name = Handle<String>::cast(key->value()); | 
| + check_type_ = oracle->GetCallCheckType(this); | 
| receiver_types_.Clear(); | 
| - oracle->CallReceiverTypes(this, name, call_kind, &receiver_types_); | 
| + if (check_type_ == RECEIVER_MAP_CHECK) { | 
| + oracle->CallReceiverTypes(this, name, call_kind, &receiver_types_); | 
| + is_monomorphic_ = is_monomorphic_ && receiver_types_.length() > 0; | 
| + } else { | 
| + holder_ = GetPrototypeForPrimitiveCheck(check_type_, oracle->isolate()); | 
| 
Michael Starzinger
2013/09/06 09:34:40
Does it hold that "receiver_types_.IsEmpty()" down
 
Toon Verwaest
2013/09/06 11:24:28
The receiver_types_ are Clear()ed right above, so
 | 
| + receiver_types_.Add(handle(holder_->map()), oracle->zone()); | 
| + } | 
| #ifdef DEBUG | 
| if (FLAG_enable_slow_asserts) { | 
| int length = receiver_types_.length(); | 
| @@ -657,17 +664,8 @@ void Call::RecordTypeFeedback(TypeFeedbackOracle* oracle, | 
| } | 
| } | 
| #endif | 
| - check_type_ = oracle->GetCallCheckType(this); | 
| if (is_monomorphic_) { | 
| - Handle<Map> map; | 
| - if (receiver_types_.length() > 0) { | 
| - ASSERT(check_type_ == RECEIVER_MAP_CHECK); | 
| - map = receiver_types_.at(0); | 
| - } else { | 
| - ASSERT(check_type_ != RECEIVER_MAP_CHECK); | 
| - holder_ = GetPrototypeForPrimitiveCheck(check_type_, oracle->isolate()); | 
| - map = Handle<Map>(holder_->map()); | 
| - } | 
| + Handle<Map> map = receiver_types_.first(); | 
| is_monomorphic_ = ComputeTarget(map, name); | 
| } | 
| } |