| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 __ push(edi); | 65 __ push(edi); |
| 66 | 66 |
| 67 if (!source_reg.is(esp)) { | 67 if (!source_reg.is(esp)) { |
| 68 __ lea(source_reg, MemOperand(esp, 6 * kPointerSize - offset)); | 68 __ lea(source_reg, MemOperand(esp, 6 * kPointerSize - offset)); |
| 69 } | 69 } |
| 70 | 70 |
| 71 int param_offset = 7 * kPointerSize; | 71 int param_offset = 7 * kPointerSize; |
| 72 // Save registers make sure they don't get clobbered. | 72 // Save registers make sure they don't get clobbered. |
| 73 int reg_num = 0; | 73 int reg_num = 0; |
| 74 for (; reg_num < Register::kNumRegisters; ++reg_num) { | 74 for (; reg_num < Register::kNumRegisters; ++reg_num) { |
| 75 Register reg = Register::from_code(reg_num); | 75 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( |
| 76 if (reg.IsAllocatable()) { | 76 reg_num)) { |
| 77 Register reg = Register::from_code(reg_num); |
| 77 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { | 78 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { |
| 78 __ push(reg); | 79 __ push(reg); |
| 79 param_offset += kPointerSize; | 80 param_offset += kPointerSize; |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| 84 // Re-push the double argument | 85 // Re-push the double argument |
| 85 __ push(MemOperand(esp, param_offset)); | 86 __ push(MemOperand(esp, param_offset)); |
| 86 __ push(MemOperand(esp, param_offset)); | 87 __ push(MemOperand(esp, param_offset)); |
| 87 | 88 |
| 88 // Call through to the actual stub | 89 // Call through to the actual stub |
| 89 __ call(start, RelocInfo::EXTERNAL_REFERENCE); | 90 __ call(start, RelocInfo::EXTERNAL_REFERENCE); |
| 90 | 91 |
| 91 __ add(esp, Immediate(kDoubleSize)); | 92 __ add(esp, Immediate(kDoubleSize)); |
| 92 | 93 |
| 93 // Make sure no registers have been unexpectedly clobbered | 94 // Make sure no registers have been unexpectedly clobbered |
| 94 for (--reg_num; reg_num >= 0; --reg_num) { | 95 for (--reg_num; reg_num >= 0; --reg_num) { |
| 95 Register reg = Register::from_code(reg_num); | 96 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( |
| 96 if (reg.IsAllocatable()) { | 97 reg_num)) { |
| 98 Register reg = Register::from_code(reg_num); |
| 97 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { | 99 if (!reg.is(esp) && !reg.is(ebp) && !reg.is(destination_reg)) { |
| 98 __ cmp(reg, MemOperand(esp, 0)); | 100 __ cmp(reg, MemOperand(esp, 0)); |
| 99 __ Assert(equal, kRegisterWasClobbered); | 101 __ Assert(equal, kRegisterWasClobbered); |
| 100 __ add(esp, Immediate(kPointerSize)); | 102 __ add(esp, Immediate(kPointerSize)); |
| 101 } | 103 } |
| 102 } | 104 } |
| 103 } | 105 } |
| 104 | 106 |
| 105 __ mov(eax, destination_reg); | 107 __ mov(eax, destination_reg); |
| 106 | 108 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 146 |
| 145 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { | 147 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { |
| 146 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { | 148 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { |
| 147 RunAllTruncationTests( | 149 RunAllTruncationTests( |
| 148 MakeConvertDToIFuncTrampoline(isolate, | 150 MakeConvertDToIFuncTrampoline(isolate, |
| 149 source_registers[s], | 151 source_registers[s], |
| 150 dest_registers[d])); | 152 dest_registers[d])); |
| 151 } | 153 } |
| 152 } | 154 } |
| 153 } | 155 } |
| OLD | NEW |