From 058d82a3dfdbbba564585506a3e437c894511720 Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Wed, 6 Apr 2011 12:52:51 +0000 Subject: [PATCH] X64: Allow the type recording binary op stub to create heapnumber results. Review URL: http://codereview.chromium.org/6803010 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7515 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x64/code-stubs-x64.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index 86d5704..0f63387 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -1422,12 +1422,23 @@ void TypeRecordingBinaryOpStub::GenerateCallRuntimeCode(MacroAssembler* masm) { void TypeRecordingBinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { - Label not_smi; - - GenerateSmiCode(masm, ¬_smi, NO_HEAPNUMBER_RESULTS); + Label call_runtime; + if (result_type_ == TRBinaryOpIC::UNINITIALIZED || + result_type_ == TRBinaryOpIC::SMI) { + // Only allow smi results. + GenerateSmiCode(masm, NULL, NO_HEAPNUMBER_RESULTS); + } else { + // Allow heap number result and don't make a transition if a heap number + // cannot be allocated. + GenerateSmiCode(masm, &call_runtime, ALLOW_HEAPNUMBER_RESULTS); + } - __ bind(¬_smi); + // Code falls through if the result is not returned as either a smi or heap + // number. GenerateTypeTransition(masm); + + __ bind(&call_runtime); + GenerateCallRuntimeCode(masm); } -- 2.7.4