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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 __ movsd(Operand(rsp, offset), xmm_reg); | 149 __ movsd(Operand(rsp, offset), xmm_reg); |
150 } | 150 } |
151 | 151 |
152 // We push all registers onto the stack, even though we do not need | 152 // We push all registers onto the stack, even though we do not need |
153 // to restore all later. | 153 // to restore all later. |
154 for (int i = 0; i < kNumberOfRegisters; i++) { | 154 for (int i = 0; i < kNumberOfRegisters; i++) { |
155 Register r = Register::from_code(i); | 155 Register r = Register::from_code(i); |
156 __ push(r); | 156 __ push(r); |
157 } | 157 } |
158 | 158 |
159 const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + | 159 const int kSavedRegistersAreaSize = kNumberOfRegisters * kRegisterSize + |
160 kDoubleRegsSize; | 160 kDoubleRegsSize; |
161 | 161 |
162 // We use this to keep the value of the fifth argument temporarily. | 162 // We use this to keep the value of the fifth argument temporarily. |
163 // Unfortunately we can't store it directly in r8 (used for passing | 163 // Unfortunately we can't store it directly in r8 (used for passing |
164 // this on linux), since it is another parameter passing register on windows. | 164 // this on linux), since it is another parameter passing register on windows. |
165 Register arg5 = r11; | 165 Register arg5 = r11; |
166 | 166 |
167 // Get the bailout id from the stack. | 167 // Get the bailout id from the stack. |
168 __ movq(arg_reg_3, Operand(rsp, kSavedRegistersAreaSize)); | 168 __ movq(arg_reg_3, Operand(rsp, kSavedRegistersAreaSize)); |
169 | 169 |
170 // Get the address of the location in the code object | 170 // Get the address of the location in the code object |
171 // and compute the fp-to-sp delta in register arg5. | 171 // and compute the fp-to-sp delta in register arg5. |
172 __ movq(arg_reg_4, | 172 __ movq(arg_reg_4, Operand(rsp, kSavedRegistersAreaSize + 1 * kRegisterSize)); |
173 Operand(rsp, kSavedRegistersAreaSize + 1 * kPointerSize)); | 173 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 1 * kRegisterSize + |
174 __ lea(arg5, Operand(rsp, kSavedRegistersAreaSize + 2 * kPointerSize)); | 174 kPCOnStackSize)); |
175 | 175 |
176 __ subq(arg5, rbp); | 176 __ subq(arg5, rbp); |
177 __ neg(arg5); | 177 __ neg(arg5); |
178 | 178 |
179 // Allocate a new deoptimizer object. | 179 // Allocate a new deoptimizer object. |
180 __ PrepareCallCFunction(6); | 180 __ PrepareCallCFunction(6); |
181 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 181 __ movq(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
182 __ movq(arg_reg_1, rax); | 182 __ movq(arg_reg_1, rax); |
183 __ Set(arg_reg_2, type()); | 183 __ Set(arg_reg_2, type()); |
184 // Args 3 and 4 are already in the right registers. | 184 // Args 3 and 4 are already in the right registers. |
(...skipping 23 matching lines...) Expand all Loading... |
208 } | 208 } |
209 | 209 |
210 // Fill in the double input registers. | 210 // Fill in the double input registers. |
211 int double_regs_offset = FrameDescription::double_registers_offset(); | 211 int double_regs_offset = FrameDescription::double_registers_offset(); |
212 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { | 212 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { |
213 int dst_offset = i * kDoubleSize + double_regs_offset; | 213 int dst_offset = i * kDoubleSize + double_regs_offset; |
214 __ pop(Operand(rbx, dst_offset)); | 214 __ pop(Operand(rbx, dst_offset)); |
215 } | 215 } |
216 | 216 |
217 // Remove the bailout id and return address from the stack. | 217 // Remove the bailout id and return address from the stack. |
218 __ addq(rsp, Immediate(2 * kPointerSize)); | 218 __ addq(rsp, Immediate(1 * kRegisterSize + kPCOnStackSize)); |
219 | 219 |
220 // Compute a pointer to the unwinding limit in register rcx; that is | 220 // Compute a pointer to the unwinding limit in register rcx; that is |
221 // the first stack slot not part of the input frame. | 221 // the first stack slot not part of the input frame. |
222 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); | 222 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); |
223 __ addq(rcx, rsp); | 223 __ addq(rcx, rsp); |
224 | 224 |
225 // Unwind the stack down to - but not including - the unwinding | 225 // Unwind the stack down to - but not including - the unwinding |
226 // limit and copy the contents of the activation frame to the input | 226 // limit and copy the contents of the activation frame to the input |
227 // frame description. | 227 // frame description. |
228 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); | 228 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 SetFrameSlot(offset, value); | 334 SetFrameSlot(offset, value); |
335 } | 335 } |
336 | 336 |
337 | 337 |
338 #undef __ | 338 #undef __ |
339 | 339 |
340 | 340 |
341 } } // namespace v8::internal | 341 } } // namespace v8::internal |
342 | 342 |
343 #endif // V8_TARGET_ARCH_X64 | 343 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |