| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Rrdistribution and use in source and binary forms, with or without | 2 // Rrdistribution 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 // * Rrdistributions of source code must retain the above copyright | 6 // * Rrdistributions 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 // * Rrdistributions in binary form must reproduce the above | 8 // * Rrdistributions 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Push the double argument. | 67 // Push the double argument. |
| 68 __ Push(d0); | 68 __ Push(d0); |
| 69 __ Mov(source_reg, jssp); | 69 __ Mov(source_reg, jssp); |
| 70 | 70 |
| 71 MacroAssembler::PushPopQueue queue(&masm); | 71 MacroAssembler::PushPopQueue queue(&masm); |
| 72 | 72 |
| 73 // Save registers make sure they don't get clobbered. | 73 // Save registers make sure they don't get clobbered. |
| 74 int source_reg_offset = kDoubleSize; | 74 int source_reg_offset = kDoubleSize; |
| 75 int reg_num = 0; | 75 int reg_num = 0; |
| 76 for (; reg_num < Register::kNumRegisters; ++reg_num) { | 76 for (; reg_num < Register::kNumRegisters; ++reg_num) { |
| 77 Register reg = Register::from_code(reg_num); | 77 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( |
| 78 if (reg.IsAllocatable()) { | 78 reg_num)) { |
| 79 Register reg = Register::from_code(reg_num); |
| 79 if (!reg.is(destination_reg)) { | 80 if (!reg.is(destination_reg)) { |
| 80 queue.Queue(reg); | 81 queue.Queue(reg); |
| 81 source_reg_offset += kPointerSize; | 82 source_reg_offset += kPointerSize; |
| 82 } | 83 } |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 // Re-push the double argument. | 86 // Re-push the double argument. |
| 86 queue.Queue(d0); | 87 queue.Queue(d0); |
| 87 | 88 |
| 88 queue.PushQueued(); | 89 queue.PushQueued(); |
| 89 | 90 |
| 90 // Call through to the actual stub | 91 // Call through to the actual stub |
| 91 if (inline_fastpath) { | 92 if (inline_fastpath) { |
| 92 __ Ldr(d0, MemOperand(source_reg)); | 93 __ Ldr(d0, MemOperand(source_reg)); |
| 93 __ TryConvertDoubleToInt64(destination_reg, d0, &done); | 94 __ TryConvertDoubleToInt64(destination_reg, d0, &done); |
| 94 if (destination_reg.is(source_reg)) { | 95 if (destination_reg.is(source_reg)) { |
| 95 // Restore clobbered source_reg. | 96 // Restore clobbered source_reg. |
| 96 __ add(source_reg, jssp, Operand(source_reg_offset)); | 97 __ add(source_reg, jssp, Operand(source_reg_offset)); |
| 97 } | 98 } |
| 98 } | 99 } |
| 99 __ Call(start, RelocInfo::EXTERNAL_REFERENCE); | 100 __ Call(start, RelocInfo::EXTERNAL_REFERENCE); |
| 100 __ bind(&done); | 101 __ bind(&done); |
| 101 | 102 |
| 102 __ Drop(1, kDoubleSize); | 103 __ Drop(1, kDoubleSize); |
| 103 | 104 |
| 104 // // Make sure no registers have been unexpectedly clobbered | 105 // // Make sure no registers have been unexpectedly clobbered |
| 105 for (--reg_num; reg_num >= 0; --reg_num) { | 106 for (--reg_num; reg_num >= 0; --reg_num) { |
| 106 Register reg = Register::from_code(reg_num); | 107 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( |
| 107 if (reg.IsAllocatable()) { | 108 reg_num)) { |
| 109 Register reg = Register::from_code(reg_num); |
| 108 if (!reg.is(destination_reg)) { | 110 if (!reg.is(destination_reg)) { |
| 109 __ Pop(ip0); | 111 __ Pop(ip0); |
| 110 __ cmp(reg, ip0); | 112 __ cmp(reg, ip0); |
| 111 __ Assert(eq, kRegisterWasClobbered); | 113 __ Assert(eq, kRegisterWasClobbered); |
| 112 } | 114 } |
| 113 } | 115 } |
| 114 } | 116 } |
| 115 | 117 |
| 116 __ Drop(1, kDoubleSize); | 118 __ Drop(1, kDoubleSize); |
| 117 | 119 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 false)); | 187 false)); |
| 186 RunAllTruncationTests( | 188 RunAllTruncationTests( |
| 187 RunGeneratedCodeCallWrapper, | 189 RunGeneratedCodeCallWrapper, |
| 188 MakeConvertDToIFuncTrampoline(isolate, | 190 MakeConvertDToIFuncTrampoline(isolate, |
| 189 source_registers[s], | 191 source_registers[s], |
| 190 dest_registers[d], | 192 dest_registers[d], |
| 191 true)); | 193 true)); |
| 192 } | 194 } |
| 193 } | 195 } |
| 194 } | 196 } |
| OLD | NEW |