| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 | 183 |
| 184 | 184 |
| 185 // Simple helper function to detect whether the C code is compiled with | 185 // Simple helper function to detect whether the C code is compiled with |
| 186 // option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register | 186 // option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register |
| 187 // pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then | 187 // pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then |
| 188 // calling this will return 1.0 and otherwise 0.0. | 188 // calling this will return 1.0 and otherwise 0.0. |
| 189 static void ArmUsingHardFloatHelper() { | 189 static void ArmUsingHardFloatHelper() { |
| 190 asm("mov r0, #0"); | 190 asm("mov r0, #0":::"r0"); |
| 191 #if defined(__VFP_FP__) && !defined(__SOFTFP__) | 191 #if defined(__VFP_FP__) && !defined(__SOFTFP__) |
| 192 // Load 0x3ff00000 into r1 using instructions available in both ARM | 192 // Load 0x3ff00000 into r1 using instructions available in both ARM |
| 193 // and Thumb mode. | 193 // and Thumb mode. |
| 194 asm("mov r1, #3"); | 194 asm("mov r1, #3":::"r1"); |
| 195 asm("mov r2, #255"); | 195 asm("mov r2, #255":::"r2"); |
| 196 asm("lsl r1, r1, #8"); | 196 asm("lsl r1, r1, #8":::"r1"); |
| 197 asm("orr r1, r1, r2"); | 197 asm("orr r1, r1, r2":::"r1"); |
| 198 asm("lsl r1, r1, #20"); | 198 asm("lsl r1, r1, #20":::"r1"); |
| 199 // For vmov d0, r0, r1 use ARM mode. | 199 // For vmov d0, r0, r1 use ARM mode. |
| 200 #ifdef __thumb__ | 200 #ifdef __thumb__ |
| 201 asm volatile( | 201 asm volatile( |
| 202 "@ Enter ARM Mode \n\t" | 202 "@ Enter ARM Mode \n\t" |
| 203 " adr r3, 1f \n\t" | 203 " adr r3, 1f \n\t" |
| 204 " bx r3 \n\t" | 204 " bx r3 \n\t" |
| 205 " .ALIGN 4 \n\t" | 205 " .ALIGN 4 \n\t" |
| 206 " .ARM \n" | 206 " .ARM \n" |
| 207 "1: vmov d0, r0, r1 \n\t" | 207 "1: vmov d0, r0, r1 \n\t" |
| 208 "@ Enter THUMB Mode\n\t" | 208 "@ Enter THUMB Mode\n\t" |
| 209 " adr r3, 2f+1 \n\t" | 209 " adr r3, 2f+1 \n\t" |
| 210 " bx r3 \n\t" | 210 " bx r3 \n\t" |
| 211 " .THUMB \n" | 211 " .THUMB \n" |
| 212 "2: \n\t"); | 212 "2: \n\t":::"r3"); |
| 213 #else | 213 #else |
| 214 asm("vmov d0, r0, r1"); | 214 asm("vmov d0, r0, r1"); |
| 215 #endif // __thumb__ | 215 #endif // __thumb__ |
| 216 #endif // defined(__VFP_FP__) && !defined(__SOFTFP__) | 216 #endif // defined(__VFP_FP__) && !defined(__SOFTFP__) |
| 217 asm("mov r1, #0"); | 217 asm("mov r1, #0":::"r1"); |
| 218 } | 218 } |
| 219 | 219 |
| 220 | 220 |
| 221 bool OS::ArmUsingHardFloat() { | 221 bool OS::ArmUsingHardFloat() { |
| 222 // Cast helper function from returning void to returning double. | 222 // Cast helper function from returning void to returning double. |
| 223 typedef double (*F)(); | 223 typedef double (*F)(); |
| 224 F f = FUNCTION_CAST<F>(FUNCTION_ADDR(ArmUsingHardFloatHelper)); | 224 F f = FUNCTION_CAST<F>(FUNCTION_ADDR(ArmUsingHardFloatHelper)); |
| 225 return f() == 1.0; | 225 return f() == 1.0; |
| 226 } | 226 } |
| 227 #endif // def __arm__ | 227 #endif // def __arm__ |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 | 1246 |
| 1247 | 1247 |
| 1248 void Sampler::Stop() { | 1248 void Sampler::Stop() { |
| 1249 ASSERT(IsActive()); | 1249 ASSERT(IsActive()); |
| 1250 SignalSender::RemoveActiveSampler(this); | 1250 SignalSender::RemoveActiveSampler(this); |
| 1251 SetActive(false); | 1251 SetActive(false); |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 | 1254 |
| 1255 } } // namespace v8::internal | 1255 } } // namespace v8::internal |
| OLD | NEW |