| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, | 48 ConvertDToIFunc MakeConvertDToIFuncTrampoline(Isolate* isolate, |
| 49 Register source_reg, | 49 Register source_reg, |
| 50 Register destination_reg) { | 50 Register destination_reg) { |
| 51 // Allocate an executable page of memory. | 51 // Allocate an executable page of memory. |
| 52 size_t actual_size; | 52 size_t actual_size; |
| 53 byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( | 53 byte* buffer = static_cast<byte*>(v8::base::OS::Allocate( |
| 54 Assembler::kMinimalBufferSize, &actual_size, true)); | 54 Assembler::kMinimalBufferSize, &actual_size, true)); |
| 55 CHECK(buffer); | 55 CHECK(buffer); |
| 56 HandleScope handles(isolate); | 56 HandleScope handles(isolate); |
| 57 MacroAssembler assm(isolate, buffer, static_cast<int>(actual_size)); | 57 MacroAssembler assm(isolate, buffer, static_cast<int>(actual_size), |
| 58 v8::internal::CodeObjectRequired::kYes); |
| 58 int offset = | 59 int offset = |
| 59 source_reg.is(rsp) ? 0 : (HeapNumber::kValueOffset - kSmiTagSize); | 60 source_reg.is(rsp) ? 0 : (HeapNumber::kValueOffset - kSmiTagSize); |
| 60 DoubleToIStub stub(isolate, source_reg, destination_reg, offset, true); | 61 DoubleToIStub stub(isolate, source_reg, destination_reg, offset, true); |
| 61 byte* start = stub.GetCode()->instruction_start(); | 62 byte* start = stub.GetCode()->instruction_start(); |
| 62 | 63 |
| 63 __ pushq(rbx); | 64 __ pushq(rbx); |
| 64 __ pushq(rcx); | 65 __ pushq(rcx); |
| 65 __ pushq(rdx); | 66 __ pushq(rdx); |
| 66 __ pushq(rsi); | 67 __ pushq(rsi); |
| 67 __ pushq(rdi); | 68 __ pushq(rdi); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 153 |
| 153 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { | 154 for (size_t s = 0; s < sizeof(source_registers) / sizeof(Register); s++) { |
| 154 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { | 155 for (size_t d = 0; d < sizeof(dest_registers) / sizeof(Register); d++) { |
| 155 RunAllTruncationTests( | 156 RunAllTruncationTests( |
| 156 MakeConvertDToIFuncTrampoline(isolate, | 157 MakeConvertDToIFuncTrampoline(isolate, |
| 157 source_registers[s], | 158 source_registers[s], |
| 158 dest_registers[d])); | 159 dest_registers[d])); |
| 159 } | 160 } |
| 160 } | 161 } |
| 161 } | 162 } |
| OLD | NEW |