OLD | NEW |
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (info()->IsStub()) { | 136 if (info()->IsStub()) { |
137 __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); | 137 __ stm(db_w, sp, cp.bit() | fp.bit() | lr.bit()); |
138 __ Push(Smi::FromInt(StackFrame::STUB)); | 138 __ Push(Smi::FromInt(StackFrame::STUB)); |
139 // Adjust FP to point to saved FP. | 139 // Adjust FP to point to saved FP. |
140 __ add(fp, sp, Operand(2 * kPointerSize)); | 140 __ add(fp, sp, Operand(2 * kPointerSize)); |
141 } else { | 141 } else { |
142 PredictableCodeSizeScope predictible_code_size_scope( | 142 PredictableCodeSizeScope predictible_code_size_scope( |
143 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); | 143 masm_, kNoCodeAgeSequenceLength * Assembler::kInstrSize); |
144 // The following three instructions must remain together and unmodified | 144 // The following three instructions must remain together and unmodified |
145 // for code aging to work properly. | 145 // for code aging to work properly. |
146 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 146 if (FLAG_optimize_for_size && FLAG_age_code) { |
147 __ nop(ip.code()); | 147 // Pre-age the code. |
148 // Adjust FP to point to saved FP. | 148 Code* stub = Code::GetPreAgedCodeAgeStub(isolate()); |
149 __ add(fp, sp, Operand(2 * kPointerSize)); | 149 __ add(r0, pc, Operand(-8)); |
| 150 __ ldr(pc, MemOperand(pc, -4)); |
| 151 __ dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
| 152 } else { |
| 153 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 154 __ nop(ip.code()); |
| 155 // Adjust FP to point to saved FP. |
| 156 __ add(fp, sp, Operand(2 * kPointerSize)); |
| 157 } |
150 } | 158 } |
151 frame_is_built_ = true; | 159 frame_is_built_ = true; |
152 info_->AddNoFrameRange(0, masm_->pc_offset()); | 160 info_->AddNoFrameRange(0, masm_->pc_offset()); |
153 } | 161 } |
154 | 162 |
155 // Reserve space for the stack slots needed by the code. | 163 // Reserve space for the stack slots needed by the code. |
156 int slots = GetStackSlotCount(); | 164 int slots = GetStackSlotCount(); |
157 if (slots > 0) { | 165 if (slots > 0) { |
158 if (FLAG_debug_code) { | 166 if (FLAG_debug_code) { |
159 __ sub(sp, sp, Operand(slots * kPointerSize)); | 167 __ sub(sp, sp, Operand(slots * kPointerSize)); |
(...skipping 5681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5841 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5849 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5842 __ ldr(result, FieldMemOperand(scratch, | 5850 __ ldr(result, FieldMemOperand(scratch, |
5843 FixedArray::kHeaderSize - kPointerSize)); | 5851 FixedArray::kHeaderSize - kPointerSize)); |
5844 __ bind(&done); | 5852 __ bind(&done); |
5845 } | 5853 } |
5846 | 5854 |
5847 | 5855 |
5848 #undef __ | 5856 #undef __ |
5849 | 5857 |
5850 } } // namespace v8::internal | 5858 } } // namespace v8::internal |
OLD | NEW |