Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/mips64/assembler-mips64.cc

Issue 2072963003: Simplify AssemblerPositionsRecorder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 1245
1246 1246
1247 //------- Branch and jump instructions -------- 1247 //------- Branch and jump instructions --------
1248 1248
1249 void Assembler::b(int16_t offset) { 1249 void Assembler::b(int16_t offset) {
1250 beq(zero_reg, zero_reg, offset); 1250 beq(zero_reg, zero_reg, offset);
1251 } 1251 }
1252 1252
1253 1253
1254 void Assembler::bal(int16_t offset) { 1254 void Assembler::bal(int16_t offset) {
1255 positions_recorder()->WriteRecordedPositions();
1256 bgezal(zero_reg, offset); 1255 bgezal(zero_reg, offset);
1257 } 1256 }
1258 1257
1259 1258
1260 void Assembler::bc(int32_t offset) { 1259 void Assembler::bc(int32_t offset) {
1261 DCHECK(kArchVariant == kMips64r6); 1260 DCHECK(kArchVariant == kMips64r6);
1262 GenInstrImmediate(BC, offset, CompactBranchType::COMPACT_BRANCH); 1261 GenInstrImmediate(BC, offset, CompactBranchType::COMPACT_BRANCH);
1263 } 1262 }
1264 1263
1265 1264
1266 void Assembler::balc(int32_t offset) { 1265 void Assembler::balc(int32_t offset) {
1267 DCHECK(kArchVariant == kMips64r6); 1266 DCHECK(kArchVariant == kMips64r6);
1268 positions_recorder()->WriteRecordedPositions();
1269 GenInstrImmediate(BALC, offset, CompactBranchType::COMPACT_BRANCH); 1267 GenInstrImmediate(BALC, offset, CompactBranchType::COMPACT_BRANCH);
1270 } 1268 }
1271 1269
1272 1270
1273 void Assembler::beq(Register rs, Register rt, int16_t offset) { 1271 void Assembler::beq(Register rs, Register rt, int16_t offset) {
1274 BlockTrampolinePoolScope block_trampoline_pool(this); 1272 BlockTrampolinePoolScope block_trampoline_pool(this);
1275 GenInstrImmediate(BEQ, rs, rt, offset); 1273 GenInstrImmediate(BEQ, rs, rt, offset);
1276 BlockTrampolinePoolFor(1); // For associated delay slot. 1274 BlockTrampolinePoolFor(1); // For associated delay slot.
1277 } 1275 }
1278 1276
(...skipping 26 matching lines...) Expand all
1305 DCHECK(!(rs.is(zero_reg))); 1303 DCHECK(!(rs.is(zero_reg)));
1306 DCHECK(!(rt.is(zero_reg))); 1304 DCHECK(!(rt.is(zero_reg)));
1307 DCHECK(rs.code() != rt.code()); 1305 DCHECK(rs.code() != rt.code());
1308 GenInstrImmediate(BLEZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); 1306 GenInstrImmediate(BLEZL, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
1309 } 1307 }
1310 1308
1311 1309
1312 void Assembler::bgezal(Register rs, int16_t offset) { 1310 void Assembler::bgezal(Register rs, int16_t offset) {
1313 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg)); 1311 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg));
1314 BlockTrampolinePoolScope block_trampoline_pool(this); 1312 BlockTrampolinePoolScope block_trampoline_pool(this);
1315 positions_recorder()->WriteRecordedPositions();
1316 GenInstrImmediate(REGIMM, rs, BGEZAL, offset); 1313 GenInstrImmediate(REGIMM, rs, BGEZAL, offset);
1317 BlockTrampolinePoolFor(1); // For associated delay slot. 1314 BlockTrampolinePoolFor(1); // For associated delay slot.
1318 } 1315 }
1319 1316
1320 1317
1321 void Assembler::bgtz(Register rs, int16_t offset) { 1318 void Assembler::bgtz(Register rs, int16_t offset) {
1322 BlockTrampolinePoolScope block_trampoline_pool(this); 1319 BlockTrampolinePoolScope block_trampoline_pool(this);
1323 GenInstrImmediate(BGTZ, rs, zero_reg, offset); 1320 GenInstrImmediate(BGTZ, rs, zero_reg, offset);
1324 BlockTrampolinePoolFor(1); // For associated delay slot. 1321 BlockTrampolinePoolFor(1); // For associated delay slot.
1325 } 1322 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 void Assembler::bltz(Register rs, int16_t offset) { 1373 void Assembler::bltz(Register rs, int16_t offset) {
1377 BlockTrampolinePoolScope block_trampoline_pool(this); 1374 BlockTrampolinePoolScope block_trampoline_pool(this);
1378 GenInstrImmediate(REGIMM, rs, BLTZ, offset); 1375 GenInstrImmediate(REGIMM, rs, BLTZ, offset);
1379 BlockTrampolinePoolFor(1); // For associated delay slot. 1376 BlockTrampolinePoolFor(1); // For associated delay slot.
1380 } 1377 }
1381 1378
1382 1379
1383 void Assembler::bltzal(Register rs, int16_t offset) { 1380 void Assembler::bltzal(Register rs, int16_t offset) {
1384 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg)); 1381 DCHECK(kArchVariant != kMips64r6 || rs.is(zero_reg));
1385 BlockTrampolinePoolScope block_trampoline_pool(this); 1382 BlockTrampolinePoolScope block_trampoline_pool(this);
1386 positions_recorder()->WriteRecordedPositions();
1387 GenInstrImmediate(REGIMM, rs, BLTZAL, offset); 1383 GenInstrImmediate(REGIMM, rs, BLTZAL, offset);
1388 BlockTrampolinePoolFor(1); // For associated delay slot. 1384 BlockTrampolinePoolFor(1); // For associated delay slot.
1389 } 1385 }
1390 1386
1391 1387
1392 void Assembler::bne(Register rs, Register rt, int16_t offset) { 1388 void Assembler::bne(Register rs, Register rt, int16_t offset) {
1393 BlockTrampolinePoolScope block_trampoline_pool(this); 1389 BlockTrampolinePoolScope block_trampoline_pool(this);
1394 GenInstrImmediate(BNE, rs, rt, offset); 1390 GenInstrImmediate(BNE, rs, rt, offset);
1395 BlockTrampolinePoolFor(1); // For associated delay slot. 1391 BlockTrampolinePoolFor(1); // For associated delay slot.
1396 } 1392 }
(...skipping 15 matching lines...) Expand all
1412 GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); 1408 GenInstrImmediate(DADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
1413 } else { 1409 } else {
1414 GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH); 1410 GenInstrImmediate(DADDI, rt, rs, offset, CompactBranchType::COMPACT_BRANCH);
1415 } 1411 }
1416 } 1412 }
1417 1413
1418 1414
1419 void Assembler::blezalc(Register rt, int16_t offset) { 1415 void Assembler::blezalc(Register rt, int16_t offset) {
1420 DCHECK(kArchVariant == kMips64r6); 1416 DCHECK(kArchVariant == kMips64r6);
1421 DCHECK(!(rt.is(zero_reg))); 1417 DCHECK(!(rt.is(zero_reg)));
1422 positions_recorder()->WriteRecordedPositions();
1423 GenInstrImmediate(BLEZ, zero_reg, rt, offset, 1418 GenInstrImmediate(BLEZ, zero_reg, rt, offset,
1424 CompactBranchType::COMPACT_BRANCH); 1419 CompactBranchType::COMPACT_BRANCH);
1425 } 1420 }
1426 1421
1427 1422
1428 void Assembler::bgezalc(Register rt, int16_t offset) { 1423 void Assembler::bgezalc(Register rt, int16_t offset) {
1429 DCHECK(kArchVariant == kMips64r6); 1424 DCHECK(kArchVariant == kMips64r6);
1430 DCHECK(!(rt.is(zero_reg))); 1425 DCHECK(!(rt.is(zero_reg)));
1431 positions_recorder()->WriteRecordedPositions();
1432 GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); 1426 GenInstrImmediate(BLEZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
1433 } 1427 }
1434 1428
1435 1429
1436 void Assembler::bgezall(Register rs, int16_t offset) { 1430 void Assembler::bgezall(Register rs, int16_t offset) {
1437 DCHECK(kArchVariant != kMips64r6); 1431 DCHECK(kArchVariant != kMips64r6);
1438 DCHECK(!(rs.is(zero_reg))); 1432 DCHECK(!(rs.is(zero_reg)));
1439 BlockTrampolinePoolScope block_trampoline_pool(this); 1433 BlockTrampolinePoolScope block_trampoline_pool(this);
1440 positions_recorder()->WriteRecordedPositions();
1441 GenInstrImmediate(REGIMM, rs, BGEZALL, offset); 1434 GenInstrImmediate(REGIMM, rs, BGEZALL, offset);
1442 BlockTrampolinePoolFor(1); // For associated delay slot. 1435 BlockTrampolinePoolFor(1); // For associated delay slot.
1443 } 1436 }
1444 1437
1445 1438
1446 void Assembler::bltzalc(Register rt, int16_t offset) { 1439 void Assembler::bltzalc(Register rt, int16_t offset) {
1447 DCHECK(kArchVariant == kMips64r6); 1440 DCHECK(kArchVariant == kMips64r6);
1448 DCHECK(!(rt.is(zero_reg))); 1441 DCHECK(!(rt.is(zero_reg)));
1449 positions_recorder()->WriteRecordedPositions();
1450 GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH); 1442 GenInstrImmediate(BGTZ, rt, rt, offset, CompactBranchType::COMPACT_BRANCH);
1451 } 1443 }
1452 1444
1453 1445
1454 void Assembler::bgtzalc(Register rt, int16_t offset) { 1446 void Assembler::bgtzalc(Register rt, int16_t offset) {
1455 DCHECK(kArchVariant == kMips64r6); 1447 DCHECK(kArchVariant == kMips64r6);
1456 DCHECK(!(rt.is(zero_reg))); 1448 DCHECK(!(rt.is(zero_reg)));
1457 positions_recorder()->WriteRecordedPositions();
1458 GenInstrImmediate(BGTZ, zero_reg, rt, offset, 1449 GenInstrImmediate(BGTZ, zero_reg, rt, offset,
1459 CompactBranchType::COMPACT_BRANCH); 1450 CompactBranchType::COMPACT_BRANCH);
1460 } 1451 }
1461 1452
1462 1453
1463 void Assembler::beqzalc(Register rt, int16_t offset) { 1454 void Assembler::beqzalc(Register rt, int16_t offset) {
1464 DCHECK(kArchVariant == kMips64r6); 1455 DCHECK(kArchVariant == kMips64r6);
1465 DCHECK(!(rt.is(zero_reg))); 1456 DCHECK(!(rt.is(zero_reg)));
1466 positions_recorder()->WriteRecordedPositions();
1467 GenInstrImmediate(ADDI, zero_reg, rt, offset, 1457 GenInstrImmediate(ADDI, zero_reg, rt, offset,
1468 CompactBranchType::COMPACT_BRANCH); 1458 CompactBranchType::COMPACT_BRANCH);
1469 } 1459 }
1470 1460
1471 1461
1472 void Assembler::bnezalc(Register rt, int16_t offset) { 1462 void Assembler::bnezalc(Register rt, int16_t offset) {
1473 DCHECK(kArchVariant == kMips64r6); 1463 DCHECK(kArchVariant == kMips64r6);
1474 DCHECK(!(rt.is(zero_reg))); 1464 DCHECK(!(rt.is(zero_reg)));
1475 positions_recorder()->WriteRecordedPositions();
1476 GenInstrImmediate(DADDI, zero_reg, rt, offset, 1465 GenInstrImmediate(DADDI, zero_reg, rt, offset,
1477 CompactBranchType::COMPACT_BRANCH); 1466 CompactBranchType::COMPACT_BRANCH);
1478 } 1467 }
1479 1468
1480 1469
1481 void Assembler::beqc(Register rs, Register rt, int16_t offset) { 1470 void Assembler::beqc(Register rs, Register rt, int16_t offset) {
1482 DCHECK(kArchVariant == kMips64r6); 1471 DCHECK(kArchVariant == kMips64r6);
1483 DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0); 1472 DCHECK(rs.code() != rt.code() && rs.code() != 0 && rt.code() != 0);
1484 if (rs.code() < rt.code()) { 1473 if (rs.code() < rt.code()) {
1485 GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH); 1474 GenInstrImmediate(ADDI, rs, rt, offset, CompactBranchType::COMPACT_BRANCH);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 } else { 1520 } else {
1532 j(imm); 1521 j(imm);
1533 } 1522 }
1534 } 1523 }
1535 1524
1536 1525
1537 void Assembler::jal(Label* target) { 1526 void Assembler::jal(Label* target) {
1538 uint64_t imm = jump_offset(target); 1527 uint64_t imm = jump_offset(target);
1539 if (target->is_bound()) { 1528 if (target->is_bound()) {
1540 BlockTrampolinePoolScope block_trampoline_pool(this); 1529 BlockTrampolinePoolScope block_trampoline_pool(this);
1541 positions_recorder()->WriteRecordedPositions();
1542 GenInstrJump(static_cast<Opcode>(kJalRawMark), 1530 GenInstrJump(static_cast<Opcode>(kJalRawMark),
1543 static_cast<uint32_t>(imm >> 2) & kImm26Mask); 1531 static_cast<uint32_t>(imm >> 2) & kImm26Mask);
1544 BlockTrampolinePoolFor(1); // For associated delay slot. 1532 BlockTrampolinePoolFor(1); // For associated delay slot.
1545 } else { 1533 } else {
1546 jal(imm); 1534 jal(imm);
1547 } 1535 }
1548 } 1536 }
1549 1537
1550 1538
1551 void Assembler::jr(Register rs) { 1539 void Assembler::jr(Register rs) {
1552 if (kArchVariant != kMips64r6) { 1540 if (kArchVariant != kMips64r6) {
1553 BlockTrampolinePoolScope block_trampoline_pool(this); 1541 BlockTrampolinePoolScope block_trampoline_pool(this);
1554 if (rs.is(ra)) {
1555 positions_recorder()->WriteRecordedPositions();
1556 }
1557 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR); 1542 GenInstrRegister(SPECIAL, rs, zero_reg, zero_reg, 0, JR);
1558 BlockTrampolinePoolFor(1); // For associated delay slot. 1543 BlockTrampolinePoolFor(1); // For associated delay slot.
1559 } else { 1544 } else {
1560 jalr(rs, zero_reg); 1545 jalr(rs, zero_reg);
1561 } 1546 }
1562 } 1547 }
1563 1548
1564 1549
1565 void Assembler::jal(int64_t target) { 1550 void Assembler::jal(int64_t target) {
1566 BlockTrampolinePoolScope block_trampoline_pool(this); 1551 BlockTrampolinePoolScope block_trampoline_pool(this);
1567 positions_recorder()->WriteRecordedPositions();
1568 GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask); 1552 GenInstrJump(JAL, static_cast<uint32_t>(target >> 2) & kImm26Mask);
1569 BlockTrampolinePoolFor(1); // For associated delay slot. 1553 BlockTrampolinePoolFor(1); // For associated delay slot.
1570 } 1554 }
1571 1555
1572 1556
1573 void Assembler::jalr(Register rs, Register rd) { 1557 void Assembler::jalr(Register rs, Register rd) {
1574 DCHECK(rs.code() != rd.code()); 1558 DCHECK(rs.code() != rd.code());
1575 BlockTrampolinePoolScope block_trampoline_pool(this); 1559 BlockTrampolinePoolScope block_trampoline_pool(this);
1576 positions_recorder()->WriteRecordedPositions();
1577 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR); 1560 GenInstrRegister(SPECIAL, rs, zero_reg, rd, 0, JALR);
1578 BlockTrampolinePoolFor(1); // For associated delay slot. 1561 BlockTrampolinePoolFor(1); // For associated delay slot.
1579 } 1562 }
1580 1563
1581 1564
1582 void Assembler::jic(Register rt, int16_t offset) { 1565 void Assembler::jic(Register rt, int16_t offset) {
1583 DCHECK(kArchVariant == kMips64r6); 1566 DCHECK(kArchVariant == kMips64r6);
1584 GenInstrImmediate(POP66, zero_reg, rt, offset); 1567 GenInstrImmediate(POP66, zero_reg, rt, offset);
1585 } 1568 }
1586 1569
1587 1570
1588 void Assembler::jialc(Register rt, int16_t offset) { 1571 void Assembler::jialc(Register rt, int16_t offset) {
1589 DCHECK(kArchVariant == kMips64r6); 1572 DCHECK(kArchVariant == kMips64r6);
1590 positions_recorder()->WriteRecordedPositions();
1591 GenInstrImmediate(POP76, zero_reg, rt, offset); 1573 GenInstrImmediate(POP76, zero_reg, rt, offset);
1592 } 1574 }
1593 1575
1594 1576
1595 // -------Data-processing-instructions--------- 1577 // -------Data-processing-instructions---------
1596 1578
1597 // Arithmetic. 1579 // Arithmetic.
1598 1580
1599 void Assembler::addu(Register rd, Register rs, Register rt) { 1581 void Assembler::addu(Register rd, Register rs, Register rt) {
1600 GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU); 1582 GenInstrRegister(SPECIAL, rs, rt, rd, 0, ADDU);
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after
3439 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3421 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3440 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); 3422 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize);
3441 } 3423 }
3442 } 3424 }
3443 3425
3444 3426
3445 } // namespace internal 3427 } // namespace internal
3446 } // namespace v8 3428 } // namespace v8
3447 3429
3448 #endif // V8_TARGET_ARCH_MIPS64 3430 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.cc ('k') | src/mips64/macro-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698