Commit b26632f6 authored by dcarney@chromium.org's avatar dcarney@chromium.org

Let FastCloneShallowObjectStub work with empty literal objects.

R=verwaest@chromium.org

LOG=N

BUG=417290

Review URL: https://codereview.chromium.org/655163002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24618 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ac1f4296
......@@ -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;
......
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