Commit d0553882 authored by bmeurer's avatar bmeurer Committed by Commit bot

[arm] Fix missing CheckBuffer for branches.

The b, bl and blx methods that take labels basically ignore the constant
pool check and just block the constant pool for the next instruction.
This way a long enough sequence of those instructions will block can
potentially block the constant pool emission for too long.

BUG=v8:4292
LOG=y
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/1223093004

Cr-Commit-Position: refs/heads/master@{#29550}
parent fde4173a
......@@ -1377,6 +1377,24 @@ void Assembler::bx(Register target, Condition cond) { // v5 and above, plus v4t
}
void Assembler::b(Label* L, Condition cond) {
CheckBuffer();
b(branch_offset(L), cond);
}
void Assembler::bl(Label* L, Condition cond) {
CheckBuffer();
bl(branch_offset(L), cond);
}
void Assembler::blx(Label* L) {
CheckBuffer();
blx(branch_offset(L));
}
// Data-processing instructions.
void Assembler::and_(Register dst, Register src1, const Operand& src2,
......
......@@ -806,11 +806,11 @@ class Assembler : public AssemblerBase {
void bx(Register target, Condition cond = al); // v5 and above, plus v4t
// Convenience branch instructions using labels
void b(Label* L, Condition cond = al) { b(branch_offset(L), cond); }
void b(Label* L, Condition cond = al);
void b(Condition cond, Label* L) { b(L, cond); }
void bl(Label* L, Condition cond = al) { bl(branch_offset(L), cond); }
void bl(Condition cond, Label* L) { bl(branch_offset(L), cond); }
void blx(Label* L) { blx(branch_offset(L)); } // v5 and above
void bl(Label* L, Condition cond = al);
void bl(Condition cond, Label* L) { bl(L, cond); }
void blx(Label* L); // v5 and above
// Data-processing instructions
......
......@@ -1981,4 +1981,50 @@ TEST(ARMv8_vrintX) {
#undef CHECK_VRINT
}
}
TEST(regress4292_b) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
Label end;
__ mov(r0, Operand(isolate->factory()->infinity_value()));
for (int i = 0; i < 1020; ++i) {
__ b(hi, &end);
}
__ bind(&end);
}
TEST(regress4292_bl) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
Label end;
__ mov(r0, Operand(isolate->factory()->infinity_value()));
for (int i = 0; i < 1020; ++i) {
__ bl(hi, &end);
}
__ bind(&end);
}
TEST(regress4292_blx) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
Assembler assm(isolate, NULL, 0);
Label end;
__ mov(r0, Operand(isolate->factory()->infinity_value()));
for (int i = 0; i < 1020; ++i) {
__ blx(&end);
}
__ bind(&end);
}
#undef __
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment