Reviewers: jochen, ulan,

Description:
A64: Let the MacroAssembler resolve branches to distant targets.

Code generation would fail when assembling a branch to a label that is bound
outside the immediate range of the instruction. A64 is sensitive to this, as the various branching instructions have different ranges, going down to +-32KB for TBZ/TBNZ. The MacroAssembler is augmented to handle branches to targets that
may exceed the immediate range of instructions.

When branching backward to a label exceeding the instruction range, the
MacroAssembler can simply tweak the generated code to use an unconditional
branch with a longer range. For example instead of
    B(cond, &label);
the MacroAssembler can generate:
    b(InvertCondition(cond), &done);
    b(&label);
    bind(&done);

Since the target is not known when the branch is emitted, forward branches uses
a different mechanism. The MacroAssembler keeps track of forward branches to
unbound labels. When the code generation approaches the end of the range of a
branch, a veneer is generated for the branch.

BUG=3148

Please review this at https://codereview.chromium.org/168583009/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+757, -66 lines):
  src/a64/assembler-a64-inl.h
  src/a64/assembler-a64.h
  src/a64/assembler-a64.cc
  src/a64/instructions-a64.h
  src/a64/instructions-a64.cc
  src/a64/macro-assembler-a64-inl.h
  src/a64/macro-assembler-a64.h
  src/a64/macro-assembler-a64.cc
  test/cctest/test-assembler-a64.cc
  test/mjsunit/mjsunit.status
  test/mozilla/mozilla.status


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to