Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index e30b350df3169ec7f58eaeddbcf266efd689d521..d82e8ed61c3bd8da3111e58b11416733881e702b 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -9128,6 +9128,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. |