| Index: src/type-info.cc
|
| diff --git a/src/type-info.cc b/src/type-info.cc
|
| index c5bdc9bec9dc3f11bf86e878e17fa2589115af90..ae5bf9719dc62524ba6aee564265b281aa57b8a0 100644
|
| --- a/src/type-info.cc
|
| +++ b/src/type-info.cc
|
| @@ -138,6 +138,15 @@ bool TypeFeedbackOracle::LoadIsPolymorphic(Property* expr) {
|
| }
|
|
|
|
|
| +bool TypeFeedbackOracle::StoreIsUninitialized(TypeFeedbackId ast_id) {
|
| + Handle<Object> map_or_code = GetInfo(ast_id);
|
| + if (map_or_code->IsMap()) return false;
|
| + if (!map_or_code->IsCode()) return true;
|
| + Handle<Code> code = Handle<Code>::cast(map_or_code);
|
| + return code->ic_state() == UNINITIALIZED;
|
| +}
|
| +
|
| +
|
| bool TypeFeedbackOracle::StoreIsMonomorphicNormal(TypeFeedbackId ast_id) {
|
| Handle<Object> map_or_code = GetInfo(ast_id);
|
| if (map_or_code->IsMap()) return true;
|
| @@ -247,7 +256,9 @@ KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode(
|
| void TypeFeedbackOracle::LoadReceiverTypes(Property* expr,
|
| Handle<String> name,
|
| SmallMapList* types) {
|
| - Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC);
|
| + Code::Flags flags = Code::ComputeFlags(
|
| + Code::STUB, MONOMORPHIC, Code::kNoExtraICState,
|
| + Code::NORMAL, Code::LOAD_IC);
|
| CollectReceiverTypes(expr->PropertyFeedbackId(), name, flags, types);
|
| }
|
|
|
| @@ -341,13 +352,11 @@ bool TypeFeedbackOracle::LoadIsStub(Property* expr, ICStub* stub) {
|
| }
|
|
|
|
|
| -void TypeFeedbackOracle::CompareTypes(TypeFeedbackId id,
|
| - Handle<Type>* left_type,
|
| - Handle<Type>* right_type,
|
| - Handle<Type>* overall_type,
|
| - Handle<Type>* compare_nil_type) {
|
| - *left_type = *right_type = *overall_type = *compare_nil_type =
|
| - handle(Type::Any(), isolate_);
|
| +void TypeFeedbackOracle::CompareType(TypeFeedbackId id,
|
| + Handle<Type>* left_type,
|
| + Handle<Type>* right_type,
|
| + Handle<Type>* combined_type) {
|
| + *left_type = *right_type = *combined_type = handle(Type::Any(), isolate_);
|
| Handle<Object> info = GetInfo(id);
|
| if (!info->IsCode()) return;
|
| Handle<Code> code = Handle<Code>::cast(info);
|
| @@ -364,10 +373,14 @@ void TypeFeedbackOracle::CompareTypes(TypeFeedbackId id,
|
| if (code->is_compare_ic_stub()) {
|
| int stub_minor_key = code->stub_info();
|
| CompareIC::StubInfoToType(
|
| - stub_minor_key, left_type, right_type, overall_type, map, isolate());
|
| + stub_minor_key, left_type, right_type, combined_type, map, isolate());
|
| } else if (code->is_compare_nil_ic_stub()) {
|
| CompareNilICStub::State state(code->compare_nil_state());
|
| - *compare_nil_type = CompareNilICStub::StateToType(isolate_, state, map);
|
| + *combined_type = CompareNilICStub::StateToType(isolate_, state, map);
|
| + Handle<Type> nil_type = handle(code->compare_nil_value() == kNullValue
|
| + ? Type::Null() : Type::Undefined(), isolate_);
|
| + *left_type = *right_type =
|
| + handle(Type::Union(*combined_type, nil_type), isolate_);
|
| }
|
| }
|
|
|
| @@ -386,8 +399,7 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
|
| Handle<Type>* left,
|
| Handle<Type>* right,
|
| Handle<Type>* result,
|
| - bool* has_fixed_right_arg,
|
| - int* fixed_right_arg_value) {
|
| + Maybe<int>* fixed_right_arg) {
|
| Handle<Object> object = GetInfo(id);
|
| *left = *right = *result = handle(Type::Any(), isolate_);
|
| if (!object->IsCode()) return;
|
| @@ -396,10 +408,8 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
|
|
|
| int minor_key = code->stub_info();
|
| BinaryOpIC::StubInfoToType(minor_key, left, right, result, isolate());
|
| - *has_fixed_right_arg =
|
| - BinaryOpStub::decode_has_fixed_right_arg_from_minor_key(minor_key);
|
| - *fixed_right_arg_value =
|
| - BinaryOpStub::decode_fixed_right_arg_value_from_minor_key(minor_key);
|
| + *fixed_right_arg =
|
| + BinaryOpStub::decode_fixed_right_arg_from_minor_key(minor_key);
|
| }
|
|
|
|
|
| @@ -475,7 +485,8 @@ void TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id,
|
| ASSERT(Handle<Code>::cast(object)->ic_state() == GENERIC);
|
| } else if (object->IsMap()) {
|
| types->AddMapIfMissing(Handle<Map>::cast(object), zone());
|
| - } else if (Handle<Code>::cast(object)->ic_state() == POLYMORPHIC) {
|
| + } else if (Handle<Code>::cast(object)->ic_state() == POLYMORPHIC ||
|
| + Handle<Code>::cast(object)->ic_state() == MONOMORPHIC) {
|
| CollectPolymorphicMaps(Handle<Code>::cast(object), types);
|
| } else if (FLAG_collect_megamorphic_maps_from_stub_cache &&
|
| Handle<Code>::cast(object)->ic_state() == MEGAMORPHIC) {
|
|
|