Index: src/a64/assembler-a64.cc |
diff --git a/src/a64/assembler-a64.cc b/src/a64/assembler-a64.cc |
index 51542b27da0d1cdc5230cc5a6d3f8c149644cdfe..2bffc587f28e8069457c3c08a1d0751beaa66217 100644 |
--- a/src/a64/assembler-a64.cc |
+++ b/src/a64/assembler-a64.cc |
@@ -2548,7 +2548,7 @@ void Assembler::CheckConstPool(bool force_emit, bool require_jump) { |
// Emit veneers for branches that would go out of range during emission of the |
// constant pool. |
- CheckVeneerPool(require_jump, kVeneerDistanceMargin + pool_size); |
+ CheckVeneerPool(false, require_jump, kVeneerDistanceMargin + pool_size); |
Label size_check; |
bind(&size_check); |
@@ -2641,7 +2641,7 @@ void Assembler::RecordVeneerPool(int location_offset, int size) { |
} |
-void Assembler::EmitVeneers(bool need_protection, int margin) { |
+void Assembler::EmitVeneers(bool force_emit, bool need_protection, int margin) { |
BlockPoolsScope scope(this); |
RecordComment("[ Veneers"); |
@@ -2667,7 +2667,7 @@ void Assembler::EmitVeneers(bool need_protection, int margin) { |
it = unresolved_branches_.begin(); |
while (it != unresolved_branches_.end()) { |
- if (ShouldEmitVeneer(it->first, margin)) { |
+ if (force_emit || ShouldEmitVeneer(it->first, margin)) { |
Instruction* branch = InstructionAt(it->second.pc_offset_); |
Label* label = it->second.label_; |
@@ -2710,7 +2710,7 @@ void Assembler::EmitVeneers(bool need_protection, int margin) { |
} |
-void Assembler::CheckVeneerPool(bool require_jump, |
+void Assembler::CheckVeneerPool(bool force_emit, bool require_jump, |
int margin) { |
// There is nothing to do if there are no pending veneer pool entries. |
if (unresolved_branches_.empty()) { |
@@ -2724,6 +2724,7 @@ void Assembler::CheckVeneerPool(bool require_jump, |
// emission, such sequences are protected by calls to BlockVeneerPoolFor and |
// BlockVeneerPoolScope. |
if (is_veneer_pool_blocked()) { |
+ ASSERT(!force_emit); |
return; |
} |
@@ -2731,8 +2732,8 @@ void Assembler::CheckVeneerPool(bool require_jump, |
// Prefer emitting veneers protected by an existing instruction. |
margin *= kVeneerNoProtectionFactor; |
} |
- if (ShouldEmitVeneers(margin)) { |
- EmitVeneers(require_jump, margin); |
+ if (force_emit || ShouldEmitVeneers(margin)) { |
+ EmitVeneers(force_emit, require_jump, margin); |
} else { |
next_veneer_pool_check_ = |
unresolved_branches_first_limit() - kVeneerDistanceCheckMargin; |