Revision: 14675
Author: [email protected]
Date: Wed May 15 02:04:10 2013
Log: Ensure all maps gathered from the ICs are updated if deprecated.
Add ASSERT to SmallMapList::Add to ensure no deprecated maps are ever added.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/15179004
Patch from Toon Verwaest <[email protected]>.
http://code.google.com/p/v8/source/detail?r=14675
Modified:
/branches/bleeding_edge/src/ast.h
/branches/bleeding_edge/src/type-info.cc
=======================================
--- /branches/bleeding_edge/src/ast.h Tue May 14 09:26:56 2013
+++ /branches/bleeding_edge/src/ast.h Wed May 15 02:04:10 2013
@@ -286,6 +286,7 @@
}
void Add(Handle<Map> handle, Zone* zone) {
+ ASSERT(!handle->is_deprecated());
list_.Add(handle.location(), zone);
}
=======================================
--- /branches/bleeding_edge/src/type-info.cc Tue May 7 05:02:15 2013
+++ /branches/bleeding_edge/src/type-info.cc Wed May 15 02:04:10 2013
@@ -192,13 +192,14 @@
Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId());
if (map_or_code->IsCode()) {
Handle<Code> code = Handle<Code>::cast(map_or_code);
- Map* first_map = code->FindFirstMap();
- ASSERT(first_map != NULL);
- return CanRetainOtherContext(first_map, *native_context_)
+ Handle<Map> first_map(code->FindFirstMap());
+ ASSERT(!first_map.is_null());
+ first_map = Map::CurrentMapForDeprecated(first_map);
+ return CanRetainOtherContext(*first_map, *native_context_)
? Handle<Map>::null()
- : Handle<Map>(first_map);
+ : first_map;
}
- return Handle<Map>::cast(map_or_code);
+ return Map::CurrentMapForDeprecated(Handle<Map>::cast(map_or_code));
}
@@ -208,13 +209,14 @@
Handle<Object> map_or_code = GetInfo(ast_id);
if (map_or_code->IsCode()) {
Handle<Code> code = Handle<Code>::cast(map_or_code);
- Map* first_map = code->FindFirstMap();
- ASSERT(first_map != NULL);
- return CanRetainOtherContext(first_map, *native_context_)
+ Handle<Map> first_map(code->FindFirstMap());
+ ASSERT(!first_map.is_null());
+ first_map = Map::CurrentMapForDeprecated(first_map);
+ return CanRetainOtherContext(*first_map, *native_context_)
? Handle<Map>::null()
- : Handle<Map>(first_map);
+ : first_map;
}
- return Handle<Map>::cast(map_or_code);
+ return Map::CurrentMapForDeprecated(Handle<Map>::cast(map_or_code));
}
@@ -223,7 +225,9 @@
Handle<Object> maybe_code = GetInfo(id);
if (maybe_code->IsCode()) {
Map* first_map = Handle<Code>::cast(maybe_code)->FindFirstMap();
- if (first_map != NULL) return Handle<Map>(first_map);
+ if (first_map != NULL) {
+ return Map::CurrentMapForDeprecated(Handle<Map>(first_map));
+ }
}
return Handle<Map>();
}
@@ -347,7 +351,8 @@
Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap(
ObjectLiteral::Property* prop) {
ASSERT(ObjectLiteralStoreIsMonomorphic(prop));
- return Handle<Map>::cast(GetInfo(prop->key()->LiteralFeedbackId()));
+ return Map::CurrentMapForDeprecated(
+ Handle<Map>::cast(GetInfo(prop->key()->LiteralFeedbackId())));
}
@@ -426,11 +431,12 @@
if (state != CompareIC::KNOWN_OBJECT) {
return Handle<Map>::null();
}
- Map* first_map = code->FindFirstMap();
- ASSERT(first_map != NULL);
- return CanRetainOtherContext(first_map, *native_context_)
+ Handle<Map> first_map(code->FindFirstMap());
+ ASSERT(!first_map.is_null());
+ first_map = Map::CurrentMapForDeprecated(first_map);
+ return CanRetainOtherContext(*first_map, *native_context_)
? Handle<Map>::null()
- : Handle<Map>(first_map);
+ : first_map;
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.