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

Side by Side Diff: src/mips64/deoptimizer-mips64.cc

Issue 2773583003: MIPS[64]: Port `[deoptimizer] Fill the single precision registers in the deoptimizer entry stub.` (Closed)
Patch Set: Address typo Created 3 years, 9 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
« no previous file with comments | « src/mips/deoptimizer-mips.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/codegen.h" 5 #include "src/codegen.h"
6 #include "src/deoptimizer.h" 6 #include "src/deoptimizer.h"
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/register-configuration.h" 8 #include "src/register-configuration.h"
9 #include "src/safepoint-table.h" 9 #include "src/safepoint-table.h"
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 GeneratePrologue(); 107 GeneratePrologue();
108 108
109 // Unlike on ARM we don't save all the registers, just the useful ones. 109 // Unlike on ARM we don't save all the registers, just the useful ones.
110 // For the rest, there are gaps on the stack, so the offsets remain the same. 110 // For the rest, there are gaps on the stack, so the offsets remain the same.
111 const int kNumberOfRegisters = Register::kNumRegisters; 111 const int kNumberOfRegisters = Register::kNumRegisters;
112 112
113 RegList restored_regs = kJSCallerSaved | kCalleeSaved; 113 RegList restored_regs = kJSCallerSaved | kCalleeSaved;
114 RegList saved_regs = restored_regs | sp.bit() | ra.bit(); 114 RegList saved_regs = restored_regs | sp.bit() | ra.bit();
115 115
116 const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kMaxNumRegisters; 116 const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kMaxNumRegisters;
117 const int kFloatRegsSize = kFloatSize * FloatRegister::kMaxNumRegisters;
117 118
118 // Save all FPU registers before messing with them. 119 // Save all double FPU registers before messing with them.
119 __ Dsubu(sp, sp, Operand(kDoubleRegsSize)); 120 __ Dsubu(sp, sp, Operand(kDoubleRegsSize));
120 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft(); 121 const RegisterConfiguration* config = RegisterConfiguration::Crankshaft();
121 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { 122 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
122 int code = config->GetAllocatableDoubleCode(i); 123 int code = config->GetAllocatableDoubleCode(i);
123 const DoubleRegister fpu_reg = DoubleRegister::from_code(code); 124 const DoubleRegister fpu_reg = DoubleRegister::from_code(code);
124 int offset = code * kDoubleSize; 125 int offset = code * kDoubleSize;
125 __ sdc1(fpu_reg, MemOperand(sp, offset)); 126 __ sdc1(fpu_reg, MemOperand(sp, offset));
126 } 127 }
127 128
129 // Save all float FPU registers before messing with them.
130 __ Dsubu(sp, sp, Operand(kFloatRegsSize));
131 for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
132 int code = config->GetAllocatableFloatCode(i);
133 const FloatRegister fpu_reg = FloatRegister::from_code(code);
134 int offset = code * kFloatSize;
135 __ swc1(fpu_reg, MemOperand(sp, offset));
136 }
137
128 // Push saved_regs (needed to populate FrameDescription::registers_). 138 // Push saved_regs (needed to populate FrameDescription::registers_).
129 // Leave gaps for other registers. 139 // Leave gaps for other registers.
130 __ Dsubu(sp, sp, kNumberOfRegisters * kPointerSize); 140 __ Dsubu(sp, sp, kNumberOfRegisters * kPointerSize);
131 for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) { 141 for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) {
132 if ((saved_regs & (1 << i)) != 0) { 142 if ((saved_regs & (1 << i)) != 0) {
133 __ sd(ToRegister(i), MemOperand(sp, kPointerSize * i)); 143 __ sd(ToRegister(i), MemOperand(sp, kPointerSize * i));
134 } 144 }
135 } 145 }
136 146
137 __ li(a2, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate()))); 147 __ li(a2, Operand(ExternalReference(Isolate::kCEntryFPAddress, isolate())));
138 __ sd(fp, MemOperand(a2)); 148 __ sd(fp, MemOperand(a2));
139 149
140 const int kSavedRegistersAreaSize = 150 const int kSavedRegistersAreaSize =
141 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; 151 (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
142 152
143 // Get the bailout id from the stack. 153 // Get the bailout id from the stack.
144 __ ld(a2, MemOperand(sp, kSavedRegistersAreaSize)); 154 __ ld(a2, MemOperand(sp, kSavedRegistersAreaSize));
145 155
146 // Get the address of the location in the code object (a3) (return 156 // Get the address of the location in the code object (a3) (return
147 // address for lazy deoptimization) and compute the fp-to-sp delta in 157 // address for lazy deoptimization) and compute the fp-to-sp delta in
148 // register a4. 158 // register a4.
149 __ mov(a3, ra); 159 __ mov(a3, ra);
150 // Correct one word for bailout id. 160 // Correct one word for bailout id.
151 __ Daddu(a4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); 161 __ Daddu(a4, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 __ sd(a2, MemOperand(a1, offset)); 201 __ sd(a2, MemOperand(a1, offset));
192 } 202 }
193 } 203 }
194 204
195 int double_regs_offset = FrameDescription::double_registers_offset(); 205 int double_regs_offset = FrameDescription::double_registers_offset();
196 // Copy FPU registers to 206 // Copy FPU registers to
197 // double_registers_[DoubleRegister::kNumAllocatableRegisters] 207 // double_registers_[DoubleRegister::kNumAllocatableRegisters]
198 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { 208 for (int i = 0; i < config->num_allocatable_double_registers(); ++i) {
199 int code = config->GetAllocatableDoubleCode(i); 209 int code = config->GetAllocatableDoubleCode(i);
200 int dst_offset = code * kDoubleSize + double_regs_offset; 210 int dst_offset = code * kDoubleSize + double_regs_offset;
201 int src_offset = code * kDoubleSize + kNumberOfRegisters * kPointerSize; 211 int src_offset =
212 code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
202 __ ldc1(f0, MemOperand(sp, src_offset)); 213 __ ldc1(f0, MemOperand(sp, src_offset));
203 __ sdc1(f0, MemOperand(a1, dst_offset)); 214 __ sdc1(f0, MemOperand(a1, dst_offset));
204 } 215 }
205 216
217 int float_regs_offset = FrameDescription::float_registers_offset();
218 // Copy FPU registers to
219 // float_registers_[FloatRegister::kNumAllocatableRegisters]
220 for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
221 int code = config->GetAllocatableFloatCode(i);
222 int dst_offset = code * kFloatSize + float_regs_offset;
223 int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
224 __ lwc1(f0, MemOperand(sp, src_offset));
225 __ swc1(f0, MemOperand(a1, dst_offset));
226 }
227
206 // Remove the bailout id and the saved registers from the stack. 228 // Remove the bailout id and the saved registers from the stack.
207 __ Daddu(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); 229 __ Daddu(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize)));
208 230
209 // Compute a pointer to the unwinding limit in register a2; that is 231 // Compute a pointer to the unwinding limit in register a2; that is
210 // the first stack slot not part of the input frame. 232 // the first stack slot not part of the input frame.
211 __ ld(a2, MemOperand(a1, FrameDescription::frame_size_offset())); 233 __ ld(a2, MemOperand(a1, FrameDescription::frame_size_offset()));
212 __ Daddu(a2, a2, sp); 234 __ Daddu(a2, a2, sp);
213 235
214 // Unwind the stack down to - but not including - the unwinding 236 // Unwind the stack down to - but not including - the unwinding
215 // limit and copy the contents of the activation frame to the input 237 // limit and copy the contents of the activation frame to the input
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // No embedded constant pool support. 403 // No embedded constant pool support.
382 UNREACHABLE(); 404 UNREACHABLE();
383 } 405 }
384 406
385 407
386 #undef __ 408 #undef __
387 409
388 410
389 } // namespace internal 411 } // namespace internal
390 } // namespace v8 412 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips/deoptimizer-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698