@@ -1444,10 +1444,6 @@ int Assembler::branch_offset(Label* L) {
1444
1444
L->link_to (pc_offset ());
1445
1445
}
1446
1446
1447
- // Block the emission of the constant pool, since the branch instruction must
1448
- // be emitted at the pc offset recorded by the label.
1449
- if (!is_const_pool_blocked ()) BlockConstPoolFor (1 );
1450
-
1451
1447
return target_pos - (pc_offset () + Instruction::kPcLoadDelta );
1452
1448
}
1453
1449
@@ -1458,6 +1454,11 @@ void Assembler::b(int branch_offset, Condition cond, RelocInfo::Mode rmode) {
1458
1454
int imm24 = branch_offset >> 2 ;
1459
1455
const bool b_imm_check = is_int24 (imm24);
1460
1456
CHECK (b_imm_check);
1457
+
1458
+ // Block the emission of the constant pool before the next instruction.
1459
+ // Otherwise the passed-in branch offset would be off.
1460
+ BlockConstPoolFor (1 );
1461
+
1461
1462
emit (cond | B27 | B25 | (imm24 & kImm24Mask ));
1462
1463
1463
1464
if (cond == al) {
@@ -1472,6 +1473,11 @@ void Assembler::bl(int branch_offset, Condition cond, RelocInfo::Mode rmode) {
1472
1473
int imm24 = branch_offset >> 2 ;
1473
1474
const bool bl_imm_check = is_int24 (imm24);
1474
1475
CHECK (bl_imm_check);
1476
+
1477
+ // Block the emission of the constant pool before the next instruction.
1478
+ // Otherwise the passed-in branch offset would be off.
1479
+ BlockConstPoolFor (1 );
1480
+
1475
1481
emit (cond | B27 | B25 | B24 | (imm24 & kImm24Mask ));
1476
1482
}
1477
1483
@@ -1481,6 +1487,11 @@ void Assembler::blx(int branch_offset) {
1481
1487
int imm24 = branch_offset >> 2 ;
1482
1488
const bool blx_imm_check = is_int24 (imm24);
1483
1489
CHECK (blx_imm_check);
1490
+
1491
+ // Block the emission of the constant pool before the next instruction.
1492
+ // Otherwise the passed-in branch offset would be off.
1493
+ BlockConstPoolFor (1 );
1494
+
1484
1495
emit (kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask ));
1485
1496
}
1486
1497
0 commit comments