Commit 57c1899f authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

MIPS: Port some DIV changes to BinaryOpStub::GenerateInt32Stub().

There were some changes in ARM r8172 that we needed to port to MIPS,
but missed.

The bug was exposed with the Arm & Mips fix in r8321, "Fix wrong
parenthesis in stub ARM and MIPS generation code."

BUG=
TEST=

Review URL: http://codereview.chromium.org//7211006
Patch from Paul Lind <plind44@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8339 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c1930b73
......@@ -2789,9 +2789,11 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
// DIV just falls through to allocating a heap number.
}
__ bind(&return_heap_number);
// Return a heap number, or fall through to type transition or runtime
// call if we can't.
if (result_type_ >= ((op_ == Token::DIV) ? BinaryOpIC::HEAP_NUMBER
: BinaryOpIC::INT32)) {
__ bind(&return_heap_number);
// We are using FPU registers so s0 is available.
heap_number_result = s0;
GenerateHeapResultAllocation(masm,
......@@ -2970,7 +2972,11 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
UNREACHABLE();
}
if (transition.is_linked()) {
// We never expect DIV to yield an integer result, so we always generate
// type transition code for DIV operations expecting an integer result: the
// code will fall through to this type transition.
if (transition.is_linked() ||
((op_ == Token::DIV) && (result_type_ <= BinaryOpIC::INT32))) {
__ bind(&transition);
GenerateTypeTransition(masm);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment