| Index: src/ast.cc
|
| diff --git a/src/ast.cc b/src/ast.cc
|
| index a5d1e2df852bca33fd5ed3d2f88c63c57f10a745..bf607d255c15dbeda52c16146d2c97fa30a1fe8b 100644
|
| --- a/src/ast.cc
|
| +++ b/src/ast.cc
|
| @@ -503,19 +503,7 @@ void CountOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle,
|
|
|
|
|
| void CaseClause::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
|
| - TypeInfo info = oracle->SwitchType(this);
|
| - if (info.IsUninitialized()) info = TypeInfo::Unknown();
|
| - if (info.IsSmi()) {
|
| - compare_type_ = SMI_ONLY;
|
| - } else if (info.IsInternalizedString()) {
|
| - compare_type_ = NAME_ONLY;
|
| - } else if (info.IsNonInternalizedString()) {
|
| - compare_type_ = STRING_ONLY;
|
| - } else if (info.IsNonPrimitive()) {
|
| - compare_type_ = OBJECT_ONLY;
|
| - } else {
|
| - ASSERT(compare_type_ == NONE);
|
| - }
|
| + compare_type_ = oracle->ClauseType(CompareId());
|
| }
|
|
|
|
|
| @@ -570,11 +558,11 @@ bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) {
|
| bool Call::ComputeGlobalTarget(Handle<GlobalObject> global,
|
| LookupResult* lookup) {
|
| target_ = Handle<JSFunction>::null();
|
| - cell_ = Handle<JSGlobalPropertyCell>::null();
|
| + cell_ = Handle<Cell>::null();
|
| ASSERT(lookup->IsFound() &&
|
| lookup->type() == NORMAL &&
|
| lookup->holder() == *global);
|
| - cell_ = Handle<JSGlobalPropertyCell>(global->GetPropertyCell(lookup));
|
| + cell_ = Handle<Cell>(global->GetPropertyCell(lookup));
|
| if (cell_->value()->IsJSFunction()) {
|
| Handle<JSFunction> candidate(JSFunction::cast(cell_->value()));
|
| // If the function is in new space we assume it's more likely to
|
| @@ -675,27 +663,22 @@ void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
|
|
|
|
|
| void UnaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
|
| - type_ = oracle->UnaryType(this);
|
| + type_ = oracle->UnaryType(UnaryOperationFeedbackId());
|
| }
|
|
|
|
|
| void BinaryOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
|
| - oracle->BinaryType(this, &left_type_, &right_type_, &result_type_,
|
| + oracle->BinaryType(BinaryOperationFeedbackId(),
|
| + &left_type_, &right_type_, &result_type_,
|
| &has_fixed_right_arg_, &fixed_right_arg_value_);
|
| }
|
|
|
|
|
| +// TODO(rossberg): this function (and all other RecordTypeFeedback functions)
|
| +// should disappear once we use the common type field in the AST consistently.
|
| void CompareOperation::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
|
| - oracle->CompareType(this, &left_type_, &right_type_, &overall_type_);
|
| - if (!overall_type_.IsUninitialized() && overall_type_.IsNonPrimitive() &&
|
| - (op_ == Token::EQ || op_ == Token::EQ_STRICT)) {
|
| - map_ = oracle->GetCompareMap(this);
|
| - } else {
|
| - // May be a compare to nil.
|
| - map_ = oracle->CompareNilMonomorphicReceiverType(this);
|
| - if (op_ != Token::EQ_STRICT)
|
| - compare_nil_types_ = oracle->CompareNilTypes(this);
|
| - }
|
| + oracle->CompareTypes(CompareOperationFeedbackId(),
|
| + &left_type_, &right_type_, &overall_type_, &compare_nil_type_);
|
| }
|
|
|
|
|
| @@ -1072,7 +1055,7 @@ CaseClause::CaseClause(Isolate* isolate,
|
| : label_(label),
|
| statements_(statements),
|
| position_(pos),
|
| - compare_type_(NONE),
|
| + compare_type_(Type::None(), isolate),
|
| compare_id_(AstNode::GetNextId(isolate)),
|
| entry_id_(AstNode::GetNextId(isolate)) {
|
| }
|
|
|