| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3331 __ bind(&calculate); | 3331 __ bind(&calculate); |
| 3332 Counters* counters = masm->isolate()->counters(); | 3332 Counters* counters = masm->isolate()->counters(); |
| 3333 __ IncrementCounter( | 3333 __ IncrementCounter( |
| 3334 counters->transcendental_cache_miss(), 1, scratch0, scratch1); | 3334 counters->transcendental_cache_miss(), 1, scratch0, scratch1); |
| 3335 if (tagged) { | 3335 if (tagged) { |
| 3336 __ bind(&invalid_cache); | 3336 __ bind(&invalid_cache); |
| 3337 ExternalReference runtime_function = | 3337 ExternalReference runtime_function = |
| 3338 ExternalReference(RuntimeFunction(), masm->isolate()); | 3338 ExternalReference(RuntimeFunction(), masm->isolate()); |
| 3339 __ TailCallExternalReference(runtime_function, 1, 1); | 3339 __ TailCallExternalReference(runtime_function, 1, 1); |
| 3340 } else { | 3340 } else { |
| 3341 if (!CpuFeatures::IsSupported(VFP3)) UNREACHABLE(); | 3341 ASSERT(CpuFeatures::IsSupported(VFP3)); |
| 3342 CpuFeatures::Scope scope(VFP3); | 3342 CpuFeatures::Scope scope(VFP3); |
| 3343 | 3343 |
| 3344 Label no_update; | 3344 Label no_update; |
| 3345 Label skip_cache; | 3345 Label skip_cache; |
| 3346 | 3346 |
| 3347 // Call C function to calculate the result and update the cache. | 3347 // Call C function to calculate the result and update the cache. |
| 3348 // Register r0 holds precalculated cache entry address; preserve | 3348 // r0: precalculated cache entry address. |
| 3349 // it on the stack and pop it into register cache_entry after the | 3349 // r2 and r3: parts of the double value. |
| 3350 // call. | 3350 // Store r0, r2 and r3 on stack for later before calling C function. |
| 3351 __ push(cache_entry); | 3351 __ Push(r3, r2, cache_entry); |
| 3352 GenerateCallCFunction(masm, scratch0); | 3352 GenerateCallCFunction(masm, scratch0); |
| 3353 __ GetCFunctionDoubleResult(d2); | 3353 __ GetCFunctionDoubleResult(d2); |
| 3354 | 3354 |
| 3355 // Try to update the cache. If we cannot allocate a | 3355 // Try to update the cache. If we cannot allocate a |
| 3356 // heap number, we return the result without updating. | 3356 // heap number, we return the result without updating. |
| 3357 __ pop(cache_entry); | 3357 __ Pop(r3, r2, cache_entry); |
| 3358 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); | 3358 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); |
| 3359 __ AllocateHeapNumber(r6, scratch0, scratch1, r5, &no_update); | 3359 __ AllocateHeapNumber(r6, scratch0, scratch1, r5, &no_update); |
| 3360 __ vstr(d2, FieldMemOperand(r6, HeapNumber::kValueOffset)); | 3360 __ vstr(d2, FieldMemOperand(r6, HeapNumber::kValueOffset)); |
| 3361 __ stm(ia, cache_entry, r2.bit() | r3.bit() | r6.bit()); | 3361 __ stm(ia, cache_entry, r2.bit() | r3.bit() | r6.bit()); |
| 3362 __ Ret(); | 3362 __ Ret(); |
| 3363 | 3363 |
| 3364 __ bind(&invalid_cache); | 3364 __ bind(&invalid_cache); |
| 3365 // The cache is invalid. Call runtime which will recreate the | 3365 // The cache is invalid. Call runtime which will recreate the |
| 3366 // cache. | 3366 // cache. |
| 3367 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); | 3367 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); |
| (...skipping 3946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7314 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, | 7314 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, |
| 7315 &slow_elements); | 7315 &slow_elements); |
| 7316 __ Ret(); | 7316 __ Ret(); |
| 7317 } | 7317 } |
| 7318 | 7318 |
| 7319 #undef __ | 7319 #undef __ |
| 7320 | 7320 |
| 7321 } } // namespace v8::internal | 7321 } } // namespace v8::internal |
| 7322 | 7322 |
| 7323 #endif // V8_TARGET_ARCH_ARM | 7323 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |