| 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 compiled_code_->deoptimization_data()); | 214 optimized_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 = compiled_code_->stack_slots() * kPointerSize; | 251 unsigned stack_slot_size = optimized_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 compiled_code_->entry() + pc_offset); | 343 optimized_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 | |
| 526 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, | 462 void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, |
| 527 int frame_index) { | 463 int frame_index) { |
| 528 Builtins* builtins = isolate_->builtins(); | 464 Builtins* builtins = isolate_->builtins(); |
| 529 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric); | 465 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric); |
| 530 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next())); | 466 JSFunction* function = JSFunction::cast(ComputeLiteral(iterator->Next())); |
| 531 unsigned height = iterator->Next(); | 467 unsigned height = iterator->Next(); |
| 532 unsigned height_in_bytes = height * kPointerSize; | 468 unsigned height_in_bytes = height * kPointerSize; |
| 533 if (FLAG_trace_deopt) { | 469 if (FLAG_trace_deopt) { |
| 534 PrintF(" translating construct stub => height=%d\n", height_in_bytes); | 470 PrintF(" translating construct stub => height=%d\n", height_in_bytes); |
| 535 } | 471 } |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 | 871 |
| 936 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { | 872 void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { |
| 937 // Set the register values. The values are not important as there are no | 873 // Set the register values. The values are not important as there are no |
| 938 // callee saved registers in JavaScript frames, so all registers are | 874 // callee saved registers in JavaScript frames, so all registers are |
| 939 // spilled. Registers rbp and rsp are set to the correct values though. | 875 // spilled. Registers rbp and rsp are set to the correct values though. |
| 940 for (int i = 0; i < Register::kNumRegisters; i++) { | 876 for (int i = 0; i < Register::kNumRegisters; i++) { |
| 941 input_->SetRegister(i, i * 4); | 877 input_->SetRegister(i, i * 4); |
| 942 } | 878 } |
| 943 input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp())); | 879 input_->SetRegister(rsp.code(), reinterpret_cast<intptr_t>(frame->sp())); |
| 944 input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp())); | 880 input_->SetRegister(rbp.code(), reinterpret_cast<intptr_t>(frame->fp())); |
| 945 for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) { | 881 for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) { |
| 946 input_->SetDoubleRegister(i, 0.0); | 882 input_->SetDoubleRegister(i, 0.0); |
| 947 } | 883 } |
| 948 | 884 |
| 949 // Fill the frame content from the actual data on the frame. | 885 // Fill the frame content from the actual data on the frame. |
| 950 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { | 886 for (unsigned i = 0; i < input_->GetFrameSize(); i += kPointerSize) { |
| 951 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); | 887 input_->SetFrameSlot(i, Memory::uint64_at(tos + i)); |
| 952 } | 888 } |
| 953 } | 889 } |
| 954 | 890 |
| 955 | 891 |
| 956 #define __ masm()-> | 892 #define __ masm()-> |
| 957 | 893 |
| 958 void Deoptimizer::EntryGenerator::Generate() { | 894 void Deoptimizer::EntryGenerator::Generate() { |
| 959 GeneratePrologue(); | 895 GeneratePrologue(); |
| 960 | 896 |
| 961 // Save all general purpose registers before messing with them. | 897 // Save all general purpose registers before messing with them. |
| 962 const int kNumberOfRegisters = Register::kNumRegisters; | 898 const int kNumberOfRegisters = Register::kNumRegisters; |
| 963 | 899 |
| 964 const int kDoubleRegsSize = kDoubleSize * | 900 const int kDoubleRegsSize = kDoubleSize * |
| 965 XMMRegister::NumAllocatableRegisters(); | 901 XMMRegister::kNumAllocatableRegisters; |
| 966 __ subq(rsp, Immediate(kDoubleRegsSize)); | 902 __ subq(rsp, Immediate(kDoubleRegsSize)); |
| 967 | 903 |
| 968 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { | 904 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
| 969 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 905 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
| 970 int offset = i * kDoubleSize; | 906 int offset = i * kDoubleSize; |
| 971 __ movsd(Operand(rsp, offset), xmm_reg); | 907 __ movsd(Operand(rsp, offset), xmm_reg); |
| 972 } | 908 } |
| 973 | 909 |
| 974 // We push all registers onto the stack, even though we do not need | 910 // We push all registers onto the stack, even though we do not need |
| 975 // to restore all later. | 911 // to restore all later. |
| 976 for (int i = 0; i < kNumberOfRegisters; i++) { | 912 for (int i = 0; i < kNumberOfRegisters; i++) { |
| 977 Register r = Register::from_code(i); | 913 Register r = Register::from_code(i); |
| 978 __ push(r); | 914 __ push(r); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); | 983 __ movq(rbx, Operand(rax, Deoptimizer::input_offset())); |
| 1048 | 984 |
| 1049 // Fill in the input registers. | 985 // Fill in the input registers. |
| 1050 for (int i = kNumberOfRegisters -1; i >= 0; i--) { | 986 for (int i = kNumberOfRegisters -1; i >= 0; i--) { |
| 1051 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 987 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
| 1052 __ pop(Operand(rbx, offset)); | 988 __ pop(Operand(rbx, offset)); |
| 1053 } | 989 } |
| 1054 | 990 |
| 1055 // Fill in the double input registers. | 991 // Fill in the double input registers. |
| 1056 int double_regs_offset = FrameDescription::double_registers_offset(); | 992 int double_regs_offset = FrameDescription::double_registers_offset(); |
| 1057 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { | 993 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; i++) { |
| 1058 int dst_offset = i * kDoubleSize + double_regs_offset; | 994 int dst_offset = i * kDoubleSize + double_regs_offset; |
| 1059 __ pop(Operand(rbx, dst_offset)); | 995 __ pop(Operand(rbx, dst_offset)); |
| 1060 } | 996 } |
| 1061 | 997 |
| 1062 // Remove the bailout id from the stack. | 998 // Remove the bailout id from the stack. |
| 1063 if (type() == EAGER) { | 999 if (type() == EAGER) { |
| 1064 __ addq(rsp, Immediate(kPointerSize)); | 1000 __ addq(rsp, Immediate(kPointerSize)); |
| 1065 } else { | 1001 } else { |
| 1066 __ addq(rsp, Immediate(2 * kPointerSize)); | 1002 __ addq(rsp, Immediate(2 * kPointerSize)); |
| 1067 } | 1003 } |
| 1068 | 1004 |
| 1069 // Compute a pointer to the unwinding limit in register rcx; that is | 1005 // Compute a pointer to the unwinding limit in register rcx; that is |
| 1070 // the first stack slot not part of the input frame. | 1006 // the first stack slot not part of the input frame. |
| 1071 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); | 1007 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); |
| 1072 __ addq(rcx, rsp); | 1008 __ addq(rcx, rsp); |
| 1073 | 1009 |
| 1074 // Unwind the stack down to - but not including - the unwinding | 1010 // Unwind the stack down to - but not including - the unwinding |
| 1075 // limit and copy the contents of the activation frame to the input | 1011 // limit and copy the contents of the activation frame to the input |
| 1076 // frame description. | 1012 // frame description. |
| 1077 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); | 1013 __ lea(rdx, Operand(rbx, FrameDescription::frame_content_offset())); |
| 1078 Label pop_loop_header; | |
| 1079 __ jmp(&pop_loop_header); | |
| 1080 Label pop_loop; | 1014 Label pop_loop; |
| 1081 __ bind(&pop_loop); | 1015 __ bind(&pop_loop); |
| 1082 __ pop(Operand(rdx, 0)); | 1016 __ pop(Operand(rdx, 0)); |
| 1083 __ addq(rdx, Immediate(sizeof(intptr_t))); | 1017 __ addq(rdx, Immediate(sizeof(intptr_t))); |
| 1084 __ bind(&pop_loop_header); | |
| 1085 __ cmpq(rcx, rsp); | 1018 __ cmpq(rcx, rsp); |
| 1086 __ j(not_equal, &pop_loop); | 1019 __ j(not_equal, &pop_loop); |
| 1087 | 1020 |
| 1088 // Compute the output frame in the deoptimizer. | 1021 // Compute the output frame in the deoptimizer. |
| 1089 __ push(rax); | 1022 __ push(rax); |
| 1090 __ PrepareCallCFunction(2); | 1023 __ PrepareCallCFunction(2); |
| 1091 __ movq(arg1, rax); | 1024 __ movq(arg1, rax); |
| 1092 __ LoadAddress(arg2, ExternalReference::isolate_address()); | 1025 __ LoadAddress(arg2, ExternalReference::isolate_address()); |
| 1093 { | 1026 { |
| 1094 AllowExternalCallThatCantCauseGC scope(masm()); | 1027 AllowExternalCallThatCantCauseGC scope(masm()); |
| 1095 __ CallCFunction( | 1028 __ CallCFunction( |
| 1096 ExternalReference::compute_output_frames_function(isolate), 2); | 1029 ExternalReference::compute_output_frames_function(isolate), 2); |
| 1097 } | 1030 } |
| 1098 __ pop(rax); | 1031 __ pop(rax); |
| 1099 | 1032 |
| 1100 // Replace the current frame with the output frames. | 1033 // Replace the current frame with the output frames. |
| 1101 Label outer_push_loop, inner_push_loop, | 1034 Label outer_push_loop, inner_push_loop; |
| 1102 outer_loop_header, inner_loop_header; | |
| 1103 // Outer loop state: rax = current FrameDescription**, rdx = one past the | 1035 // Outer loop state: rax = current FrameDescription**, rdx = one past the |
| 1104 // last FrameDescription**. | 1036 // last FrameDescription**. |
| 1105 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); | 1037 __ movl(rdx, Operand(rax, Deoptimizer::output_count_offset())); |
| 1106 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); | 1038 __ movq(rax, Operand(rax, Deoptimizer::output_offset())); |
| 1107 __ lea(rdx, Operand(rax, rdx, times_8, 0)); | 1039 __ lea(rdx, Operand(rax, rdx, times_8, 0)); |
| 1108 __ jmp(&outer_loop_header); | |
| 1109 __ bind(&outer_push_loop); | 1040 __ bind(&outer_push_loop); |
| 1110 // Inner loop state: rbx = current FrameDescription*, rcx = loop index. | 1041 // Inner loop state: rbx = current FrameDescription*, rcx = loop index. |
| 1111 __ movq(rbx, Operand(rax, 0)); | 1042 __ movq(rbx, Operand(rax, 0)); |
| 1112 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); | 1043 __ movq(rcx, Operand(rbx, FrameDescription::frame_size_offset())); |
| 1113 __ jmp(&inner_loop_header); | |
| 1114 __ bind(&inner_push_loop); | 1044 __ bind(&inner_push_loop); |
| 1115 __ subq(rcx, Immediate(sizeof(intptr_t))); | 1045 __ subq(rcx, Immediate(sizeof(intptr_t))); |
| 1116 __ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); | 1046 __ push(Operand(rbx, rcx, times_1, FrameDescription::frame_content_offset())); |
| 1117 __ bind(&inner_loop_header); | |
| 1118 __ testq(rcx, rcx); | 1047 __ testq(rcx, rcx); |
| 1119 __ j(not_zero, &inner_push_loop); | 1048 __ j(not_zero, &inner_push_loop); |
| 1120 __ addq(rax, Immediate(kPointerSize)); | 1049 __ addq(rax, Immediate(kPointerSize)); |
| 1121 __ bind(&outer_loop_header); | |
| 1122 __ cmpq(rax, rdx); | 1050 __ cmpq(rax, rdx); |
| 1123 __ j(below, &outer_push_loop); | 1051 __ j(below, &outer_push_loop); |
| 1124 | 1052 |
| 1125 // In case of OSR, we have to restore the XMM registers. | 1053 // In case of OSR, we have to restore the XMM registers. |
| 1126 if (type() == OSR) { | 1054 if (type() == OSR) { |
| 1127 for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); ++i) { | 1055 for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
| 1128 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); | 1056 XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
| 1129 int src_offset = i * kDoubleSize + double_regs_offset; | 1057 int src_offset = i * kDoubleSize + double_regs_offset; |
| 1130 __ movsd(xmm_reg, Operand(rbx, src_offset)); | 1058 __ movsd(xmm_reg, Operand(rbx, src_offset)); |
| 1131 } | 1059 } |
| 1132 } | 1060 } |
| 1133 | 1061 |
| 1134 // Push state, pc, and continuation from the last output frame. | 1062 // Push state, pc, and continuation from the last output frame. |
| 1135 if (type() != OSR) { | 1063 if (type() != OSR) { |
| 1136 __ push(Operand(rbx, FrameDescription::state_offset())); | 1064 __ push(Operand(rbx, FrameDescription::state_offset())); |
| 1137 } | 1065 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 } | 1105 } |
| 1178 __ bind(&done); | 1106 __ bind(&done); |
| 1179 } | 1107 } |
| 1180 | 1108 |
| 1181 #undef __ | 1109 #undef __ |
| 1182 | 1110 |
| 1183 | 1111 |
| 1184 } } // namespace v8::internal | 1112 } } // namespace v8::internal |
| 1185 | 1113 |
| 1186 #endif // V8_TARGET_ARCH_X64 | 1114 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |