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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1360 | 1360 |
1361 void Assembler::bgezalc(Register rt, int16_t offset) { | 1361 void Assembler::bgezalc(Register rt, int16_t offset) { |
1362 DCHECK(IsMipsArchVariant(kMips32r6)); | 1362 DCHECK(IsMipsArchVariant(kMips32r6)); |
1363 DCHECK(!(rt.is(zero_reg))); | 1363 DCHECK(!(rt.is(zero_reg))); |
1364 positions_recorder()->WriteRecordedPositions(); | 1364 positions_recorder()->WriteRecordedPositions(); |
1365 GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1365 GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); |
1366 } | 1366 } |
1367 | 1367 |
1368 | 1368 |
1369 void Assembler::bgezall(Register rs, int16_t offset) { | 1369 void Assembler::bgezall(Register rs, int16_t offset) { |
1370 DCHECK(IsMipsArchVariant(kMips32r6)); | 1370 DCHECK(!IsMipsArchVariant(kMips32r6)); |
1371 DCHECK(!(rs.is(zero_reg))); | 1371 DCHECK(!(rs.is(zero_reg))); |
1372 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1372 positions_recorder()->WriteRecordedPositions(); | 1373 positions_recorder()->WriteRecordedPositions(); |
1373 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); | 1374 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); |
1375 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1374 } | 1376 } |
1375 | 1377 |
1376 | 1378 |
1377 void Assembler::bltzalc(Register rt, int16_t offset) { | 1379 void Assembler::bltzalc(Register rt, int16_t offset) { |
1378 DCHECK(IsMipsArchVariant(kMips32r6)); | 1380 DCHECK(IsMipsArchVariant(kMips32r6)); |
1379 DCHECK(!(rt.is(zero_reg))); | 1381 DCHECK(!(rt.is(zero_reg))); |
1380 positions_recorder()->WriteRecordedPositions(); | 1382 positions_recorder()->WriteRecordedPositions(); |
1381 GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); | 1383 GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); |
1382 } | 1384 } |
1383 | 1385 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1446 | 1448 |
1447 | 1449 |
1448 void Assembler::j(int32_t target) { | 1450 void Assembler::j(int32_t target) { |
1449 #if DEBUG | 1451 #if DEBUG |
1450 // Get pc of delay slot. | 1452 // Get pc of delay slot. |
1451 uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize); | 1453 uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize); |
1452 bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >> | 1454 bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >> |
1453 (kImm26Bits + kImmFieldShift)) == 0; | 1455 (kImm26Bits + kImmFieldShift)) == 0; |
1454 DCHECK(in_range && ((target & 3) == 0)); | 1456 DCHECK(in_range && ((target & 3) == 0)); |
1455 #endif | 1457 #endif |
1458 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1456 GenInstrJump(J, (target >> 2) & kImm26Mask); | 1459 GenInstrJump(J, (target >> 2) & kImm26Mask); |
1460 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1457 } | 1461 } |
1458 | 1462 |
1459 | 1463 |
1460 void Assembler::jr(Register rs) { | 1464 void Assembler::jr(Register rs) { |
1461 if (!IsMipsArchVariant(kMips32r6)) { | 1465 if (!IsMipsArchVariant(kMips32r6)) { |
1462 BlockTrampolinePoolScope block_trampoline_pool(this); | 1466 BlockTrampolinePoolScope block_trampoline_pool(this); |
1463 if (rs.is(ra)) { | 1467 if (rs.is(ra)) { |
1464 positions_recorder()->WriteRecordedPositions(); | 1468 positions_recorder()->WriteRecordedPositions(); |
1465 } | 1469 } |
1466 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); | 1470 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); |
1467 BlockTrampolinePoolFor(1); // For associated delay slot. | 1471 BlockTrampolinePoolFor(1); // For associated delay slot. |
1468 } else { | 1472 } else { |
1469 jalr(rs, zero_reg); | 1473 jalr(rs, zero_reg); |
paul.l...
2015/11/17 19:59:45
Don't we need this protected as well?
balazs.kilvady
2015/11/18 12:22:53
We don't need protection here as jalr() contains t
| |
1470 } | 1474 } |
1471 } | 1475 } |
1472 | 1476 |
1473 | 1477 |
1474 void Assembler::jal(int32_t target) { | 1478 void Assembler::jal(int32_t target) { |
1475 #ifdef DEBUG | 1479 #ifdef DEBUG |
1476 // Get pc of delay slot. | 1480 // Get pc of delay slot. |
1477 uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize); | 1481 uint32_t ipc = reinterpret_cast<uint32_t>(pc_ + 1 * kInstrSize); |
1478 bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >> | 1482 bool in_range = ((ipc ^ static_cast<uint32_t>(target)) >> |
1479 (kImm26Bits + kImmFieldShift)) == 0; | 1483 (kImm26Bits + kImmFieldShift)) == 0; |
1480 DCHECK(in_range && ((target & 3) == 0)); | 1484 DCHECK(in_range && ((target & 3) == 0)); |
1481 #endif | 1485 #endif |
1486 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1482 positions_recorder()->WriteRecordedPositions(); | 1487 positions_recorder()->WriteRecordedPositions(); |
1483 GenInstrJump(JAL, (target >> 2) & kImm26Mask); | 1488 GenInstrJump(JAL, (target >> 2) & kImm26Mask); |
1489 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1484 } | 1490 } |
1485 | 1491 |
1486 | 1492 |
1487 void Assembler::jalr(Register rs, Register rd) { | 1493 void Assembler::jalr(Register rs, Register rd) { |
1488 DCHECK(rs.code() != rd.code()); | 1494 DCHECK(rs.code() != rd.code()); |
1489 BlockTrampolinePoolScope block_trampoline_pool(this); | 1495 BlockTrampolinePoolScope block_trampoline_pool(this); |
1490 positions_recorder()->WriteRecordedPositions(); | 1496 positions_recorder()->WriteRecordedPositions(); |
1491 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); | 1497 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); |
1492 BlockTrampolinePoolFor(1); // For associated delay slot. | 1498 BlockTrampolinePoolFor(1); // For associated delay slot. |
1493 } | 1499 } |
(...skipping 1529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3023 | 3029 |
3024 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3030 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3025 CpuFeatures::FlushICache(pc, 2 * sizeof(int32_t)); | 3031 CpuFeatures::FlushICache(pc, 2 * sizeof(int32_t)); |
3026 } | 3032 } |
3027 } | 3033 } |
3028 | 3034 |
3029 } // namespace internal | 3035 } // namespace internal |
3030 } // namespace v8 | 3036 } // namespace v8 |
3031 | 3037 |
3032 #endif // V8_TARGET_ARCH_MIPS | 3038 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |