Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 5587609ddf19c931e40a49e1d491c8cd09dd5c80..eb35f800b52f74903fbaa474c40273fbe0e10cb4 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -1628,7 +1628,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
__ movsd(FieldOperand(rax, HeapNumber::kValueOffset), xmm1); |
__ fld_d(FieldOperand(rax, HeapNumber::kValueOffset)); |
} |
- GenerateOperation(masm); |
+ GenerateOperation(masm, type_); |
__ movq(Operand(rcx, 0), rbx); |
__ movq(Operand(rcx, 2 * kIntSize), rax); |
__ fstp_d(FieldOperand(rax, HeapNumber::kValueOffset)); |
@@ -1643,7 +1643,7 @@ void TranscendentalCacheStub::Generate(MacroAssembler* masm) { |
__ subq(rsp, Immediate(kDoubleSize)); |
__ movsd(Operand(rsp, 0), xmm1); |
__ fld_d(Operand(rsp, 0)); |
- GenerateOperation(masm); |
+ GenerateOperation(masm, type_); |
__ fstp_d(Operand(rsp, 0)); |
__ movsd(xmm1, Operand(rsp, 0)); |
__ addq(rsp, Immediate(kDoubleSize)); |
@@ -1695,16 +1695,17 @@ Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() { |
} |
-void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm) { |
+void TranscendentalCacheStub::GenerateOperation( |
+ MacroAssembler* masm, TranscendentalCache::Type type) { |
// Registers: |
// rax: Newly allocated HeapNumber, which must be preserved. |
// rbx: Bits of input double. Must be preserved. |
// rcx: Pointer to cache entry. Must be preserved. |
// st(0): Input double |
Label done; |
- if (type_ == TranscendentalCache::SIN || |
- type_ == TranscendentalCache::COS || |
- type_ == TranscendentalCache::TAN) { |
+ if (type == TranscendentalCache::SIN || |
+ type == TranscendentalCache::COS || |
+ type == TranscendentalCache::TAN) { |
// Both fsin and fcos require arguments in the range +/-2^63 and |
// return NaN for infinities and NaN. They can share all code except |
// the actual fsin/fcos operation. |
@@ -1767,7 +1768,7 @@ void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm) { |
// FPU Stack: input % 2*pi |
__ movq(rax, rdi); // Restore rax, pointer to the new HeapNumber. |
__ bind(&in_range); |
- switch (type_) { |
+ switch (type) { |
case TranscendentalCache::SIN: |
__ fsin(); |
break; |
@@ -1785,7 +1786,7 @@ void TranscendentalCacheStub::GenerateOperation(MacroAssembler* masm) { |
} |
__ bind(&done); |
} else { |
- ASSERT(type_ == TranscendentalCache::LOG); |
+ ASSERT(type == TranscendentalCache::LOG); |
__ fldln2(); |
__ fxch(); |
__ fyl2x(); |