OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 emit(cond | B27 | B25 | (imm24 & kImm24Mask)); | 1398 emit(cond | B27 | B25 | (imm24 & kImm24Mask)); |
1399 | 1399 |
1400 if (cond == al) { | 1400 if (cond == al) { |
1401 // Dead code is a good location to emit the constant pool. | 1401 // Dead code is a good location to emit the constant pool. |
1402 CheckConstPool(false, false); | 1402 CheckConstPool(false, false); |
1403 } | 1403 } |
1404 } | 1404 } |
1405 | 1405 |
1406 | 1406 |
1407 void Assembler::bl(int branch_offset, Condition cond) { | 1407 void Assembler::bl(int branch_offset, Condition cond) { |
1408 positions_recorder()->WriteRecordedPositions(); | |
1409 DCHECK((branch_offset & 3) == 0); | 1408 DCHECK((branch_offset & 3) == 0); |
1410 int imm24 = branch_offset >> 2; | 1409 int imm24 = branch_offset >> 2; |
1411 CHECK(is_int24(imm24)); | 1410 CHECK(is_int24(imm24)); |
1412 emit(cond | B27 | B25 | B24 | (imm24 & kImm24Mask)); | 1411 emit(cond | B27 | B25 | B24 | (imm24 & kImm24Mask)); |
1413 } | 1412 } |
1414 | 1413 |
1415 | 1414 |
1416 void Assembler::blx(int branch_offset) { // v5 and above | 1415 void Assembler::blx(int branch_offset) { // v5 and above |
1417 positions_recorder()->WriteRecordedPositions(); | |
1418 DCHECK((branch_offset & 1) == 0); | 1416 DCHECK((branch_offset & 1) == 0); |
1419 int h = ((branch_offset & 2) >> 1)*B24; | 1417 int h = ((branch_offset & 2) >> 1)*B24; |
1420 int imm24 = branch_offset >> 2; | 1418 int imm24 = branch_offset >> 2; |
1421 CHECK(is_int24(imm24)); | 1419 CHECK(is_int24(imm24)); |
1422 emit(kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask)); | 1420 emit(kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask)); |
1423 } | 1421 } |
1424 | 1422 |
1425 | 1423 |
1426 void Assembler::blx(Register target, Condition cond) { // v5 and above | 1424 void Assembler::blx(Register target, Condition cond) { // v5 and above |
1427 positions_recorder()->WriteRecordedPositions(); | |
1428 DCHECK(!target.is(pc)); | 1425 DCHECK(!target.is(pc)); |
1429 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | target.code()); | 1426 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BLX | target.code()); |
1430 } | 1427 } |
1431 | 1428 |
1432 | 1429 |
1433 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t | 1430 void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t |
1434 positions_recorder()->WriteRecordedPositions(); | |
1435 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged | 1431 DCHECK(!target.is(pc)); // use of pc is actually allowed, but discouraged |
1436 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); | 1432 emit(cond | B24 | B21 | 15*B16 | 15*B12 | 15*B8 | BX | target.code()); |
1437 } | 1433 } |
1438 | 1434 |
1439 | 1435 |
1440 void Assembler::b(Label* L, Condition cond) { | 1436 void Assembler::b(Label* L, Condition cond) { |
1441 CheckBuffer(); | 1437 CheckBuffer(); |
1442 b(branch_offset(L), cond); | 1438 b(branch_offset(L), cond); |
1443 } | 1439 } |
1444 | 1440 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 } | 1528 } |
1533 | 1529 |
1534 | 1530 |
1535 void Assembler::orr(Register dst, Register src1, const Operand& src2, | 1531 void Assembler::orr(Register dst, Register src1, const Operand& src2, |
1536 SBit s, Condition cond) { | 1532 SBit s, Condition cond) { |
1537 addrmod1(cond | ORR | s, src1, dst, src2); | 1533 addrmod1(cond | ORR | s, src1, dst, src2); |
1538 } | 1534 } |
1539 | 1535 |
1540 | 1536 |
1541 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) { | 1537 void Assembler::mov(Register dst, const Operand& src, SBit s, Condition cond) { |
1542 if (dst.is(pc)) { | |
1543 positions_recorder()->WriteRecordedPositions(); | |
1544 } | |
1545 // Don't allow nop instructions in the form mov rn, rn to be generated using | 1538 // Don't allow nop instructions in the form mov rn, rn to be generated using |
1546 // the mov instruction. They must be generated using nop(int/NopMarkerTypes) | 1539 // the mov instruction. They must be generated using nop(int/NopMarkerTypes) |
1547 // or MarkCode(int/NopMarkerTypes) pseudo instructions. | 1540 // or MarkCode(int/NopMarkerTypes) pseudo instructions. |
1548 DCHECK(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al)); | 1541 DCHECK(!(src.is_reg() && src.rm().is(dst) && s == LeaveCC && cond == al)); |
1549 addrmod1(cond | MOV | s, r0, dst, src); | 1542 addrmod1(cond | MOV | s, r0, dst, src); |
1550 } | 1543 } |
1551 | 1544 |
1552 | 1545 |
1553 void Assembler::mov_label_offset(Register dst, Label* label) { | 1546 void Assembler::mov_label_offset(Register dst, Label* label) { |
1554 if (label->is_bound()) { | 1547 if (label->is_bound()) { |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2023 } else { | 2016 } else { |
2024 DCHECK(!src.rs_.is_valid() && src.shift_imm_ == 0); // only rm allowed | 2017 DCHECK(!src.rs_.is_valid() && src.shift_imm_ == 0); // only rm allowed |
2025 instr = src.rm_.code(); | 2018 instr = src.rm_.code(); |
2026 } | 2019 } |
2027 emit(cond | instr | B24 | B21 | fields | 15*B12); | 2020 emit(cond | instr | B24 | B21 | fields | 15*B12); |
2028 } | 2021 } |
2029 | 2022 |
2030 | 2023 |
2031 // Load/Store instructions. | 2024 // Load/Store instructions. |
2032 void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) { | 2025 void Assembler::ldr(Register dst, const MemOperand& src, Condition cond) { |
2033 if (dst.is(pc)) { | |
2034 positions_recorder()->WriteRecordedPositions(); | |
2035 } | |
2036 addrmod2(cond | B26 | L, dst, src); | 2026 addrmod2(cond | B26 | L, dst, src); |
2037 } | 2027 } |
2038 | 2028 |
2039 | 2029 |
2040 void Assembler::str(Register src, const MemOperand& dst, Condition cond) { | 2030 void Assembler::str(Register src, const MemOperand& dst, Condition cond) { |
2041 addrmod2(cond | B26, src, dst); | 2031 addrmod2(cond | B26, src, dst); |
2042 } | 2032 } |
2043 | 2033 |
2044 | 2034 |
2045 void Assembler::ldrb(Register dst, const MemOperand& src, Condition cond) { | 2035 void Assembler::ldrb(Register dst, const MemOperand& src, Condition cond) { |
(...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4291 DCHECK(is_uint12(offset)); | 4281 DCHECK(is_uint12(offset)); |
4292 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 4282 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
4293 } | 4283 } |
4294 } | 4284 } |
4295 | 4285 |
4296 | 4286 |
4297 } // namespace internal | 4287 } // namespace internal |
4298 } // namespace v8 | 4288 } // namespace v8 |
4299 | 4289 |
4300 #endif // V8_TARGET_ARCH_ARM | 4290 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |