| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2068 masm, BinaryOpIC::UNINITIALIZED, BinaryOpIC::UNINITIALIZED, true, | 2068 masm, BinaryOpIC::UNINITIALIZED, BinaryOpIC::UNINITIALIZED, true, |
| 2069 use_runtime, gc_required, ¬_smis, op, mode); | 2069 use_runtime, gc_required, ¬_smis, op, mode); |
| 2070 } | 2070 } |
| 2071 __ bind(¬_smis); | 2071 __ bind(¬_smis); |
| 2072 } | 2072 } |
| 2073 | 2073 |
| 2074 | 2074 |
| 2075 void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { | 2075 void BinaryOpStub::GenerateSmiStub(MacroAssembler* masm) { |
| 2076 Label right_arg_changed, call_runtime; | 2076 Label right_arg_changed, call_runtime; |
| 2077 | 2077 |
| 2078 if (op_ == Token::MOD && has_fixed_right_arg_) { | 2078 if (op_ == Token::MOD && encoded_right_arg_.has_value) { |
| 2079 // It is guaranteed that the value will fit into a Smi, because if it | 2079 // It is guaranteed that the value will fit into a Smi, because if it |
| 2080 // didn't, we wouldn't be here, see BinaryOp_Patch. | 2080 // didn't, we wouldn't be here, see BinaryOp_Patch. |
| 2081 __ cmp(r0, Operand(Smi::FromInt(fixed_right_arg_value()))); | 2081 __ cmp(r0, Operand(Smi::FromInt(fixed_right_arg_value()))); |
| 2082 __ b(ne, &right_arg_changed); | 2082 __ b(ne, &right_arg_changed); |
| 2083 } | 2083 } |
| 2084 | 2084 |
| 2085 if (result_type_ == BinaryOpIC::UNINITIALIZED || | 2085 if (result_type_ == BinaryOpIC::UNINITIALIZED || |
| 2086 result_type_ == BinaryOpIC::SMI) { | 2086 result_type_ == BinaryOpIC::SMI) { |
| 2087 // Only allow smi results. | 2087 // Only allow smi results. |
| 2088 BinaryOpStub_GenerateSmiCode( | 2088 BinaryOpStub_GenerateSmiCode( |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2245 mode_); | 2245 mode_); |
| 2246 __ sub(r0, heap_number_result, Operand(kHeapObjectTag)); | 2246 __ sub(r0, heap_number_result, Operand(kHeapObjectTag)); |
| 2247 __ vstr(d5, r0, HeapNumber::kValueOffset); | 2247 __ vstr(d5, r0, HeapNumber::kValueOffset); |
| 2248 __ mov(r0, heap_number_result); | 2248 __ mov(r0, heap_number_result); |
| 2249 __ Ret(); | 2249 __ Ret(); |
| 2250 | 2250 |
| 2251 // A DIV operation expecting an integer result falls through | 2251 // A DIV operation expecting an integer result falls through |
| 2252 // to type transition. | 2252 // to type transition. |
| 2253 | 2253 |
| 2254 } else { | 2254 } else { |
| 2255 if (has_fixed_right_arg_) { | 2255 if (encoded_right_arg_.has_value) { |
| 2256 __ Vmov(d8, fixed_right_arg_value(), scratch1); | 2256 __ Vmov(d8, fixed_right_arg_value(), scratch1); |
| 2257 __ VFPCompareAndSetFlags(d1, d8); | 2257 __ VFPCompareAndSetFlags(d1, d8); |
| 2258 __ b(ne, &transition); | 2258 __ b(ne, &transition); |
| 2259 } | 2259 } |
| 2260 | 2260 |
| 2261 // We preserved r0 and r1 to be able to call runtime. | 2261 // We preserved r0 and r1 to be able to call runtime. |
| 2262 // Save the left value on the stack. | 2262 // Save the left value on the stack. |
| 2263 __ Push(r5, r4); | 2263 __ Push(r5, r4); |
| 2264 | 2264 |
| 2265 Label pop_and_call_runtime; | 2265 Label pop_and_call_runtime; |
| (...skipping 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7488 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 7488 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 7489 } | 7489 } |
| 7490 } | 7490 } |
| 7491 | 7491 |
| 7492 | 7492 |
| 7493 #undef __ | 7493 #undef __ |
| 7494 | 7494 |
| 7495 } } // namespace v8::internal | 7495 } } // namespace v8::internal |
| 7496 | 7496 |
| 7497 #endif // V8_TARGET_ARCH_ARM | 7497 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |