Version 2.0.5
Extended to upper limit of map space to allow for 7 times as many map to be allocated (issue 524).
Improved performance of code using closures.
Improved performance of some binary operations involving doubles.
git-svn-id: http://v8.googlecode.com/svn/trunk@3490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/heap.cc b/src/heap.cc
index b9aa95c..7a66038 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -1142,6 +1142,13 @@
map->set_unused_property_fields(0);
map->set_bit_field(0);
map->set_bit_field2(0);
+
+ // If the map object is aligned fill the padding area with Smi 0 objects.
+ if (Map::kPadStart < Map::kSize) {
+ memset(reinterpret_cast<byte*>(map) + Map::kPadStart - kHeapObjectTag,
+ 0,
+ Map::kSize - Map::kPadStart);
+ }
return map;
}
@@ -2233,8 +2240,11 @@
Object* Heap::AllocateFunction(Map* function_map,
SharedFunctionInfo* shared,
- Object* prototype) {
- Object* result = Allocate(function_map, OLD_POINTER_SPACE);
+ Object* prototype,
+ PretenureFlag pretenure) {
+ AllocationSpace space =
+ (pretenure == TENURED) ? OLD_POINTER_SPACE : NEW_SPACE;
+ Object* result = Allocate(function_map, space);
if (result->IsFailure()) return result;
return InitializeFunction(JSFunction::cast(result), shared, prototype);
}
@@ -2251,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
@@ -2262,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,