| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 masm.set_allow_stub_calls(false); | 56 masm.set_allow_stub_calls(false); |
| 57 DoubleToIStub stub(source_reg, destination_reg, 0, true, inline_fastpath); | 57 DoubleToIStub stub(source_reg, destination_reg, 0, true, inline_fastpath); |
| 58 | 58 |
| 59 byte* start = stub.GetCode(isolate)->instruction_start(); | 59 byte* start = stub.GetCode(isolate)->instruction_start(); |
| 60 Label done; | 60 Label done; |
| 61 | 61 |
| 62 // Save callee save registers. | 62 // Save callee save registers. |
| 63 __ Push(r7, r6, r5, r4); | 63 __ Push(r7, r6, r5, r4); |
| 64 __ Push(lr); | 64 __ Push(lr); |
| 65 | 65 |
| 66 // For softfp, move the input value into d0. |
| 67 if (!masm.use_eabi_hardfloat()) { |
| 68 __ vmov(d0, r0, r1); |
| 69 } |
| 66 // Push the double argument. | 70 // Push the double argument. |
| 67 __ vmov(d0, r0, r1); | |
| 68 __ sub(sp, sp, Operand(kDoubleSize)); | 71 __ sub(sp, sp, Operand(kDoubleSize)); |
| 69 __ vstr(d0, sp, 0); | 72 __ vstr(d0, sp, 0); |
| 70 if (!source_reg.is(sp)) { | 73 if (!source_reg.is(sp)) { |
| 71 __ mov(source_reg, sp); | 74 __ mov(source_reg, sp); |
| 72 } | 75 } |
| 73 | 76 |
| 74 // Save registers make sure they don't get clobbered. | 77 // Save registers make sure they don't get clobbered. |
| 75 int source_reg_offset = kDoubleSize; | 78 int source_reg_offset = kDoubleSize; |
| 76 int reg_num = 0; | 79 int reg_num = 0; |
| 77 for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) { | 80 for (;reg_num < Register::NumAllocatableRegisters(); ++reg_num) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 __ mov(r0, destination_reg); | 120 __ mov(r0, destination_reg); |
| 118 | 121 |
| 119 // Restore callee save registers. | 122 // Restore callee save registers. |
| 120 __ Pop(lr); | 123 __ Pop(lr); |
| 121 __ Pop(r7, r6, r5, r4); | 124 __ Pop(r7, r6, r5, r4); |
| 122 | 125 |
| 123 __ Ret(0); | 126 __ Ret(0); |
| 124 | 127 |
| 125 CodeDesc desc; | 128 CodeDesc desc; |
| 126 masm.GetCode(&desc); | 129 masm.GetCode(&desc); |
| 130 CPU::FlushICache(buffer, actual_size); |
| 127 return (reinterpret_cast<ConvertDToIFunc>( | 131 return (reinterpret_cast<ConvertDToIFunc>( |
| 128 reinterpret_cast<intptr_t>(buffer))); | 132 reinterpret_cast<intptr_t>(buffer))); |
| 129 } | 133 } |
| 130 | 134 |
| 131 #undef __ | 135 #undef __ |
| 132 | 136 |
| 133 | 137 |
| 134 static Isolate* GetIsolateFrom(LocalContext* context) { | 138 static Isolate* GetIsolateFrom(LocalContext* context) { |
| 135 return reinterpret_cast<Isolate*>((*context)->GetIsolate()); | 139 return reinterpret_cast<Isolate*>((*context)->GetIsolate()); |
| 136 } | 140 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 false)); | 176 false)); |
| 173 RunAllTruncationTests( | 177 RunAllTruncationTests( |
| 174 RunGeneratedCodeCallWrapper, | 178 RunGeneratedCodeCallWrapper, |
| 175 MakeConvertDToIFuncTrampoline(isolate, | 179 MakeConvertDToIFuncTrampoline(isolate, |
| 176 source_registers[s], | 180 source_registers[s], |
| 177 dest_registers[d], | 181 dest_registers[d], |
| 178 true)); | 182 true)); |
| 179 } | 183 } |
| 180 } | 184 } |
| 181 } | 185 } |
| OLD | NEW |