OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 case Token::DIV: | 1282 case Token::DIV: |
1283 __ vdiv(left, left, right); | 1283 __ vdiv(left, left, right); |
1284 break; | 1284 break; |
1285 case Token::MOD: { | 1285 case Token::MOD: { |
1286 // Save r0-r3 on the stack. | 1286 // Save r0-r3 on the stack. |
1287 __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); | 1287 __ stm(db_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); |
1288 | 1288 |
1289 __ PrepareCallCFunction(4, scratch0()); | 1289 __ PrepareCallCFunction(4, scratch0()); |
1290 __ vmov(r0, r1, left); | 1290 __ vmov(r0, r1, left); |
1291 __ vmov(r2, r3, right); | 1291 __ vmov(r2, r3, right); |
1292 __ CallCFunction(ExternalReference::double_fp_operation(Token::MOD), 4); | 1292 __ CallCFunction( |
| 1293 ExternalReference::double_fp_operation(Token::MOD, isolate()), 4); |
1293 // Move the result in the double result register. | 1294 // Move the result in the double result register. |
1294 __ GetCFunctionDoubleResult(ToDoubleRegister(instr->result())); | 1295 __ GetCFunctionDoubleResult(ToDoubleRegister(instr->result())); |
1295 | 1296 |
1296 // Restore r0-r3. | 1297 // Restore r0-r3. |
1297 __ ldm(ia_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); | 1298 __ ldm(ia_w, sp, r0.bit() | r1.bit() | r2.bit() | r3.bit()); |
1298 break; | 1299 break; |
1299 } | 1300 } |
1300 default: | 1301 default: |
1301 UNREACHABLE(); | 1302 UNREACHABLE(); |
1302 break; | 1303 break; |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 LOperand* left = instr->InputAt(0); | 2736 LOperand* left = instr->InputAt(0); |
2736 LOperand* right = instr->InputAt(1); | 2737 LOperand* right = instr->InputAt(1); |
2737 Register scratch = scratch0(); | 2738 Register scratch = scratch0(); |
2738 DoubleRegister result_reg = ToDoubleRegister(instr->result()); | 2739 DoubleRegister result_reg = ToDoubleRegister(instr->result()); |
2739 Representation exponent_type = instr->hydrogen()->right()->representation(); | 2740 Representation exponent_type = instr->hydrogen()->right()->representation(); |
2740 if (exponent_type.IsDouble()) { | 2741 if (exponent_type.IsDouble()) { |
2741 // Prepare arguments and call C function. | 2742 // Prepare arguments and call C function. |
2742 __ PrepareCallCFunction(4, scratch); | 2743 __ PrepareCallCFunction(4, scratch); |
2743 __ vmov(r0, r1, ToDoubleRegister(left)); | 2744 __ vmov(r0, r1, ToDoubleRegister(left)); |
2744 __ vmov(r2, r3, ToDoubleRegister(right)); | 2745 __ vmov(r2, r3, ToDoubleRegister(right)); |
2745 __ CallCFunction(ExternalReference::power_double_double_function(), 4); | 2746 __ CallCFunction( |
| 2747 ExternalReference::power_double_double_function(isolate()), 4); |
2746 } else if (exponent_type.IsInteger32()) { | 2748 } else if (exponent_type.IsInteger32()) { |
2747 ASSERT(ToRegister(right).is(r0)); | 2749 ASSERT(ToRegister(right).is(r0)); |
2748 // Prepare arguments and call C function. | 2750 // Prepare arguments and call C function. |
2749 __ PrepareCallCFunction(4, scratch); | 2751 __ PrepareCallCFunction(4, scratch); |
2750 __ mov(r2, ToRegister(right)); | 2752 __ mov(r2, ToRegister(right)); |
2751 __ vmov(r0, r1, ToDoubleRegister(left)); | 2753 __ vmov(r0, r1, ToDoubleRegister(left)); |
2752 __ CallCFunction(ExternalReference::power_double_int_function(), 4); | 2754 __ CallCFunction( |
| 2755 ExternalReference::power_double_int_function(isolate()), 4); |
2753 } else { | 2756 } else { |
2754 ASSERT(exponent_type.IsTagged()); | 2757 ASSERT(exponent_type.IsTagged()); |
2755 ASSERT(instr->hydrogen()->left()->representation().IsDouble()); | 2758 ASSERT(instr->hydrogen()->left()->representation().IsDouble()); |
2756 | 2759 |
2757 Register right_reg = ToRegister(right); | 2760 Register right_reg = ToRegister(right); |
2758 | 2761 |
2759 // Check for smi on the right hand side. | 2762 // Check for smi on the right hand side. |
2760 Label non_smi, call; | 2763 Label non_smi, call; |
2761 __ JumpIfNotSmi(right_reg, &non_smi); | 2764 __ JumpIfNotSmi(right_reg, &non_smi); |
2762 | 2765 |
(...skipping 12 matching lines...) Expand all Loading... |
2775 DeoptimizeIf(ne, instr->environment()); | 2778 DeoptimizeIf(ne, instr->environment()); |
2776 int32_t value_offset = HeapNumber::kValueOffset - kHeapObjectTag; | 2779 int32_t value_offset = HeapNumber::kValueOffset - kHeapObjectTag; |
2777 __ add(scratch, right_reg, Operand(value_offset)); | 2780 __ add(scratch, right_reg, Operand(value_offset)); |
2778 __ vldr(result_reg, scratch, 0); | 2781 __ vldr(result_reg, scratch, 0); |
2779 | 2782 |
2780 // Prepare arguments and call C function. | 2783 // Prepare arguments and call C function. |
2781 __ bind(&call); | 2784 __ bind(&call); |
2782 __ PrepareCallCFunction(4, scratch); | 2785 __ PrepareCallCFunction(4, scratch); |
2783 __ vmov(r0, r1, ToDoubleRegister(left)); | 2786 __ vmov(r0, r1, ToDoubleRegister(left)); |
2784 __ vmov(r2, r3, result_reg); | 2787 __ vmov(r2, r3, result_reg); |
2785 __ CallCFunction(ExternalReference::power_double_double_function(), 4); | 2788 __ CallCFunction( |
| 2789 ExternalReference::power_double_double_function(isolate()), 4); |
2786 } | 2790 } |
2787 // Store the result in the result register. | 2791 // Store the result in the result register. |
2788 __ GetCFunctionDoubleResult(result_reg); | 2792 __ GetCFunctionDoubleResult(result_reg); |
2789 } | 2793 } |
2790 | 2794 |
2791 | 2795 |
2792 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { | 2796 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { |
2793 ASSERT(ToDoubleRegister(instr->result()).is(d2)); | 2797 ASSERT(ToDoubleRegister(instr->result()).is(d2)); |
2794 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 2798 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
2795 TranscendentalCacheStub::UNTAGGED); | 2799 TranscendentalCacheStub::UNTAGGED); |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4003 ASSERT(!environment->HasBeenRegistered()); | 4007 ASSERT(!environment->HasBeenRegistered()); |
4004 RegisterEnvironmentForDeoptimization(environment); | 4008 RegisterEnvironmentForDeoptimization(environment); |
4005 ASSERT(osr_pc_offset_ == -1); | 4009 ASSERT(osr_pc_offset_ == -1); |
4006 osr_pc_offset_ = masm()->pc_offset(); | 4010 osr_pc_offset_ = masm()->pc_offset(); |
4007 } | 4011 } |
4008 | 4012 |
4009 | 4013 |
4010 #undef __ | 4014 #undef __ |
4011 | 4015 |
4012 } } // namespace v8::internal | 4016 } } // namespace v8::internal |
OLD | NEW |