Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 10782023: MIPS: Fix transcendental cache on ARM in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after
3526 Counters* counters = masm->isolate()->counters(); 3526 Counters* counters = masm->isolate()->counters();
3527 __ IncrementCounter( 3527 __ IncrementCounter(
3528 counters->transcendental_cache_miss(), 1, scratch0, scratch1); 3528 counters->transcendental_cache_miss(), 1, scratch0, scratch1);
3529 if (tagged) { 3529 if (tagged) {
3530 __ bind(&invalid_cache); 3530 __ bind(&invalid_cache);
3531 __ TailCallExternalReference(ExternalReference(RuntimeFunction(), 3531 __ TailCallExternalReference(ExternalReference(RuntimeFunction(),
3532 masm->isolate()), 3532 masm->isolate()),
3533 1, 3533 1,
3534 1); 3534 1);
3535 } else { 3535 } else {
3536 if (!CpuFeatures::IsSupported(FPU)) UNREACHABLE(); 3536 ASSERT(CpuFeatures::IsSupported(FPU));
3537 CpuFeatures::Scope scope(FPU); 3537 CpuFeatures::Scope scope(FPU);
3538 3538
3539 Label no_update; 3539 Label no_update;
3540 Label skip_cache; 3540 Label skip_cache;
3541 3541
3542 // Call C function to calculate the result and update the cache. 3542 // Call C function to calculate the result and update the cache.
3543 // Register a0 holds precalculated cache entry address; preserve 3543 // a0: precalculated cache entry address.
3544 // it on the stack and pop it into register cache_entry after the 3544 // a2 and a3: parts of the double value.
3545 // call. 3545 // Store a0, a2 and a3 on stack for later before calling C function.
3546 __ Push(cache_entry, a2, a3); 3546 __ Push(a3, a2, cache_entry);
3547 GenerateCallCFunction(masm, scratch0); 3547 GenerateCallCFunction(masm, scratch0);
3548 __ GetCFunctionDoubleResult(f4); 3548 __ GetCFunctionDoubleResult(f4);
3549 3549
3550 // Try to update the cache. If we cannot allocate a 3550 // Try to update the cache. If we cannot allocate a
3551 // heap number, we return the result without updating. 3551 // heap number, we return the result without updating.
3552 __ Pop(cache_entry, a2, a3); 3552 __ Pop(a3, a2, cache_entry);
3553 __ LoadRoot(t1, Heap::kHeapNumberMapRootIndex); 3553 __ LoadRoot(t1, Heap::kHeapNumberMapRootIndex);
3554 __ AllocateHeapNumber(t2, scratch0, scratch1, t1, &no_update); 3554 __ AllocateHeapNumber(t2, scratch0, scratch1, t1, &no_update);
3555 __ sdc1(f4, FieldMemOperand(t2, HeapNumber::kValueOffset)); 3555 __ sdc1(f4, FieldMemOperand(t2, HeapNumber::kValueOffset));
3556 3556
3557 __ sw(a2, MemOperand(cache_entry, 0 * kPointerSize)); 3557 __ sw(a2, MemOperand(cache_entry, 0 * kPointerSize));
3558 __ sw(a3, MemOperand(cache_entry, 1 * kPointerSize)); 3558 __ sw(a3, MemOperand(cache_entry, 1 * kPointerSize));
3559 __ sw(t2, MemOperand(cache_entry, 2 * kPointerSize)); 3559 __ sw(t2, MemOperand(cache_entry, 2 * kPointerSize));
3560 3560
3561 __ Ret(USE_DELAY_SLOT); 3561 __ Ret(USE_DELAY_SLOT);
3562 __ mov(v0, cache_entry); 3562 __ mov(v0, cache_entry);
(...skipping 4201 matching lines...) Expand 10 before | Expand all | Expand 10 after
7764 __ Ret(USE_DELAY_SLOT); 7764 __ Ret(USE_DELAY_SLOT);
7765 __ mov(v0, a0); 7765 __ mov(v0, a0);
7766 } 7766 }
7767 7767
7768 7768
7769 #undef __ 7769 #undef __
7770 7770
7771 } } // namespace v8::internal 7771 } } // namespace v8::internal
7772 7772
7773 #endif // V8_TARGET_ARCH_MIPS 7773 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698