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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1337 | 1337 |
1338 | 1338 |
1339 void Assembler::bgezalc(Register rt, int16_t offset) { | 1339 void Assembler::bgezalc(Register rt, int16_t offset) { |
1340 DCHECK(kArchVariant == kMips64r6); | 1340 DCHECK(kArchVariant == kMips64r6); |
1341 DCHECK(!(rt.is(zero_reg))); | 1341 DCHECK(!(rt.is(zero_reg))); |
1342 GenInstrImmediate(BLEZ, rt, rt, offset); | 1342 GenInstrImmediate(BLEZ, rt, rt, offset); |
1343 } | 1343 } |
1344 | 1344 |
1345 | 1345 |
1346 void Assembler::bgezall(Register rs, int16_t offset) { | 1346 void Assembler::bgezall(Register rs, int16_t offset) { |
1347 DCHECK(kArchVariant == kMips64r6); | 1347 DCHECK(kArchVariant != kMips64r6); |
1348 DCHECK(!(rs.is(zero_reg))); | 1348 DCHECK(!(rs.is(zero_reg))); |
1349 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1349 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); | 1350 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); |
1351 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1350 } | 1352 } |
1351 | 1353 |
1352 | 1354 |
1353 void Assembler::bltzalc(Register rt, int16_t offset) { | 1355 void Assembler::bltzalc(Register rt, int16_t offset) { |
1354 DCHECK(kArchVariant == kMips64r6); | 1356 DCHECK(kArchVariant == kMips64r6); |
1355 DCHECK(!(rt.is(zero_reg))); | 1357 DCHECK(!(rt.is(zero_reg))); |
1356 GenInstrImmediate(BGTZ, rt, rt, offset); | 1358 GenInstrImmediate(BGTZ, rt, rt, offset); |
1357 } | 1359 } |
1358 | 1360 |
1359 | 1361 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1402 | 1404 |
1403 void Assembler::bnezc(Register rs, int32_t offset) { | 1405 void Assembler::bnezc(Register rs, int32_t offset) { |
1404 DCHECK(kArchVariant == kMips64r6); | 1406 DCHECK(kArchVariant == kMips64r6); |
1405 DCHECK(!(rs.is(zero_reg))); | 1407 DCHECK(!(rs.is(zero_reg))); |
1406 Instr instr = POP76 | (rs.code() << kRsShift) | offset; | 1408 Instr instr = POP76 | (rs.code() << kRsShift) | offset; |
1407 emit(instr); | 1409 emit(instr); |
1408 } | 1410 } |
1409 | 1411 |
1410 | 1412 |
1411 void Assembler::j(int64_t target) { | 1413 void Assembler::j(int64_t target) { |
1414 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1412 GenInstrJump(J, static_cast<uint32_t>(target >> 2) & kImm26Mask); | 1415 GenInstrJump(J, static_cast<uint32_t>(target >> 2) & kImm26Mask); |
1416 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1413 } | 1417 } |
1414 | 1418 |
1415 | 1419 |
1416 void Assembler::j(Label* target) { | 1420 void Assembler::j(Label* target) { |
1417 uint64_t imm = jump_offset(target); | 1421 uint64_t imm = jump_offset(target); |
1418 if (target->is_bound()) { | 1422 if (target->is_bound()) { |
1423 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1419 GenInstrJump(static_cast<Opcode>(kJRawMark), | 1424 GenInstrJump(static_cast<Opcode>(kJRawMark), |
1420 static_cast<uint32_t>(imm >> 2) & kImm26Mask); | 1425 static_cast<uint32_t>(imm >> 2) & kImm26Mask); |
1426 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1421 } else { | 1427 } else { |
1422 j(imm); | 1428 j(imm); |
paul.l...
2015/11/17 19:59:45
Doesn't this unbound case also need to be protecte
balazs.kilvady
2015/11/18 12:22:53
We should not add protection here as implementatio
| |
1423 } | 1429 } |
1424 } | 1430 } |
1425 | 1431 |
1426 | 1432 |
1427 void Assembler::jal(Label* target) { | 1433 void Assembler::jal(Label* target) { |
1428 uint64_t imm = jump_offset(target); | 1434 uint64_t imm = jump_offset(target); |
1429 if (target->is_bound()) { | 1435 if (target->is_bound()) { |
1436 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1437 positions_recorder()->WriteRecordedPositions(); | |
1430 GenInstrJump(static_cast<Opcode>(kJalRawMark), | 1438 GenInstrJump(static_cast<Opcode>(kJalRawMark), |
1431 static_cast<uint32_t>(imm >> 2) & kImm26Mask); | 1439 static_cast<uint32_t>(imm >> 2) & kImm26Mask); |
1440 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1432 } else { | 1441 } else { |
1433 jal(imm); | 1442 jal(imm); |
1434 } | 1443 } |
1435 } | 1444 } |
1436 | 1445 |
1437 | 1446 |
1438 void Assembler::jr(Register rs) { | 1447 void Assembler::jr(Register rs) { |
1439 if (kArchVariant != kMips64r6) { | 1448 if (kArchVariant != kMips64r6) { |
1440 BlockTrampolinePoolScope block_trampoline_pool(this); | 1449 BlockTrampolinePoolScope block_trampoline_pool(this); |
1441 if (rs.is(ra)) { | 1450 if (rs.is(ra)) { |
1442 positions_recorder()->WriteRecordedPositions(); | 1451 positions_recorder()->WriteRecordedPositions(); |
1443 } | 1452 } |
1444 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); | 1453 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); |
1445 BlockTrampolinePoolFor(1); // For associated delay slot. | 1454 BlockTrampolinePoolFor(1); // For associated delay slot. |
1446 } else { | 1455 } else { |
1447 jalr(rs, zero_reg); | 1456 jalr(rs, zero_reg); |
1448 } | 1457 } |
1449 } | 1458 } |
1450 | 1459 |
1451 | 1460 |
1452 void Assembler::jal(int64_t target) { | 1461 void Assembler::jal(int64_t target) { |
1462 BlockTrampolinePoolScope block_trampoline_pool(this); | |
1453 positions_recorder()->WriteRecordedPositions(); | 1463 positions_recorder()->WriteRecordedPositions(); |
1454 GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask); | 1464 GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask); |
1465 BlockTrampolinePoolFor(1); // For associated delay slot. | |
1455 } | 1466 } |
1456 | 1467 |
1457 | 1468 |
1458 void Assembler::jalr(Register rs, Register rd) { | 1469 void Assembler::jalr(Register rs, Register rd) { |
1459 DCHECK(rs.code() != rd.code()); | 1470 DCHECK(rs.code() != rd.code()); |
1460 BlockTrampolinePoolScope block_trampoline_pool(this); | 1471 BlockTrampolinePoolScope block_trampoline_pool(this); |
1461 positions_recorder()->WriteRecordedPositions(); | 1472 positions_recorder()->WriteRecordedPositions(); |
1462 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); | 1473 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); |
1463 BlockTrampolinePoolFor(1); // For associated delay slot. | 1474 BlockTrampolinePoolFor(1); // For associated delay slot. |
1464 } | 1475 } |
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3264 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { | 3275 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { |
3265 CpuFeatures::FlushICache(pc, 4 * Assembler::kInstrSize); | 3276 CpuFeatures::FlushICache(pc, 4 * Assembler::kInstrSize); |
3266 } | 3277 } |
3267 } | 3278 } |
3268 | 3279 |
3269 | 3280 |
3270 } // namespace internal | 3281 } // namespace internal |
3271 } // namespace v8 | 3282 } // namespace v8 |
3272 | 3283 |
3273 #endif // V8_TARGET_ARCH_MIPS64 | 3284 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |