Commit 0e1b46ba authored by erik.corry's avatar erik.corry Committed by Commit bot

Fix quadratic test in debug-mode ARM64 assembler

R=jkummerow@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#25848}
parent 52e487d7
......@@ -603,9 +603,12 @@ void Assembler::Align(int m) {
void Assembler::CheckLabelLinkChain(Label const * label) {
#ifdef DEBUG
if (label->is_linked()) {
static const int kMaxLinksToCheck = 256; // Avoid O(n2) behaviour.
int links_checked = 0;
int linkoffset = label->pos();
bool end_of_chain = false;
while (!end_of_chain) {
if (++links_checked > kMaxLinksToCheck) break;
Instruction * link = InstructionAt(linkoffset);
int linkpcoffset = link->ImmPCOffset();
int prevlinkoffset = linkoffset + linkpcoffset;
......
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