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

Unified Diff: src/x64/full-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: Add missing ia32 lithium codegen. Created 7 years, 3 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/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 33d668d4f20a41ababd7e208df6d4a4151083e02..5c32916a589cbe5db3c809cb781d3c3b5cee5fb0 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -153,10 +153,25 @@ 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);
+ for (int i = Assembler::kShortCallInstructionLength;
+ i < kNoCodeAgeSequenceLength;
+ i++) {
+ __ nop();
+ }
+ } 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");
@@ -191,6 +206,7 @@ void FullCodeGenerator::Generate() {
__ CallRuntime(Runtime::kNewFunctionContext, 1);
}
function_in_register = false;
+
danno 2013/10/04 16:30:09 nit: remove whitespace change
rmcilroy 2013/10/07 10:56:13 Done.
// 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);
« src/v8globals.h ('K') | « src/x64/codegen-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698