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 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 ldr(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); | 1074 ldr(pp, MemOperand(fp, ExitFrameConstants::kConstantPoolOffset)); |
1075 } | 1075 } |
1076 mov(sp, Operand(fp)); | 1076 mov(sp, Operand(fp)); |
1077 ldm(ia_w, sp, fp.bit() | lr.bit()); | 1077 ldm(ia_w, sp, fp.bit() | lr.bit()); |
1078 if (argument_count.is_valid()) { | 1078 if (argument_count.is_valid()) { |
1079 add(sp, sp, Operand(argument_count, LSL, kPointerSizeLog2)); | 1079 add(sp, sp, Operand(argument_count, LSL, kPointerSizeLog2)); |
1080 } | 1080 } |
1081 } | 1081 } |
1082 | 1082 |
1083 | 1083 |
1084 void MacroAssembler::GetCFunctionDoubleResult(const DwVfpRegister dst) { | 1084 void MacroAssembler::MovFromFloatResult(const DwVfpRegister dst) { |
1085 if (use_eabi_hardfloat()) { | 1085 if (use_eabi_hardfloat()) { |
1086 Move(dst, d0); | 1086 Move(dst, d0); |
1087 } else { | 1087 } else { |
1088 vmov(dst, r0, r1); | 1088 vmov(dst, r0, r1); |
1089 } | 1089 } |
1090 } | 1090 } |
1091 | 1091 |
1092 | 1092 |
| 1093 // On ARM this is just a synonym to make the purpose clear. |
| 1094 void MacroAssembler::MovFromFloatParameter(DwVfpRegister dst) { |
| 1095 MovFromFloatResult(dst); |
| 1096 } |
| 1097 |
| 1098 |
1093 void MacroAssembler::SetCallKind(Register dst, CallKind call_kind) { | 1099 void MacroAssembler::SetCallKind(Register dst, CallKind call_kind) { |
1094 // This macro takes the dst register to make the code more readable | 1100 // This macro takes the dst register to make the code more readable |
1095 // at the call sites. However, the dst register has to be r5 to | 1101 // at the call sites. However, the dst register has to be r5 to |
1096 // follow the calling convention which requires the call type to be | 1102 // follow the calling convention which requires the call type to be |
1097 // in r5. | 1103 // in r5. |
1098 ASSERT(dst.is(r5)); | 1104 ASSERT(dst.is(r5)); |
1099 if (call_kind == CALL_AS_FUNCTION) { | 1105 if (call_kind == CALL_AS_FUNCTION) { |
1100 mov(dst, Operand(Smi::FromInt(1))); | 1106 mov(dst, Operand(Smi::FromInt(1))); |
1101 } else { | 1107 } else { |
1102 mov(dst, Operand(Smi::FromInt(0))); | 1108 mov(dst, Operand(Smi::FromInt(0))); |
(...skipping 2430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3533 } | 3539 } |
3534 } | 3540 } |
3535 | 3541 |
3536 | 3542 |
3537 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, | 3543 void MacroAssembler::PrepareCallCFunction(int num_reg_arguments, |
3538 Register scratch) { | 3544 Register scratch) { |
3539 PrepareCallCFunction(num_reg_arguments, 0, scratch); | 3545 PrepareCallCFunction(num_reg_arguments, 0, scratch); |
3540 } | 3546 } |
3541 | 3547 |
3542 | 3548 |
3543 void MacroAssembler::SetCallCDoubleArguments(DwVfpRegister dreg) { | 3549 void MacroAssembler::MovToFloatParameter(DwVfpRegister src) { |
3544 ASSERT(dreg.is(d0)); | 3550 ASSERT(src.is(d0)); |
3545 if (!use_eabi_hardfloat()) { | 3551 if (!use_eabi_hardfloat()) { |
3546 vmov(r0, r1, dreg); | 3552 vmov(r0, r1, src); |
3547 } | 3553 } |
3548 } | 3554 } |
3549 | 3555 |
3550 | 3556 |
3551 void MacroAssembler::SetCallCDoubleArguments(DwVfpRegister dreg1, | 3557 // On ARM this is just a synonym to make the purpose clear. |
3552 DwVfpRegister dreg2) { | 3558 void MacroAssembler::MovToFloatResult(DwVfpRegister src) { |
3553 ASSERT(dreg1.is(d0)); | 3559 MovToFloatParameter(src); |
3554 ASSERT(dreg2.is(d1)); | 3560 } |
| 3561 |
| 3562 |
| 3563 void MacroAssembler::MovToFloatParameters(DwVfpRegister src1, |
| 3564 DwVfpRegister src2) { |
| 3565 ASSERT(src1.is(d0)); |
| 3566 ASSERT(src2.is(d1)); |
3555 if (!use_eabi_hardfloat()) { | 3567 if (!use_eabi_hardfloat()) { |
3556 vmov(r0, r1, dreg1); | 3568 vmov(r0, r1, src1); |
3557 vmov(r2, r3, dreg2); | 3569 vmov(r2, r3, src2); |
3558 } | 3570 } |
3559 } | 3571 } |
3560 | 3572 |
3561 | |
3562 void MacroAssembler::SetCallCDoubleArguments(DwVfpRegister dreg, | |
3563 Register reg) { | |
3564 ASSERT(dreg.is(d0)); | |
3565 if (use_eabi_hardfloat()) { | |
3566 Move(r0, reg); | |
3567 } else { | |
3568 Move(r2, reg); | |
3569 vmov(r0, r1, dreg); | |
3570 } | |
3571 } | |
3572 | |
3573 | 3573 |
3574 void MacroAssembler::CallCFunction(ExternalReference function, | 3574 void MacroAssembler::CallCFunction(ExternalReference function, |
3575 int num_reg_arguments, | 3575 int num_reg_arguments, |
3576 int num_double_arguments) { | 3576 int num_double_arguments) { |
3577 mov(ip, Operand(function)); | 3577 mov(ip, Operand(function)); |
3578 CallCFunctionHelper(ip, num_reg_arguments, num_double_arguments); | 3578 CallCFunctionHelper(ip, num_reg_arguments, num_double_arguments); |
3579 } | 3579 } |
3580 | 3580 |
3581 | 3581 |
3582 void MacroAssembler::CallCFunction(Register function, | 3582 void MacroAssembler::CallCFunction(Register function, |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4127 void CodePatcher::EmitCondition(Condition cond) { | 4127 void CodePatcher::EmitCondition(Condition cond) { |
4128 Instr instr = Assembler::instr_at(masm_.pc_); | 4128 Instr instr = Assembler::instr_at(masm_.pc_); |
4129 instr = (instr & ~kCondMask) | cond; | 4129 instr = (instr & ~kCondMask) | cond; |
4130 masm_.emit(instr); | 4130 masm_.emit(instr); |
4131 } | 4131 } |
4132 | 4132 |
4133 | 4133 |
4134 } } // namespace v8::internal | 4134 } } // namespace v8::internal |
4135 | 4135 |
4136 #endif // V8_TARGET_ARCH_ARM | 4136 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |