Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 53b5ce1c4eeb8ea71eb74f4cf235ce5efd3a3ac0..f8273b701247ebc7a3429fc4e6723d8353c1c718 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -9044,6 +9044,27 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInNewSpace) { |
} |
+RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldPointerSpace) { |
+ // Allocate a block of memory in old pointer space (filled with a filler). |
+ // Use as fallback for allocation in generated code when old pointer space |
+ // is full. |
+ ASSERT(args.length() == 1); |
+ CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0); |
+ int size = size_smi->value(); |
+ RUNTIME_ASSERT(IsAligned(size, kPointerSize)); |
+ RUNTIME_ASSERT(size > 0); |
+ Heap* heap = isolate->heap(); |
+ Object* allocation; |
+ { MaybeObject* maybe_allocation = |
+ heap->old_pointer_space()->AllocateRaw(size); |
+ if (maybe_allocation->ToObject(&allocation)) { |
+ heap->CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size); |
+ } |
+ return maybe_allocation; |
+ } |
+} |
+ |
+ |
// Push an object unto an array of objects if it is not already in the |
// array. Returns true if the element was pushed on the stack and |
// false otherwise. |