Commit af451684 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Don't use fast literal if the boilerplate map is still deprecated.

R=mvstanton@chromium.org

Review URL: https://chromiumcodereview.appspot.com/15660005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 28729d24
......@@ -6692,6 +6692,12 @@ static bool IsFastLiteral(Handle<JSObject> boilerplate,
int* max_properties,
int* data_size,
int* pointer_size) {
if (boilerplate->map()->is_deprecated()) {
Handle<Object> result =
JSObject::TryMigrateInstance(boilerplate);
if (result->IsSmi()) return false;
}
ASSERT(max_depth >= 0 && *max_properties >= 0);
if (max_depth == 0) return false;
......
......@@ -1542,6 +1542,13 @@ MaybeObject* JSObject::MigrateInstance() {
}
MaybeObject* JSObject::TryMigrateInstance() {
Map* new_map = map()->CurrentMapForDeprecated();
if (new_map == NULL) return Smi::FromInt(0);
return MigrateToMap(new_map);
}
Handle<String> JSObject::ExpectedTransitionKey(Handle<Map> map) {
AssertNoAllocation no_gc;
if (!map->HasTransitionArray()) return Handle<String>::null();
......
......@@ -3644,6 +3644,19 @@ void JSObject::MigrateInstance(Handle<JSObject> object) {
}
Handle<Object> JSObject::TryMigrateInstance(Handle<JSObject> object) {
if (FLAG_trace_migration) {
PrintF("migrating instance (no new maps) %p (%p)\n",
static_cast<void*>(*object),
static_cast<void*>(object->map()));
}
CALL_HEAP_FUNCTION(
object->GetIsolate(),
object->MigrateInstance(),
Object);
}
Handle<Map> Map::GeneralizeRepresentation(Handle<Map> map,
int modify_index,
Representation representation) {
......
......@@ -1843,6 +1843,9 @@ class JSObject: public JSReceiver {
static void MigrateInstance(Handle<JSObject> instance);
inline MUST_USE_RESULT MaybeObject* MigrateInstance();
static Handle<Object> TryMigrateInstance(Handle<JSObject> instance);
inline MUST_USE_RESULT MaybeObject* TryMigrateInstance();
// Can cause GC.
MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributes(
Name* key,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment