diff --git a/src/ast.h b/src/ast.h index a32540c5a4..d697da7bda 100644 --- a/src/ast.h +++ b/src/ast.h @@ -286,6 +286,7 @@ class SmallMapList { } void Add(Handle handle, Zone* zone) { + ASSERT(!handle->is_deprecated()); list_.Add(handle.location(), zone); } diff --git a/src/type-info.cc b/src/type-info.cc index 1757bee767..d52536ed0c 100644 --- a/src/type-info.cc +++ b/src/type-info.cc @@ -192,13 +192,14 @@ Handle TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { Handle map_or_code = GetInfo(expr->PropertyFeedbackId()); if (map_or_code->IsCode()) { Handle code = Handle::cast(map_or_code); - Map* first_map = code->FindFirstMap(); - ASSERT(first_map != NULL); - return CanRetainOtherContext(first_map, *native_context_) + Handle first_map(code->FindFirstMap()); + ASSERT(!first_map.is_null()); + first_map = Map::CurrentMapForDeprecated(first_map); + return CanRetainOtherContext(*first_map, *native_context_) ? Handle::null() - : Handle(first_map); + : first_map; } - return Handle::cast(map_or_code); + return Map::CurrentMapForDeprecated(Handle::cast(map_or_code)); } @@ -208,13 +209,14 @@ Handle TypeFeedbackOracle::StoreMonomorphicReceiverType( Handle map_or_code = GetInfo(ast_id); if (map_or_code->IsCode()) { Handle code = Handle::cast(map_or_code); - Map* first_map = code->FindFirstMap(); - ASSERT(first_map != NULL); - return CanRetainOtherContext(first_map, *native_context_) + Handle first_map(code->FindFirstMap()); + ASSERT(!first_map.is_null()); + first_map = Map::CurrentMapForDeprecated(first_map); + return CanRetainOtherContext(*first_map, *native_context_) ? Handle::null() - : Handle(first_map); + : first_map; } - return Handle::cast(map_or_code); + return Map::CurrentMapForDeprecated(Handle::cast(map_or_code)); } @@ -223,7 +225,9 @@ Handle TypeFeedbackOracle::CompareNilMonomorphicReceiverType( Handle maybe_code = GetInfo(id); if (maybe_code->IsCode()) { Map* first_map = Handle::cast(maybe_code)->FindFirstMap(); - if (first_map != NULL) return Handle(first_map); + if (first_map != NULL) { + return Map::CurrentMapForDeprecated(Handle(first_map)); + } } return Handle(); } @@ -347,7 +351,8 @@ ElementsKind TypeFeedbackOracle::GetCallNewElementsKind(CallNew* expr) { Handle TypeFeedbackOracle::GetObjectLiteralStoreMap( ObjectLiteral::Property* prop) { ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); - return Handle::cast(GetInfo(prop->key()->LiteralFeedbackId())); + return Map::CurrentMapForDeprecated( + Handle::cast(GetInfo(prop->key()->LiteralFeedbackId()))); } @@ -426,11 +431,12 @@ Handle TypeFeedbackOracle::GetCompareMap(CompareOperation* expr) { if (state != CompareIC::KNOWN_OBJECT) { return Handle::null(); } - Map* first_map = code->FindFirstMap(); - ASSERT(first_map != NULL); - return CanRetainOtherContext(first_map, *native_context_) + Handle first_map(code->FindFirstMap()); + ASSERT(!first_map.is_null()); + first_map = Map::CurrentMapForDeprecated(first_map); + return CanRetainOtherContext(*first_map, *native_context_) ? Handle::null() - : Handle(first_map); + : first_map; }