Reviewers: Toon Verwaest,

Message:
Committed patchset #1 (id:40001) manually as 24618 (presubmit successful).

Description:
Let FastCloneShallowObjectStub work with empty literal objects.

[email protected]

LOG=N

BUG=417290

Committed: https://code.google.com/p/v8/source/detail?r=24618

Please review this at https://codereview.chromium.org/655163002/

Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -1 lines):
  M src/code-stubs-hydrogen.cc


Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 63488dc2b2d9362b270588a28c340ad17ac166df..e3cbe7d588cbb19791576f0cbdd73f2c8db22885 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -416,7 +416,12 @@ HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() {
   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