| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 static Isolate* GetIsolateFrom(LocalContext* context) { | 138 static Isolate* GetIsolateFrom(LocalContext* context) { |
| 139 return reinterpret_cast<Isolate*>((*context)->GetIsolate()); | 139 return reinterpret_cast<Isolate*>((*context)->GetIsolate()); |
| 140 } | 140 } |
| 141 | 141 |
| 142 | 142 |
| 143 int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func, | 143 int32_t RunGeneratedCodeCallWrapper(ConvertDToIFunc func, |
| 144 double from) { | 144 double from) { |
| 145 #ifdef USE_SIMULATOR | 145 #ifdef USE_SIMULATOR |
| 146 Simulator::current(Isolate::Current())->CallFP(FUNCTION_ADDR(func), from, 0.); | 146 Simulator::current(Isolate::Current())->CallFP(FUNCTION_ADDR(func), from, 0.); |
| 147 return Simulator::current(Isolate::Current())->get_register(v0.code()); | 147 return static_cast<int32_t>( |
| 148 Simulator::current(Isolate::Current())->get_register(v0.code())); |
| 148 #else | 149 #else |
| 149 return (*func)(from); | 150 return (*func)(from); |
| 150 #endif | 151 #endif |
| 151 } | 152 } |
| 152 | 153 |
| 153 | 154 |
| 154 TEST(ConvertDToI) { | 155 TEST(ConvertDToI) { |
| 155 CcTest::InitializeVM(); | 156 CcTest::InitializeVM(); |
| 156 LocalContext context; | 157 LocalContext context; |
| 157 Isolate* isolate = GetIsolateFrom(&context); | 158 Isolate* isolate = GetIsolateFrom(&context); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 179 false)); | 180 false)); |
| 180 RunAllTruncationTests( | 181 RunAllTruncationTests( |
| 181 RunGeneratedCodeCallWrapper, | 182 RunGeneratedCodeCallWrapper, |
| 182 MakeConvertDToIFuncTrampoline(isolate, | 183 MakeConvertDToIFuncTrampoline(isolate, |
| 183 source_registers[s], | 184 source_registers[s], |
| 184 dest_registers[d], | 185 dest_registers[d], |
| 185 true)); | 186 true)); |
| 186 } | 187 } |
| 187 } | 188 } |
| 188 } | 189 } |
| OLD | NEW |