Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3206)

Unified Diff: bleeding_edge/src/heap.cc

Issue 503042: Optimize the allocation of small, non-nested literal... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bleeding_edge/src/heap.h ('k') | bleeding_edge/src/ia32/codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bleeding_edge/src/heap.cc
===================================================================
--- bleeding_edge/src/heap.cc (revision 3484)
+++ bleeding_edge/src/heap.cc (working copy)
@@ -2261,10 +2261,14 @@
JSObject* boilerplate =
Top::context()->global_context()->arguments_boilerplate();
- // Make the clone.
- Map* map = boilerplate->map();
- int object_size = map->instance_size();
- Object* result = AllocateRaw(object_size, NEW_SPACE, OLD_POINTER_SPACE);
+ // Check that the size of the boilerplate matches our
+ // expectations. The ArgumentsAccessStub::GenerateNewObject relies
+ // on the size being a known constant.
+ ASSERT(kArgumentsObjectSize == boilerplate->map()->instance_size());
+
+ // Do the allocation.
+ Object* result =
+ AllocateRaw(kArgumentsObjectSize, NEW_SPACE, OLD_POINTER_SPACE);
if (result->IsFailure()) return result;
// Copy the content. The arguments boilerplate doesn't have any
@@ -2272,7 +2276,7 @@
// barrier here.
CopyBlock(reinterpret_cast<Object**>(HeapObject::cast(result)->address()),
reinterpret_cast<Object**>(boilerplate->address()),
- object_size);
+ kArgumentsObjectSize);
// Set the two properties.
JSObject::cast(result)->InObjectPropertyAtPut(arguments_callee_index,
« no previous file with comments | « bleeding_edge/src/heap.h ('k') | bleeding_edge/src/ia32/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698