Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 3fbe0c5ea6d62942970d02438bda6f7fd87e56df..dccce5825ec2f26464504c86e710ead8e9fc00ca 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -1707,6 +1707,7 @@ void BinaryOpStub_GenerateSmiSmiOperation(MacroAssembler* masm, |
__ Ret(); |
if (CpuFeatures::IsSupported(SUDIV)) { |
+ CpuFeatureScope scope(masm, SUDIV); |
Label result_not_zero; |
__ bind(&div_with_sdiv); |
@@ -1763,6 +1764,7 @@ void BinaryOpStub_GenerateSmiSmiOperation(MacroAssembler* masm, |
__ Ret(); |
if (CpuFeatures::IsSupported(SUDIV)) { |
+ CpuFeatureScope scope(masm, SUDIV); |
__ bind(&modulo_with_sdiv); |
__ mov(scratch2, right); |
// Perform modulus with sdiv and mls. |
@@ -2208,22 +2210,11 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
UNREACHABLE(); |
} |
- if (op_ != Token::DIV) { |
- // These operations produce an integer result. |
- // Try to return a smi if we can. |
- // Otherwise return a heap number if allowed, or jump to type |
- // transition. |
- |
- if (result_type_ <= BinaryOpIC::INT32) { |
- __ TryDoubleToInt32Exact(scratch1, d5, d8); |
- // If the ne condition is set, result does |
- // not fit in a 32-bit integer. |
- __ b(ne, &transition); |
- } else { |
- __ vcvt_s32_f64(s8, d5); |
- __ vmov(scratch1, s8); |
- } |
- |
+ if (result_type_ <= BinaryOpIC::INT32) { |
+ __ TryDoubleToInt32Exact(scratch1, d5, d8); |
+ // If the ne condition is set, result does |
+ // not fit in a 32-bit integer. |
+ __ b(ne, &transition); |
// Check if the result fits in a smi. |
__ add(scratch2, scratch1, Operand(0x40000000), SetCC); |
Rodolph Perfetta
2013/06/10 18:04:07
a possible improvement:
__ SmiTag(scratch1, Set
Jakob Kummerow
2013/06/11 09:33:13
Good idea. Done.
|
// If not try to return a heap number. |
@@ -2242,8 +2233,6 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) { |
// Tag the result and return. |
__ SmiTag(r0, scratch1); |
__ Ret(); |
- } else { |
- // DIV just falls through to allocating a heap number. |
} |
__ bind(&return_heap_number); |