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 3385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3396 __ bind(&calculate); | 3396 __ bind(&calculate); |
3397 Counters* counters = masm->isolate()->counters(); | 3397 Counters* counters = masm->isolate()->counters(); |
3398 __ IncrementCounter( | 3398 __ IncrementCounter( |
3399 counters->transcendental_cache_miss(), 1, scratch0, scratch1); | 3399 counters->transcendental_cache_miss(), 1, scratch0, scratch1); |
3400 if (tagged) { | 3400 if (tagged) { |
3401 __ bind(&invalid_cache); | 3401 __ bind(&invalid_cache); |
3402 ExternalReference runtime_function = | 3402 ExternalReference runtime_function = |
3403 ExternalReference(RuntimeFunction(), masm->isolate()); | 3403 ExternalReference(RuntimeFunction(), masm->isolate()); |
3404 __ TailCallExternalReference(runtime_function, 1, 1); | 3404 __ TailCallExternalReference(runtime_function, 1, 1); |
3405 } else { | 3405 } else { |
3406 if (!CpuFeatures::IsSupported(VFP3)) UNREACHABLE(); | 3406 ASSERT(CpuFeatures::IsSupported(VFP3)); |
3407 CpuFeatures::Scope scope(VFP3); | 3407 CpuFeatures::Scope scope(VFP3); |
3408 | 3408 |
3409 Label no_update; | 3409 Label no_update; |
3410 Label skip_cache; | 3410 Label skip_cache; |
3411 | 3411 |
3412 // Call C function to calculate the result and update the cache. | 3412 // Call C function to calculate the result and update the cache. |
3413 // Register r0 holds precalculated cache entry address; preserve | 3413 // r0: precalculated cache entry address. |
3414 // it on the stack and pop it into register cache_entry after the | 3414 // r2 and r3: parts of the double value. |
3415 // call. | 3415 // Store r0, r2 and r3 on stack for later before calling C function. |
3416 __ push(cache_entry); | 3416 __ Push(r3, r2, cache_entry); |
3417 GenerateCallCFunction(masm, scratch0); | 3417 GenerateCallCFunction(masm, scratch0); |
3418 __ GetCFunctionDoubleResult(d2); | 3418 __ GetCFunctionDoubleResult(d2); |
3419 | 3419 |
3420 // Try to update the cache. If we cannot allocate a | 3420 // Try to update the cache. If we cannot allocate a |
3421 // heap number, we return the result without updating. | 3421 // heap number, we return the result without updating. |
3422 __ pop(cache_entry); | 3422 __ Pop(r3, r2, cache_entry); |
3423 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); | 3423 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); |
3424 __ AllocateHeapNumber(r6, scratch0, scratch1, r5, &no_update); | 3424 __ AllocateHeapNumber(r6, scratch0, scratch1, r5, &no_update); |
3425 __ vstr(d2, FieldMemOperand(r6, HeapNumber::kValueOffset)); | 3425 __ vstr(d2, FieldMemOperand(r6, HeapNumber::kValueOffset)); |
3426 __ stm(ia, cache_entry, r2.bit() | r3.bit() | r6.bit()); | 3426 __ stm(ia, cache_entry, r2.bit() | r3.bit() | r6.bit()); |
3427 __ Ret(); | 3427 __ Ret(); |
3428 | 3428 |
3429 __ bind(&invalid_cache); | 3429 __ bind(&invalid_cache); |
3430 // The cache is invalid. Call runtime which will recreate the | 3430 // The cache is invalid. Call runtime which will recreate the |
3431 // cache. | 3431 // cache. |
3432 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); | 3432 __ LoadRoot(r5, Heap::kHeapNumberMapRootIndex); |
(...skipping 4078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7511 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2, | 7511 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2, |
7512 &slow_elements); | 7512 &slow_elements); |
7513 __ Ret(); | 7513 __ Ret(); |
7514 } | 7514 } |
7515 | 7515 |
7516 #undef __ | 7516 #undef __ |
7517 | 7517 |
7518 } } // namespace v8::internal | 7518 } } // namespace v8::internal |
7519 | 7519 |
7520 #endif // V8_TARGET_ARCH_ARM | 7520 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |