Commit 5b81bd0f authored by yangguo@chromium.org's avatar yangguo@chromium.org

MIPS: Inlining Math.min and Math.max in crankshaft.

Port r10391 (7900f3c).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9195009
Patch from Daniel Kalmar <kalmard@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10436 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ed5f9a4c
......@@ -3816,6 +3816,7 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
void LCodeGen::EmitNumberUntagD(Register input_reg,
DoubleRegister result_reg,
bool deoptimize_on_undefined,
bool deoptimize_on_minus_zero,
LEnvironment* env) {
Register scratch = scratch0();
......@@ -3845,6 +3846,12 @@ void LCodeGen::EmitNumberUntagD(Register input_reg,
}
// Heap number to double register conversion.
__ ldc1(result_reg, FieldMemOperand(input_reg, HeapNumber::kValueOffset));
if (deoptimize_on_minus_zero) {
__ mfc1(at, result_reg.low());
__ Branch(&done, ne, at, Operand(zero_reg));
__ mfc1(scratch, result_reg.high());
DeoptimizeIf(eq, env, scratch, Operand(HeapNumber::kSignMask));
}
__ Branch(&done);
// Smi to double register conversion
......@@ -3976,6 +3983,7 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
EmitNumberUntagD(input_reg, result_reg,
instr->hydrogen()->deoptimize_on_undefined(),
instr->hydrogen()->deoptimize_on_minus_zero(),
instr->environment());
}
......
......@@ -280,6 +280,7 @@ class LCodeGen BASE_EMBEDDED {
void EmitNumberUntagD(Register input,
DoubleRegister result,
bool deoptimize_on_undefined,
bool deoptimize_on_minus_zero,
LEnvironment* env);
// Emits optimized code for typeof x == "y". Modifies input register.
......
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