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 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 // r0: deoptimizer object; r1: scratch. | 1121 // r0: deoptimizer object; r1: scratch. |
1122 __ PrepareCallCFunction(1, r1); | 1122 __ PrepareCallCFunction(1, r1); |
1123 // Call Deoptimizer::ComputeOutputFrames(). | 1123 // Call Deoptimizer::ComputeOutputFrames(). |
1124 { | 1124 { |
1125 AllowExternalCallThatCantCauseGC scope(masm()); | 1125 AllowExternalCallThatCantCauseGC scope(masm()); |
1126 __ CallCFunction( | 1126 __ CallCFunction( |
1127 ExternalReference::compute_output_frames_function(isolate), 1); | 1127 ExternalReference::compute_output_frames_function(isolate), 1); |
1128 } | 1128 } |
1129 __ pop(r0); // Restore deoptimizer object (class Deoptimizer). | 1129 __ pop(r0); // Restore deoptimizer object (class Deoptimizer). |
1130 | 1130 |
1131 // TODO(hans): Change the code below to not clobber r0, so that it can be | |
1132 // used in the "restore the d registers" code further down, making this mov | |
1133 // redundant. | |
1134 __ mov(r4, r0); | |
1135 | |
1136 // Replace the current (input) frame with the output frames. | 1131 // Replace the current (input) frame with the output frames. |
1137 Label outer_push_loop, inner_push_loop, | 1132 Label outer_push_loop, inner_push_loop, |
1138 outer_loop_header, inner_loop_header; | 1133 outer_loop_header, inner_loop_header; |
1139 // Outer loop state: r0 = current "FrameDescription** output_", | 1134 // Outer loop state: r4 = current "FrameDescription** output_", |
1140 // r1 = one past the last FrameDescription**. | 1135 // r1 = one past the last FrameDescription**. |
1141 __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); | 1136 __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); |
1142 __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset())); // r0 is output_. | 1137 __ ldr(r4, MemOperand(r0, Deoptimizer::output_offset())); // r4 is output_. |
1143 __ add(r1, r0, Operand(r1, LSL, 2)); | 1138 __ add(r1, r4, Operand(r1, LSL, 2)); |
1144 __ jmp(&outer_loop_header); | 1139 __ jmp(&outer_loop_header); |
1145 __ bind(&outer_push_loop); | 1140 __ bind(&outer_push_loop); |
1146 // Inner loop state: r2 = current FrameDescription*, r3 = loop index. | 1141 // Inner loop state: r2 = current FrameDescription*, r3 = loop index. |
1147 __ ldr(r2, MemOperand(r0, 0)); // output_[ix] | 1142 __ ldr(r2, MemOperand(r4, 0)); // output_[ix] |
1148 __ ldr(r3, MemOperand(r2, FrameDescription::frame_size_offset())); | 1143 __ ldr(r3, MemOperand(r2, FrameDescription::frame_size_offset())); |
1149 __ jmp(&inner_loop_header); | 1144 __ jmp(&inner_loop_header); |
1150 __ bind(&inner_push_loop); | 1145 __ bind(&inner_push_loop); |
1151 __ sub(r3, r3, Operand(sizeof(uint32_t))); | 1146 __ sub(r3, r3, Operand(sizeof(uint32_t))); |
1152 __ add(r6, r2, Operand(r3)); | 1147 __ add(r6, r2, Operand(r3)); |
1153 __ ldr(r7, MemOperand(r6, FrameDescription::frame_content_offset())); | 1148 __ ldr(r7, MemOperand(r6, FrameDescription::frame_content_offset())); |
1154 __ push(r7); | 1149 __ push(r7); |
1155 __ bind(&inner_loop_header); | 1150 __ bind(&inner_loop_header); |
1156 __ cmp(r3, Operand::Zero()); | 1151 __ cmp(r3, Operand::Zero()); |
1157 __ b(ne, &inner_push_loop); // test for gt? | 1152 __ b(ne, &inner_push_loop); // test for gt? |
1158 __ add(r0, r0, Operand(kPointerSize)); | 1153 __ add(r4, r4, Operand(kPointerSize)); |
1159 __ bind(&outer_loop_header); | 1154 __ bind(&outer_loop_header); |
1160 __ cmp(r0, r1); | 1155 __ cmp(r4, r1); |
1161 __ b(lt, &outer_push_loop); | 1156 __ b(lt, &outer_push_loop); |
1162 | 1157 |
1163 if (CpuFeatures::IsSupported(VFP2)) { | 1158 if (CpuFeatures::IsSupported(VFP2)) { |
1164 CpuFeatures::Scope scope(VFP2); | 1159 CpuFeatures::Scope scope(VFP2); |
1165 // In case of OSR, we have to restore the d registers. | 1160 // In case of OSR, we have to restore the d registers. |
1166 if (type() == OSR) { | 1161 if (type() == OSR) { |
1167 // Check CPU flags for number of registers, setting the Z condition flag. | 1162 // Check CPU flags for number of registers, setting the Z condition flag. |
1168 __ CheckFor32DRegs(ip); | 1163 __ CheckFor32DRegs(ip); |
1169 | 1164 |
1170 __ ldr(r1, MemOperand(r4, Deoptimizer::input_offset())); | 1165 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); |
1171 int src_offset = FrameDescription::double_registers_offset(); | 1166 int src_offset = FrameDescription::double_registers_offset(); |
1172 for (int i = 0; i < DwVfpRegister::kNumRegisters; ++i) { | 1167 for (int i = 0; i < DwVfpRegister::kNumRegisters; ++i) { |
1173 if (i == kDoubleRegZero.code()) continue; | 1168 if (i == kDoubleRegZero.code()) continue; |
1174 if (i == kScratchDoubleReg.code()) continue; | 1169 if (i == kScratchDoubleReg.code()) continue; |
1175 | 1170 |
1176 const DwVfpRegister reg = DwVfpRegister::from_code(i); | 1171 const DwVfpRegister reg = DwVfpRegister::from_code(i); |
1177 __ vldr(reg, r1, src_offset, i < 16 ? al : ne); | 1172 __ vldr(reg, r1, src_offset, i < 16 ? al : ne); |
1178 src_offset += kDoubleSize; | 1173 src_offset += kDoubleSize; |
1179 } | 1174 } |
1180 } | 1175 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 __ push(ip); | 1225 __ push(ip); |
1231 __ b(&done); | 1226 __ b(&done); |
1232 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 1227 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
1233 } | 1228 } |
1234 __ bind(&done); | 1229 __ bind(&done); |
1235 } | 1230 } |
1236 | 1231 |
1237 #undef __ | 1232 #undef __ |
1238 | 1233 |
1239 } } // namespace v8::internal | 1234 } } // namespace v8::internal |
OLD | NEW |