From b1a1d5bbcbbecc8e9e4b8d4c6985e0df3fd1984c Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Mon, 12 Aug 2013 16:54:12 +0000 Subject: [PATCH] ia32: Calls to the TranscendentalCacheStub must ensure that esi is set to something safe. BUG=v8:2827 R=verwaest@chromium.org Review URL: https://codereview.chromium.org/22863002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16154 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/ia32/lithium-codegen-ia32.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 898918f..82dc1f4 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -4092,6 +4092,9 @@ void LCodeGen::DoMathExp(LMathExp* instr) { void LCodeGen::DoMathTan(LMathTan* instr) { ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); + // Set the context register to a GC-safe fake value. Clobbering it is + // OK because this instruction is marked as a call. + __ Set(esi, Immediate(0)); TranscendentalCacheStub stub(TranscendentalCache::TAN, TranscendentalCacheStub::UNTAGGED); CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); @@ -4100,6 +4103,9 @@ void LCodeGen::DoMathTan(LMathTan* instr) { void LCodeGen::DoMathCos(LMathCos* instr) { ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); + // Set the context register to a GC-safe fake value. Clobbering it is + // OK because this instruction is marked as a call. + __ Set(esi, Immediate(0)); TranscendentalCacheStub stub(TranscendentalCache::COS, TranscendentalCacheStub::UNTAGGED); CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); @@ -4108,6 +4114,9 @@ void LCodeGen::DoMathCos(LMathCos* instr) { void LCodeGen::DoMathSin(LMathSin* instr) { ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); + // Set the context register to a GC-safe fake value. Clobbering it is + // OK because this instruction is marked as a call. + __ Set(esi, Immediate(0)); TranscendentalCacheStub stub(TranscendentalCache::SIN, TranscendentalCacheStub::UNTAGGED); CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); -- 2.7.4