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

Side by Side Diff: src/arm/lithium-codegen-arm.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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (info()->IsStub()) { 154 if (info()->IsStub()) {
155 __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); 155 __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit());
156 __ Push(Smi::FromInt(StackFrame::STUB)); 156 __ Push(Smi::FromInt(StackFrame::STUB));
157 // Adjust FP to point to saved FP. 157 // Adjust FP to point to saved FP.
158 __ add(fp, sp, Operand(2 * kPointerSize)); 158 __ add(fp, sp, Operand(2 * kPointerSize));
159 } else { 159 } else {
160 PredictableCodeSizeScope predictible_code_size_scope( 160 PredictableCodeSizeScope predictible_code_size_scope(
161 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); 161 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize);
162 // The following three instructions must remain together and unmodified 162 // The following three instructions must remain together and unmodified
163 // for code aging to work properly. 163 // for code aging to work properly.
164 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); 164 if (FLAG_optimize_for_size && FLAG_age_code) {
165 __ nop(ip.code()); 165 // Pre-age the code.
166 // Adjust FP to point to saved FP. 166 Code* stub = Code::GetPreAgedCodeAgeStub(isolate());
167 __ add(fp, sp, Operand(2 * kPointerSize)); 167 __ add(r0, pc, Operand(-8));
168 __ ldr(pc, MemOperand(pc, -4));
169 __ dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
170 } else {
171 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
172 __ nop(ip.code());
173 // Adjust FP to point to saved FP.
174 __ add(fp, sp, Operand(2 * kPointerSize));
175 }
168 } 176 }
169 frame_is_built_ = true; 177 frame_is_built_ = true;
170 info_->AddNoFrameRange(0, masm_->pc_offset()); 178 info_->AddNoFrameRange(0, masm_->pc_offset());
171 } 179 }
172 180
173 // Reserve space for the stack slots needed by the code. 181 // Reserve space for the stack slots needed by the code.
174 int slots = GetStackSlotCount(); 182 int slots = GetStackSlotCount();
175 if (slots > 0) { 183 if (slots > 0) {
176 if (FLAG_debug_code) { 184 if (FLAG_debug_code) {
177 __ sub(sp, sp, Operand(slots * kPointerSize)); 185 __ sub(sp, sp, Operand(slots * kPointerSize));
(...skipping 5604 matching lines...) Expand 10 before | Expand all | Expand 10 after
5782 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5790 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5783 __ ldr(result, FieldMemOperand(scratch, 5791 __ ldr(result, FieldMemOperand(scratch,
5784 FixedArray::kHeaderSize - kPointerSize)); 5792 FixedArray::kHeaderSize - kPointerSize));
5785 __ bind(&done); 5793 __ bind(&done);
5786 } 5794 }
5787 5795
5788 5796
5789 #undef __ 5797 #undef __
5790 5798
5791 } } // namespace v8::internal 5799 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/assembler.h » ('j') | src/ia32/full-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698