@@ -1455,10 +1455,6 @@ int Assembler::branch_offset(Label* L) {
1455
1455
L->link_to (pc_offset ());
1456
1456
}
1457
1457
1458
- // Block the emission of the constant pool, since the branch instruction must
1459
- // be emitted at the pc offset recorded by the label.
1460
- if (!is_const_pool_blocked ()) BlockConstPoolFor (1 );
1461
-
1462
1458
return target_pos - (pc_offset () + Instruction::kPcLoadDelta );
1463
1459
}
1464
1460
@@ -1469,6 +1465,11 @@ void Assembler::b(int branch_offset, Condition cond, RelocInfo::Mode rmode) {
1469
1465
int imm24 = branch_offset >> 2 ;
1470
1466
const bool b_imm_check = is_int24 (imm24);
1471
1467
CHECK (b_imm_check);
1468
+
1469
+ // Block the emission of the constant pool before the next instruction.
1470
+ // Otherwise the passed-in branch offset would be off.
1471
+ BlockConstPoolFor (1 );
1472
+
1472
1473
emit (cond | B27 | B25 | (imm24 & kImm24Mask ));
1473
1474
1474
1475
if (cond == al) {
@@ -1483,6 +1484,11 @@ void Assembler::bl(int branch_offset, Condition cond, RelocInfo::Mode rmode) {
1483
1484
int imm24 = branch_offset >> 2 ;
1484
1485
const bool bl_imm_check = is_int24 (imm24);
1485
1486
CHECK (bl_imm_check);
1487
+
1488
+ // Block the emission of the constant pool before the next instruction.
1489
+ // Otherwise the passed-in branch offset would be off.
1490
+ BlockConstPoolFor (1 );
1491
+
1486
1492
emit (cond | B27 | B25 | B24 | (imm24 & kImm24Mask ));
1487
1493
}
1488
1494
@@ -1492,6 +1498,11 @@ void Assembler::blx(int branch_offset) {
1492
1498
int imm24 = branch_offset >> 2 ;
1493
1499
const bool blx_imm_check = is_int24 (imm24);
1494
1500
CHECK (blx_imm_check);
1501
+
1502
+ // Block the emission of the constant pool before the next instruction.
1503
+ // Otherwise the passed-in branch offset would be off.
1504
+ BlockConstPoolFor (1 );
1505
+
1495
1506
emit (kSpecialCondition | B27 | B25 | h | (imm24 & kImm24Mask ));
1496
1507
}
1497
1508
0 commit comments