Index: src/builtins.cc |
=================================================================== |
--- src/builtins.cc (revision 647) |
+++ src/builtins.cc (working copy) |
@@ -642,13 +642,12 @@ |
CodeDesc desc; |
masm.GetCode(&desc); |
Code::Flags flags = functions[i].flags; |
- Object* code = Heap::CreateCode(desc, NULL, flags); |
- if (code->IsFailure()) { |
- if (code->IsRetryAfterGC()) { |
- CHECK(Heap::CollectGarbage(Failure::cast(code)->requested(), |
- Failure::cast(code)->allocation_space())); |
- code = Heap::CreateCode(desc, NULL, flags); |
- } |
+ Object* code; |
+ { |
+ // During startup it's OK to always allocate and defer GC to later. |
+ // This simplifies things because we don't need to retry. |
+ AlwaysAllocateScope __scope__; |
+ code = Heap::CreateCode(desc, NULL, flags); |
if (code->IsFailure()) { |
v8::internal::V8::FatalProcessOutOfMemory("CreateCode"); |
} |