Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index 20c56226e8cca27078e518d32fb357ecd1e5b49b..7fcc59187cb1db6f3d3a60448b089898797a12cc 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -152,10 +152,21 @@ void FullCodeGenerator::Generate() { |
FrameScope frame_scope(masm_, StackFrame::MANUAL); |
info->set_prologue_offset(masm_->pc_offset()); |
- __ push(rbp); // Caller's frame pointer. |
- __ movq(rbp, rsp); |
- __ push(rsi); // Callee's context. |
- __ push(rdi); // Callee's JS Function. |
+ { |
+ PredictableCodeSizeScope predictible_code_size_scope( |
+ masm_, kNoCodeAgeSequenceLength); |
+ if (FLAG_optimize_for_size && FLAG_age_code) { |
+ // Pre-age the code. |
+ __ Call(isolate()->builtins()->MarkCodeAsExecutedOnce(), |
+ RelocInfo::CODE_AGE_SEQUENCE); |
+ __ Nop(kNoCodeAgeSequenceLength - Assembler::kShortCallInstructionLength); |
+ } else { |
+ __ push(rbp); // Caller's frame pointer. |
+ __ movq(rbp, rsp); |
+ __ push(rsi); // Callee's context. |
+ __ push(rdi); // Callee's JS Function. |
+ } |
+ } |
info->AddNoFrameRange(0, masm_->pc_offset()); |
{ Comment cmnt(masm_, "[ Allocate locals"); |
@@ -171,7 +182,6 @@ void FullCodeGenerator::Generate() { |
} |
} |
} |
- |
bool function_in_register = true; |
// Possibly allocate a local context. |
@@ -190,6 +200,7 @@ void FullCodeGenerator::Generate() { |
__ CallRuntime(Runtime::kNewFunctionContext, 1); |
} |
function_in_register = false; |
+ |
// Context is returned in both rax and rsi. It replaces the context |
// passed to us. It's saved in the stack and kept live in rsi. |
__ movq(Operand(rbp, StandardFrameConstants::kContextOffset), rsi); |