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 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 for (int i = 0; i < descriptor->register_param_count_; ++i) { | 527 for (int i = 0; i < descriptor->register_param_count_; ++i) { |
528 output_frame_offset -= kPointerSize; | 528 output_frame_offset -= kPointerSize; |
529 DoTranslateCommand(iterator, 0, output_frame_offset); | 529 DoTranslateCommand(iterator, 0, output_frame_offset); |
530 } | 530 } |
531 | 531 |
532 value = input_->GetRegister(rbp.code()); | 532 value = input_->GetRegister(rbp.code()); |
533 output_frame->SetRegister(rbp.code(), value); | 533 output_frame->SetRegister(rbp.code(), value); |
534 output_frame->SetFp(value); | 534 output_frame->SetFp(value); |
535 | 535 |
| 536 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { |
| 537 double double_value = input_->GetDoubleRegister(i); |
| 538 output_frame->SetDoubleRegister(i, double_value); |
| 539 } |
| 540 |
536 intptr_t handler = | 541 intptr_t handler = |
537 reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_); | 542 reinterpret_cast<intptr_t>(descriptor->deoptimization_handler_); |
538 output_frame->SetRegister(rax.code(), descriptor->register_param_count_); | 543 output_frame->SetRegister(rax.code(), descriptor->register_param_count_); |
539 output_frame->SetRegister(rbx.code(), handler); | 544 output_frame->SetRegister(rbx.code(), handler); |
540 } | 545 } |
541 | 546 |
542 | 547 |
543 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, | 548 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, |
544 int frame_index) { | 549 int frame_index) { |
545 Builtins* builtins = isolate_->builtins(); | 550 Builtins* builtins = isolate_->builtins(); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 __ subq(rcx, Immediate(sizeof(intptr_t))); | 1137 __ subq(rcx, Immediate(sizeof(intptr_t))); |
1133 __ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); | 1138 __ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); |
1134 __ bind(&inner_loop_header); | 1139 __ bind(&inner_loop_header); |
1135 __ testq(rcx, rcx); | 1140 __ testq(rcx, rcx); |
1136 __ j(not_zero, &inner_push_loop); | 1141 __ j(not_zero, &inner_push_loop); |
1137 __ addq(rax, Immediate(kPointerSize)); | 1142 __ addq(rax, Immediate(kPointerSize)); |
1138 __ bind(&outer_loop_header); | 1143 __ bind(&outer_loop_header); |
1139 __ cmpq(rax, rdx); | 1144 __ cmpq(rax, rdx); |
1140 __ j(below, &outer_push_loop); | 1145 __ j(below, &outer_push_loop); |
1141 | 1146 |
1142 // In case of OSR, we have to restore the XMM registers. | 1147 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { |
1143 if (type() == OSR) { | 1148 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
1144 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { | 1149 int src_offset = i * kDoubleSize + double_regs_offset; |
1145 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 1150 __ movsd(xmm_reg, Operand(rbx, src_offset)); |
1146 int src_offset = i * kDoubleSize + double_regs_offset; | |
1147 __ movsd(xmm_reg, Operand(rbx, src_offset)); | |
1148 } | |
1149 } | 1151 } |
1150 | 1152 |
1151 // Push state, pc, and continuation from the last output frame. | 1153 // Push state, pc, and continuation from the last output frame. |
1152 if (type() != OSR) { | 1154 if (type() != OSR) { |
1153 __ push(Operand(rbx, FrameDescription::state_offset())); | 1155 __ push(Operand(rbx, FrameDescription::state_offset())); |
1154 } | 1156 } |
1155 __ push(Operand(rbx, FrameDescription::pc_offset())); | 1157 __ push(Operand(rbx, FrameDescription::pc_offset())); |
1156 __ push(Operand(rbx, FrameDescription::continuation_offset())); | 1158 __ push(Operand(rbx, FrameDescription::continuation_offset())); |
1157 | 1159 |
1158 // Push the registers from the last output frame. | 1160 // Push the registers from the last output frame. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 } | 1196 } |
1195 __ bind(&done); | 1197 __ bind(&done); |
1196 } | 1198 } |
1197 | 1199 |
1198 #undef __ | 1200 #undef __ |
1199 | 1201 |
1200 | 1202 |
1201 } } // namespace v8::internal | 1203 } } // namespace v8::internal |
1202 | 1204 |
1203 #endif // V8_TARGET_ARCH_X64 | 1205 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |