Tidy up some comments.
This commit is contained in:
@@ -1510,11 +1510,11 @@ jt_base = TailRecipe(
|
|||||||
'jt_base', BranchTableBase, size=5, ins=(), outs=(GPR),
|
'jt_base', BranchTableBase, size=5, ins=(), outs=(GPR),
|
||||||
clobbers_flags=False,
|
clobbers_flags=False,
|
||||||
emit='''
|
emit='''
|
||||||
// No reloc is needed here as the jump table is emitted directly after
|
|
||||||
// the function body.
|
|
||||||
PUT_OP(bits, rex2(0, out_reg0), sink);
|
PUT_OP(bits, rex2(0, out_reg0), sink);
|
||||||
modrm_riprel(out_reg0, sink);
|
modrm_riprel(out_reg0, sink);
|
||||||
|
|
||||||
|
// No reloc is needed here as the jump table is emitted directly after
|
||||||
|
// the function body.
|
||||||
jt_disp4(table, func, sink);
|
jt_disp4(table, func, sink);
|
||||||
''')
|
''')
|
||||||
|
|
||||||
|
|||||||
@@ -328,12 +328,13 @@ fn disp1<CS: CodeSink + ?Sized>(destination: Ebb, func: &Function, sink: &mut CS
|
|||||||
sink.put1(delta as u8);
|
sink.put1(delta as u8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Emit a single-byte branch displacement to `destination`.
|
/// Emit a four-byte branch displacement to `destination`.
|
||||||
fn disp4<CS: CodeSink + ?Sized>(destination: Ebb, func: &Function, sink: &mut CS) {
|
fn disp4<CS: CodeSink + ?Sized>(destination: Ebb, func: &Function, sink: &mut CS) {
|
||||||
let delta = func.offsets[destination].wrapping_sub(sink.offset() + 4);
|
let delta = func.offsets[destination].wrapping_sub(sink.offset() + 4);
|
||||||
sink.put4(delta);
|
sink.put4(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Emit a four-byte displacement to jump table `jt`.
|
||||||
fn jt_disp4<CS: CodeSink + ?Sized>(jt: JumpTable, func: &Function, sink: &mut CS) {
|
fn jt_disp4<CS: CodeSink + ?Sized>(jt: JumpTable, func: &Function, sink: &mut CS) {
|
||||||
let delta = func.jt_offsets[jt].wrapping_sub(sink.offset() + 4);
|
let delta = func.jt_offsets[jt].wrapping_sub(sink.offset() + 4);
|
||||||
sink.put4(delta);
|
sink.put4(delta);
|
||||||
|
|||||||
Reference in New Issue
Block a user