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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 if (value == 1) return i; | 204 if (value == 1) return i; |
205 } | 205 } |
206 } | 206 } |
207 UNREACHABLE(); | 207 UNREACHABLE(); |
208 return -1; | 208 return -1; |
209 } | 209 } |
210 | 210 |
211 | 211 |
212 void Deoptimizer::DoComputeOsrOutputFrame() { | 212 void Deoptimizer::DoComputeOsrOutputFrame() { |
213 DeoptimizationInputData* data = DeoptimizationInputData::cast( | 213 DeoptimizationInputData* data = DeoptimizationInputData::cast( |
214 optimized_code_->deoptimization_data()); | 214 compiled_code_->deoptimization_data()); |
215 unsigned ast_id = data->OsrAstId()->value(); | 215 unsigned ast_id = data->OsrAstId()->value(); |
216 // TODO(kasperl): This should not be the bailout_id_. It should be | 216 // TODO(kasperl): This should not be the bailout_id_. It should be |
217 // the ast id. Confusing. | 217 // the ast id. Confusing. |
218 ASSERT(bailout_id_ == ast_id); | 218 ASSERT(bailout_id_ == ast_id); |
219 | 219 |
220 int bailout_id = LookupBailoutId(data, BailoutId(ast_id)); | 220 int bailout_id = LookupBailoutId(data, BailoutId(ast_id)); |
221 unsigned translation_index = data->TranslationIndex(bailout_id)->value(); | 221 unsigned translation_index = data->TranslationIndex(bailout_id)->value(); |
222 ByteArray* translations = data->TranslationByteArray(); | 222 ByteArray* translations = data->TranslationByteArray(); |
223 | 223 |
224 TranslationIterator iterator(translations, translation_index); | 224 TranslationIterator iterator(translations, translation_index); |
(...skipping 16 matching lines...) Expand all Loading... |
241 USE(closure_id); | 241 USE(closure_id); |
242 ASSERT_EQ(Translation::kSelfLiteralId, closure_id); | 242 ASSERT_EQ(Translation::kSelfLiteralId, closure_id); |
243 unsigned height = iterator.Next(); | 243 unsigned height = iterator.Next(); |
244 unsigned height_in_bytes = height * kPointerSize; | 244 unsigned height_in_bytes = height * kPointerSize; |
245 USE(height_in_bytes); | 245 USE(height_in_bytes); |
246 | 246 |
247 unsigned fixed_size = ComputeFixedSize(function_); | 247 unsigned fixed_size = ComputeFixedSize(function_); |
248 unsigned input_frame_size = input_->GetFrameSize(); | 248 unsigned input_frame_size = input_->GetFrameSize(); |
249 ASSERT(fixed_size + height_in_bytes == input_frame_size); | 249 ASSERT(fixed_size + height_in_bytes == input_frame_size); |
250 | 250 |
251 unsigned stack_slot_size = optimized_code_->stack_slots() * kPointerSize; | 251 unsigned stack_slot_size = compiled_code_->stack_slots() * kPointerSize; |
252 unsigned outgoing_height = data->ArgumentsStackHeight(bailout_id)->value(); | 252 unsigned outgoing_height = data->ArgumentsStackHeight(bailout_id)->value(); |
253 unsigned outgoing_size = outgoing_height * kPointerSize; | 253 unsigned outgoing_size = outgoing_height * kPointerSize; |
254 unsigned output_frame_size = fixed_size + stack_slot_size + outgoing_size; | 254 unsigned output_frame_size = fixed_size + stack_slot_size + outgoing_size; |
255 ASSERT(outgoing_size == 0); // OSR does not happen in the middle of a call. | 255 ASSERT(outgoing_size == 0); // OSR does not happen in the middle of a call. |
256 | 256 |
257 if (FLAG_trace_osr) { | 257 if (FLAG_trace_osr) { |
258 PrintF("[on-stack replacement: begin 0x%08" V8PRIxPTR " ", | 258 PrintF("[on-stack replacement: begin 0x%08" V8PRIxPTR " ", |
259 reinterpret_cast<intptr_t>(function_)); | 259 reinterpret_cast<intptr_t>(function_)); |
260 function_->PrintName(); | 260 function_->PrintName(); |
261 PrintF(" => node=%u, frame=%d->%d]\n", | 261 PrintF(" => node=%u, frame=%d->%d]\n", |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 delete output_[0]; | 333 delete output_[0]; |
334 output_[0] = input_; | 334 output_[0] = input_; |
335 output_[0]->SetPc(reinterpret_cast<intptr_t>(from_)); | 335 output_[0]->SetPc(reinterpret_cast<intptr_t>(from_)); |
336 } else { | 336 } else { |
337 // Set up the frame pointer and the context pointer. | 337 // Set up the frame pointer and the context pointer. |
338 output_[0]->SetRegister(rbp.code(), input_->GetRegister(rbp.code())); | 338 output_[0]->SetRegister(rbp.code(), input_->GetRegister(rbp.code())); |
339 output_[0]->SetRegister(rsi.code(), input_->GetRegister(rsi.code())); | 339 output_[0]->SetRegister(rsi.code(), input_->GetRegister(rsi.code())); |
340 | 340 |
341 unsigned pc_offset = data->OsrPcOffset()->value(); | 341 unsigned pc_offset = data->OsrPcOffset()->value(); |
342 intptr_t pc = reinterpret_cast<intptr_t>( | 342 intptr_t pc = reinterpret_cast<intptr_t>( |
343 optimized_code_->entry() + pc_offset); | 343 compiled_code_->entry() + pc_offset); |
344 output_[0]->SetPc(pc); | 344 output_[0]->SetPc(pc); |
345 } | 345 } |
346 Code* continuation = | 346 Code* continuation = |
347 function_->GetIsolate()->builtins()->builtin(Builtins::kNotifyOSR); | 347 function_->GetIsolate()->builtins()->builtin(Builtins::kNotifyOSR); |
348 output_[0]->SetContinuation( | 348 output_[0]->SetContinuation( |
349 reinterpret_cast<intptr_t>(continuation->entry())); | 349 reinterpret_cast<intptr_t>(continuation->entry())); |
350 | 350 |
351 if (FLAG_trace_osr) { | 351 if (FLAG_trace_osr) { |
352 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", | 352 PrintF("[on-stack replacement translation %s: 0x%08" V8PRIxPTR " ", |
353 ok ? "finished" : "aborted", | 353 ok ? "finished" : "aborted", |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 Builtins* builtins = isolate_->builtins(); | 452 Builtins* builtins = isolate_->builtins(); |
453 Code* adaptor_trampoline = | 453 Code* adaptor_trampoline = |
454 builtins->builtin(Builtins::kArgumentsAdaptorTrampoline); | 454 builtins->builtin(Builtins::kArgumentsAdaptorTrampoline); |
455 intptr_t pc_value = reinterpret_cast<intptr_t>( | 455 intptr_t pc_value = reinterpret_cast<intptr_t>( |
456 adaptor_trampoline->instruction_start() + | 456 adaptor_trampoline->instruction_start() + |
457 isolate_->heap()->arguments_adaptor_deopt_pc_offset()->value()); | 457 isolate_->heap()->arguments_adaptor_deopt_pc_offset()->value()); |
458 output_frame->SetPc(pc_value); | 458 output_frame->SetPc(pc_value); |
459 } | 459 } |
460 | 460 |
461 | 461 |
| 462 void Deoptimizer::DoCompiledStubFrame(TranslationIterator* iterator, |
| 463 int frame_index) { |
| 464 // |
| 465 // FROM TO <-rbp |
| 466 // | .... | | .... | |
| 467 // +-------------------------+ +-------------------------+ |
| 468 // | JSFunction continuation | | JSFunction continuation | |
| 469 // +-------------------------+ +-------------------------+<-rsp |
| 470 // | | saved frame (rbp) | |
| 471 // | +=========================+<-rbp |
| 472 // | | JSFunction context | |
| 473 // v +-------------------------+ |
| 474 // | COMPILED_STUB marker | rbp = saved frame |
| 475 // +-------------------------+ rsi = JSFunction context |
| 476 // | | |
| 477 // | ... | |
| 478 // | | |
| 479 // +-------------------------+<-rsp |
| 480 // |
| 481 // |
| 482 int output_frame_size = 1 * kPointerSize; |
| 483 FrameDescription* output_frame = |
| 484 new(output_frame_size) FrameDescription(output_frame_size, 0); |
| 485 Code* notify_miss = |
| 486 isolate_->builtins()->builtin(Builtins::kNotifyICMiss); |
| 487 output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); |
| 488 output_frame->SetContinuation( |
| 489 reinterpret_cast<intptr_t>(notify_miss->entry())); |
| 490 |
| 491 ASSERT(compiled_code_->kind() == Code::COMPILED_STUB); |
| 492 int major_key = compiled_code_->major_key(); |
| 493 CodeStubInterfaceDescriptor* descriptor = |
| 494 isolate_->code_stub_interface_descriptors()[major_key]; |
| 495 Handle<Code> miss_ic(descriptor->deoptimization_handler); |
| 496 output_frame->SetPc(reinterpret_cast<intptr_t>(miss_ic->instruction_start())); |
| 497 unsigned input_frame_size = input_->GetFrameSize(); |
| 498 intptr_t value = input_->GetFrameSlot(input_frame_size - kPointerSize); |
| 499 output_frame->SetFrameSlot(0, value); |
| 500 value = input_->GetFrameSlot(input_frame_size - 2 * kPointerSize); |
| 501 output_frame->SetRegister(rbp.code(), value); |
| 502 output_frame->SetFp(value); |
| 503 value = input_->GetFrameSlot(input_frame_size - 3 * kPointerSize); |
| 504 output_frame->SetRegister(rsi.code(), value); |
| 505 |
| 506 Translation::Opcode opcode = |
| 507 static_cast<Translation::Opcode>(iterator->Next()); |
| 508 ASSERT(opcode == Translation::REGISTER); |
| 509 USE(opcode); |
| 510 int input_reg = iterator->Next(); |
| 511 intptr_t input_value = input_->GetRegister(input_reg); |
| 512 output_frame->SetRegister(rdx.code(), input_value); |
| 513 |
| 514 int32_t next = iterator->Next(); |
| 515 opcode = static_cast<Translation::Opcode>(next); |
| 516 ASSERT(opcode == Translation::REGISTER); |
| 517 input_reg = iterator->Next(); |
| 518 input_value = input_->GetRegister(input_reg); |
| 519 output_frame->SetRegister(rax.code(), input_value); |
| 520 |
| 521 ASSERT(frame_index == 0); |
| 522 output_[frame_index] = output_frame; |
| 523 } |
| 524 |
| 525 |
462 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, | 526 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, |
463 int frame_index) { | 527 int frame_index) { |
464 Builtins* builtins = isolate_->builtins(); | 528 Builtins* builtins = isolate_->builtins(); |
465 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric); | 529 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric); |
466 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next())); | 530 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next())); |
467 unsigned height = iterator->Next(); | 531 unsigned height = iterator->Next(); |
468 unsigned height_in_bytes = height * kPointerSize; | 532 unsigned height_in_bytes = height * kPointerSize; |
469 if (FLAG_trace_deopt) { | 533 if (FLAG_trace_deopt) { |
470 PrintF(" translating construct stub => height=%d\n", height_in_bytes); | 534 PrintF(" translating construct stub => height=%d\n", height_in_bytes); |
471 } | 535 } |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 935 |
872 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { | 936 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { |
873 // Set the register values. The values are not important as there are no | 937 // Set the register values. The values are not important as there are no |
874 // callee saved registers in JavaScript frames, so all registers are | 938 // callee saved registers in JavaScript frames, so all registers are |
875 // spilled. Registers rbp and rsp are set to the correct values though. | 939 // spilled. Registers rbp and rsp are set to the correct values though. |
876 for (int i = 0; i < Register::kNumRegisters; i++) { | 940 for (int i = 0; i < Register::kNumRegisters; i++) { |
877 input_->SetRegister(i, i * 4); | 941 input_->SetRegister(i, i * 4); |
878 } | 942 } |
879 input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp())); | 943 input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp())); |
880 input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp())); | 944 input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp())); |
881 for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) { | 945 for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) { |
882 input_->SetDoubleRegister(i, 0.0); | 946 input_->SetDoubleRegister(i, 0.0); |
883 } | 947 } |
884 | 948 |
885 // Fill the frame content from the actual data on the frame. | 949 // Fill the frame content from the actual data on the frame. |
886 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { | 950 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { |
887 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); | 951 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); |
888 } | 952 } |
889 } | 953 } |
890 | 954 |
891 | 955 |
892 #define __ masm()-> | 956 #define __ masm()-> |
893 | 957 |
894 void Deoptimizer::EntryGenerator::Generate() { | 958 void Deoptimizer::EntryGenerator::Generate() { |
895 GeneratePrologue(); | 959 GeneratePrologue(); |
896 | 960 |
897 // Save all general purpose registers before messing with them. | 961 // Save all general purpose registers before messing with them. |
898 const int kNumberOfRegisters = Register::kNumRegisters; | 962 const int kNumberOfRegisters = Register::kNumRegisters; |
899 | 963 |
900 const int kDoubleRegsSize = kDoubleSize * | 964 const int kDoubleRegsSize = kDoubleSize * |
901 XMMRegister::kNumAllocatableRegisters; | 965 XMMRegister::NumAllocatableRegisters(); |
902 __ subq(rsp, Immediate(kDoubleRegsSize)); | 966 __ subq(rsp, Immediate(kDoubleRegsSize)); |
903 | 967 |
904 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { | 968 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { |
905 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 969 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
906 int offset = i * kDoubleSize; | 970 int offset = i * kDoubleSize; |
907 __ movsd(Operand(rsp, offset), xmm_reg); | 971 __ movsd(Operand(rsp, offset), xmm_reg); |
908 } | 972 } |
909 | 973 |
910 // We push all registers onto the stack, even though we do not need | 974 // We push all registers onto the stack, even though we do not need |
911 // to restore all later. | 975 // to restore all later. |
912 for (int i = 0; i < kNumberOfRegisters; i++) { | 976 for (int i = 0; i < kNumberOfRegisters; i++) { |
913 Register r = Register::from_code(i); | 977 Register r = Register::from_code(i); |
914 __ push(r); | 978 __ push(r); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); | 1047 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); |
984 | 1048 |
985 // Fill in the input registers. | 1049 // Fill in the input registers. |
986 for (int i = kNumberOfRegisters -1; i >= 0; i--) { | 1050 for (int i = kNumberOfRegisters -1; i >= 0; i--) { |
987 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 1051 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
988 __ pop(Operand(rbx, offset)); | 1052 __ pop(Operand(rbx, offset)); |
989 } | 1053 } |
990 | 1054 |
991 // Fill in the double input registers. | 1055 // Fill in the double input registers. |
992 int double_regs_offset = FrameDescription::double_registers_offset(); | 1056 int double_regs_offset = FrameDescription::double_registers_offset(); |
993 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; i++) { | 1057 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { |
994 int dst_offset = i * kDoubleSize + double_regs_offset; | 1058 int dst_offset = i * kDoubleSize + double_regs_offset; |
995 __ pop(Operand(rbx, dst_offset)); | 1059 __ pop(Operand(rbx, dst_offset)); |
996 } | 1060 } |
997 | 1061 |
998 // Remove the bailout id from the stack. | 1062 // Remove the bailout id from the stack. |
999 if (type() == EAGER) { | 1063 if (type() == EAGER) { |
1000 __ addq(rsp, Immediate(kPointerSize)); | 1064 __ addq(rsp, Immediate(kPointerSize)); |
1001 } else { | 1065 } else { |
1002 __ addq(rsp, Immediate(2 * kPointerSize)); | 1066 __ addq(rsp, Immediate(2 * kPointerSize)); |
1003 } | 1067 } |
1004 | 1068 |
1005 // Compute a pointer to the unwinding limit in register rcx; that is | 1069 // Compute a pointer to the unwinding limit in register rcx; that is |
1006 // the first stack slot not part of the input frame. | 1070 // the first stack slot not part of the input frame. |
1007 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); | 1071 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); |
1008 __ addq(rcx, rsp); | 1072 __ addq(rcx, rsp); |
1009 | 1073 |
1010 // Unwind the stack down to - but not including - the unwinding | 1074 // Unwind the stack down to - but not including - the unwinding |
1011 // limit and copy the contents of the activation frame to the input | 1075 // limit and copy the contents of the activation frame to the input |
1012 // frame description. | 1076 // frame description. |
1013 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); | 1077 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); |
| 1078 Label pop_loop_header; |
| 1079 __ jmp(&pop_loop_header); |
1014 Label pop_loop; | 1080 Label pop_loop; |
1015 __ bind(&pop_loop); | 1081 __ bind(&pop_loop); |
1016 __ pop(Operand(rdx, 0)); | 1082 __ pop(Operand(rdx, 0)); |
1017 __ addq(rdx, Immediate(sizeof(intptr_t))); | 1083 __ addq(rdx, Immediate(sizeof(intptr_t))); |
| 1084 __ bind(&pop_loop_header); |
1018 __ cmpq(rcx, rsp); | 1085 __ cmpq(rcx, rsp); |
1019 __ j(not_equal, &pop_loop); | 1086 __ j(not_equal, &pop_loop); |
1020 | 1087 |
1021 // Compute the output frame in the deoptimizer. | 1088 // Compute the output frame in the deoptimizer. |
1022 __ push(rax); | 1089 __ push(rax); |
1023 __ PrepareCallCFunction(2); | 1090 __ PrepareCallCFunction(2); |
1024 __ movq(arg1, rax); | 1091 __ movq(arg1, rax); |
1025 __ LoadAddress(arg2, ExternalReference::isolate_address()); | 1092 __ LoadAddress(arg2, ExternalReference::isolate_address()); |
1026 { | 1093 { |
1027 AllowExternalCallThatCantCauseGC scope(masm()); | 1094 AllowExternalCallThatCantCauseGC scope(masm()); |
1028 __ CallCFunction( | 1095 __ CallCFunction( |
1029 ExternalReference::compute_output_frames_function(isolate), 2); | 1096 ExternalReference::compute_output_frames_function(isolate), 2); |
1030 } | 1097 } |
1031 __ pop(rax); | 1098 __ pop(rax); |
1032 | 1099 |
1033 // Replace the current frame with the output frames. | 1100 // Replace the current frame with the output frames. |
1034 Label outer_push_loop, inner_push_loop; | 1101 Label outer_push_loop, inner_push_loop, |
| 1102 outer_loop_header, inner_loop_header; |
1035 // Outer loop state: rax = current FrameDescription**, rdx = one past the | 1103 // Outer loop state: rax = current FrameDescription**, rdx = one past the |
1036 // last FrameDescription**. | 1104 // last FrameDescription**. |
1037 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); | 1105 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); |
1038 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); | 1106 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); |
1039 __ lea(rdx, Operand(rax, rdx, times_8, 0)); | 1107 __ lea(rdx, Operand(rax, rdx, times_8, 0)); |
| 1108 __ jmp(&outer_loop_header); |
1040 __ bind(&outer_push_loop); | 1109 __ bind(&outer_push_loop); |
1041 // Inner loop state: rbx = current FrameDescription*, rcx = loop index. | 1110 // Inner loop state: rbx = current FrameDescription*, rcx = loop index. |
1042 __ movq(rbx, Operand(rax, 0)); | 1111 __ movq(rbx, Operand(rax, 0)); |
1043 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); | 1112 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); |
| 1113 __ jmp(&inner_loop_header); |
1044 __ bind(&inner_push_loop); | 1114 __ bind(&inner_push_loop); |
1045 __ subq(rcx, Immediate(sizeof(intptr_t))); | 1115 __ subq(rcx, Immediate(sizeof(intptr_t))); |
1046 __ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); | 1116 __ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); |
| 1117 __ bind(&inner_loop_header); |
1047 __ testq(rcx, rcx); | 1118 __ testq(rcx, rcx); |
1048 __ j(not_zero, &inner_push_loop); | 1119 __ j(not_zero, &inner_push_loop); |
1049 __ addq(rax, Immediate(kPointerSize)); | 1120 __ addq(rax, Immediate(kPointerSize)); |
| 1121 __ bind(&outer_loop_header); |
1050 __ cmpq(rax, rdx); | 1122 __ cmpq(rax, rdx); |
1051 __ j(below, &outer_push_loop); | 1123 __ j(below, &outer_push_loop); |
1052 | 1124 |
1053 // In case of OSR, we have to restore the XMM registers. | 1125 // In case of OSR, we have to restore the XMM registers. |
1054 if (type() == OSR) { | 1126 if (type() == OSR) { |
1055 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { | 1127 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { |
1056 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 1128 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
1057 int src_offset = i * kDoubleSize + double_regs_offset; | 1129 int src_offset = i * kDoubleSize + double_regs_offset; |
1058 __ movsd(xmm_reg, Operand(rbx, src_offset)); | 1130 __ movsd(xmm_reg, Operand(rbx, src_offset)); |
1059 } | 1131 } |
1060 } | 1132 } |
1061 | 1133 |
1062 // Push state, pc, and continuation from the last output frame. | 1134 // Push state, pc, and continuation from the last output frame. |
1063 if (type() != OSR) { | 1135 if (type() != OSR) { |
1064 __ push(Operand(rbx, FrameDescription::state_offset())); | 1136 __ push(Operand(rbx, FrameDescription::state_offset())); |
1065 } | 1137 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 } | 1177 } |
1106 __ bind(&done); | 1178 __ bind(&done); |
1107 } | 1179 } |
1108 | 1180 |
1109 #undef __ | 1181 #undef __ |
1110 | 1182 |
1111 | 1183 |
1112 } } // namespace v8::internal | 1184 } } // namespace v8::internal |
1113 | 1185 |
1114 #endif // V8_TARGET_ARCH_X64 | 1186 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |