Revision: 14774
Author:   [email protected]
Date:     Thu May 23 04:30:24 2013
Log:      Don't use fast literal if the boilerplate map is still deprecated.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/15660005
http://code.google.com/p/v8/source/detail?r=14774

Modified:
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Thu May 23 02:51:06 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu May 23 04:30:24 2013
@@ -6692,6 +6692,12 @@
                           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;

=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Thu May 23 03:01:42 2013
+++ /branches/bleeding_edge/src/objects-inl.h   Thu May 23 04:30:24 2013
@@ -1540,6 +1540,13 @@
   // transition that matches the object. This achieves what is needed.
   return GeneralizeFieldRepresentation(0, Representation::Smi());
 }
+
+
+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) {
=======================================
--- /branches/bleeding_edge/src/objects.cc      Thu May 23 00:05:58 2013
+++ /branches/bleeding_edge/src/objects.cc      Thu May 23 04:30:24 2013
@@ -3642,6 +3642,19 @@
       object->GetIsolate(),
       object->MigrateInstance());
 }
+
+
+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,
=======================================
--- /branches/bleeding_edge/src/objects.h       Thu May 23 03:01:42 2013
+++ /branches/bleeding_edge/src/objects.h       Thu May 23 04:30:24 2013
@@ -1843,6 +1843,9 @@
   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,

--
--
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.


Reply via email to