| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #include <stdlib.h> | 28 #include <stdlib.h> |
| 29 | 29 |
| 30 #include "src/v8.h" | 30 #include "src/v8.h" |
| 31 | 31 |
| 32 #include "src/base/platform/platform.h" | 32 #include "src/base/platform/platform.h" |
| 33 #include "src/code-stubs.h" | 33 #include "src/code-stubs.h" |
| 34 #include "src/factory.h" | 34 #include "src/factory.h" |
| 35 #include "src/macro-assembler.h" | 35 #include "src/macro-assembler.h" |
| 36 #include "src/mips64/constants-mips64.h" | 36 #include "src/mips64/constants-mips64.h" |
| 37 #include "src/register-configuration.h" |
| 37 #include "src/simulator.h" | 38 #include "src/simulator.h" |
| 38 #include "test/cctest/cctest.h" | 39 #include "test/cctest/cctest.h" |
| 39 #include "test/cctest/test-code-stubs.h" | 40 #include "test/cctest/test-code-stubs.h" |
| 40 | 41 |
| 41 using namespace v8::internal; | 42 using namespace v8::internal; |
| 42 | 43 |
| 43 #define __ masm. | 44 #define __ masm. |
| 44 | 45 |
| 45 ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, | 46 ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, |
| 46 Register source_reg, | 47 Register source_reg, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 72 __ Move(f12, a0, a1); | 73 __ Move(f12, a0, a1); |
| 73 } | 74 } |
| 74 // Push the double argument. | 75 // Push the double argument. |
| 75 __ Dsubu(sp, sp, Operand(kDoubleSize)); | 76 __ Dsubu(sp, sp, Operand(kDoubleSize)); |
| 76 __ sdc1(f12, MemOperand(sp)); | 77 __ sdc1(f12, MemOperand(sp)); |
| 77 __ Move(source_reg, sp); | 78 __ Move(source_reg, sp); |
| 78 | 79 |
| 79 // Save registers make sure they don't get clobbered. | 80 // Save registers make sure they don't get clobbered. |
| 80 int source_reg_offset = kDoubleSize; | 81 int source_reg_offset = kDoubleSize; |
| 81 int reg_num = 2; | 82 int reg_num = 2; |
| 82 for (; reg_num < Register::NumAllocatableRegisters(); ++reg_num) { | 83 const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); |
| 84 for (; reg_num < config->num_allocatable_general_registers(); ++reg_num) { |
| 83 Register reg = Register::from_code(reg_num); | 85 Register reg = Register::from_code(reg_num); |
| 84 if (!reg.is(destination_reg)) { | 86 if (!reg.is(destination_reg)) { |
| 85 __ push(reg); | 87 __ push(reg); |
| 86 source_reg_offset += kPointerSize; | 88 source_reg_offset += kPointerSize; |
| 87 } | 89 } |
| 88 } | 90 } |
| 89 | 91 |
| 90 // Re-push the double argument. | 92 // Re-push the double argument. |
| 91 __ Dsubu(sp, sp, Operand(kDoubleSize)); | 93 __ Dsubu(sp, sp, Operand(kDoubleSize)); |
| 92 __ sdc1(f12, MemOperand(sp)); | 94 __ sdc1(f12, MemOperand(sp)); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 false)); | 190 false)); |
| 189 RunAllTruncationTests( | 191 RunAllTruncationTests( |
| 190 RunGeneratedCodeCallWrapper, | 192 RunGeneratedCodeCallWrapper, |
| 191 MakeConvertDToIFuncTrampoline(isolate, | 193 MakeConvertDToIFuncTrampoline(isolate, |
| 192 source_registers[s], | 194 source_registers[s], |
| 193 dest_registers[d], | 195 dest_registers[d], |
| 194 true)); | 196 true)); |
| 195 } | 197 } |
| 196 } | 198 } |
| 197 } | 199 } |
| OLD | NEW |