Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 1d0d262fef93bb8f868e07258c4969218480965f..3827ddf24f6845220b07439543935bf413cc6bac 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -9274,6 +9274,27 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldPointerSpace) { |
| } |
| +RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldDataSpace) { |
| + // Allocate a block of memory in old data 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_data_space()->AllocateRaw(size); |
| + if (maybe_allocation->ToObject(&allocation)) { |
| + heap->CreateFillerObjectAt(HeapObject::cast(allocation)->address(), size); |
| + } |
| + return maybe_allocation; |
|
mvstanton
2013/05/28 07:11:11
Aside from the assert involving MaxNewSpaceAllocat
Hannes Payer (out of office)
2013/05/28 09:06:07
Thanks for the suggestion. I refactored the code.
|
| + } |
| +} |
| + |
| + |
| // 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. |