Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 648bb734538681ea2307499f4511005aa6da3dff..7d283f5998326c9c2760cf568c5757523bf5b3a8 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -188,14 +188,21 @@ bool LCodeGen::GeneratePrologue() { |
if (NeedsEagerFrame()) { |
ASSERT(!frame_is_built_); |
frame_is_built_ = true; |
- __ push(ebp); // Caller's frame pointer. |
- __ mov(ebp, esp); |
- info()->AddNoFrameRange(0, masm_->pc_offset()); |
- __ push(esi); // Callee's context. |
- if (info()->IsStub()) { |
- __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
+ if (FLAG_optimize_for_size && FLAG_age_code && !info()->IsStub()) { |
+ // Pre-age the code. |
+ __ call(isolate()->builtins()->MarkCodeAsExecutedOnce(), |
+ RelocInfo::CODE_AGE_SEQUENCE); |
+ __ Nop(kNoCodeAgeSequenceLength - Assembler::kCallInstructionLength); |
} else { |
- __ push(edi); // Callee's JS function. |
+ __ push(ebp); // Caller's frame pointer. |
+ __ mov(ebp, esp); |
+ info()->AddNoFrameRange(0, masm_->pc_offset()); |
+ __ push(esi); // Callee's context. |
+ if (info()->IsStub()) { |
+ __ push(Immediate(Smi::FromInt(StackFrame::STUB))); |
+ } else { |
+ __ push(edi); // Callee's JS function. |
+ } |
} |
} |