Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 23480031: Enable preaging of code objects when --optimize-for-size. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Rebase and add MIPS support Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 1c8bbbe28d05654e4d39de8d664e1d5fa17b9998..cd55b3d2acf5e9b3493ae6e24c27854755fc5145 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -143,13 +143,20 @@ bool LCodeGen::GeneratePrologue() {
if (NeedsEagerFrame()) {
ASSERT(!frame_is_built_);
frame_is_built_ = true;
- __ push(rbp); // Caller's frame pointer.
- __ movq(rbp, rsp);
- __ push(rsi); // Callee's context.
- if (info()->IsStub()) {
- __ Push(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::kShortCallInstructionLength);
} else {
- __ push(rdi); // Callee's JS function.
+ __ push(rbp); // Caller's frame pointer.
+ __ movq(rbp, rsp);
+ __ push(rsi); // Callee's context.
+ if (info()->IsStub()) {
+ __ Push(Smi::FromInt(StackFrame::STUB));
+ } else {
+ __ push(rdi); // Callee's JS function.
+ }
}
info()->AddNoFrameRange(0, masm_->pc_offset());
}

Powered by Google App Engine
This is Rietveld 408576698