Index: src/heap.h |
=================================================================== |
--- src/heap.h (revision 3115) |
+++ src/heap.h (working copy) |
@@ -38,7 +38,13 @@ |
// Defines all the roots in Heap. |
#define UNCONDITIONAL_STRONG_ROOT_LIST(V) \ |
- /* Cluster the most popular ones in a few cache lines here at the top. */ \ |
+ /* Put the byte array map early. We need it to be in place by the time */ \ |
+ /* the deserializer hits the next page, since it wants to put a byte */ \ |
+ /* array in the unused space at the end of the page. */ \ |
+ V(Map, byte_array_map, ByteArrayMap) \ |
+ V(Map, one_pointer_filler_map, OnePointerFillerMap) \ |
+ V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ |
+ /* Cluster the most popular ones in a few cache lines here at the top. */ \ |
V(Smi, stack_limit, StackLimit) \ |
V(Object, undefined_value, UndefinedValue) \ |
V(Object, the_hole_value, TheHoleValue) \ |
@@ -109,7 +115,6 @@ |
undetectable_medium_ascii_string_map, \ |
UndetectableMediumAsciiStringMap) \ |
V(Map, undetectable_long_ascii_string_map, UndetectableLongAsciiStringMap) \ |
- V(Map, byte_array_map, ByteArrayMap) \ |
V(Map, pixel_array_map, PixelArrayMap) \ |
V(Map, external_byte_array_map, ExternalByteArrayMap) \ |
V(Map, external_unsigned_byte_array_map, ExternalUnsignedByteArrayMap) \ |
@@ -126,8 +131,6 @@ |
V(Map, boilerplate_function_map, BoilerplateFunctionMap) \ |
V(Map, shared_function_info_map, SharedFunctionInfoMap) \ |
V(Map, proxy_map, ProxyMap) \ |
- V(Map, one_pointer_filler_map, OnePointerFillerMap) \ |
- V(Map, two_pointer_filler_map, TwoPointerFillerMap) \ |
V(Object, nan_value, NanValue) \ |
V(Object, minus_zero_value, MinusZeroValue) \ |
V(String, empty_string, EmptyString) \ |
@@ -301,6 +304,9 @@ |
static LargeObjectSpace* lo_space() { return lo_space_; } |
static bool always_allocate() { return always_allocate_scope_depth_ != 0; } |
+ static bool linear_allocation() { |
Mads Ager (chromium)
2009/10/26 11:14:05
Move this one after the other always_allocate_* ge
|
+ return linear_allocation_scope_depth_ != 0; |
+ } |
static Address always_allocate_scope_depth_address() { |
return reinterpret_cast<Address>(&always_allocate_scope_depth_); |
} |
@@ -749,7 +755,7 @@ |
static bool Contains(HeapObject* value); |
// Checks whether an address/object in a space. |
- // Currently used by tests and heap verification only. |
+ // Currently used by tests, serialization and heap verification only. |
static bool InSpace(Address addr, AllocationSpace space); |
static bool InSpace(HeapObject* value, AllocationSpace space); |
@@ -920,6 +926,7 @@ |
static int survived_since_last_expansion_; |
static int always_allocate_scope_depth_; |
+ static int linear_allocation_scope_depth_; |
static bool context_disposed_pending_; |
static const int kMaxMapSpaceSize = 8*MB; |
@@ -1135,6 +1142,7 @@ |
friend class Factory; |
friend class DisallowAllocationFailure; |
friend class AlwaysAllocateScope; |
+ friend class LinearAllocationScope; |
}; |
@@ -1156,6 +1164,19 @@ |
}; |
+class LinearAllocationScope { |
+ public: |
+ LinearAllocationScope() { |
+ Heap::linear_allocation_scope_depth_++; |
+ } |
+ |
+ ~LinearAllocationScope() { |
+ Heap::linear_allocation_scope_depth_--; |
+ ASSERT(Heap::linear_allocation_scope_depth_ >= 0); |
+ } |
+}; |
+ |
+ |
#ifdef DEBUG |
// Visitor class to verify interior pointers that do not have remembered set |
// bits. All heap object pointers have to point into the heap to a location |