Revision: 24618
Author:   [email protected]
Date:     Wed Oct 15 08:48:44 2014 UTC
Log:      Let FastCloneShallowObjectStub work with empty literal objects.

[email protected]

LOG=N

BUG=417290

Review URL: https://codereview.chromium.org/655163002
https://code.google.com/p/v8/source/detail?r=24618

Modified:
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Mon Oct 13 07:50:21 2014 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Wed Oct 15 08:48:44 2014 UTC
@@ -416,7 +416,12 @@
   HInstruction* boilerplate = Add<HLoadNamedField>(
       allocation_site, static_cast<HValue*>(NULL), access);

- int size = JSObject::kHeaderSize + casted_stub()->length() * kPointerSize;
+  int length = casted_stub()->length();
+  if (length == 0) {
+    // Empty objects have some slack added to them.
+    length = JSObject::kInitialGlobalObjectUnusedPropertiesCount;
+  }
+  int size = JSObject::kHeaderSize + length * kPointerSize;
   int object_size = size;
   if (FLAG_allocation_site_pretenuring) {
     size += AllocationMemento::kSize;

--
--
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/d/optout.

Reply via email to