From b7603e71510b4d0e82681b9639a56cc77bab40d6 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Mon, 7 Apr 2025 14:50:30 -0700 Subject: Update Encoding.java --- .../src/main/java/com/seaofnodes/simple/codegen/Encoding.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'chapter21/src/main/java/com') diff --git a/chapter21/src/main/java/com/seaofnodes/simple/codegen/Encoding.java b/chapter21/src/main/java/com/seaofnodes/simple/codegen/Encoding.java index 679329f7..10d70a4f 100644 --- a/chapter21/src/main/java/com/seaofnodes/simple/codegen/Encoding.java +++ b/chapter21/src/main/java/com/seaofnodes/simple/codegen/Encoding.java @@ -337,11 +337,10 @@ public class Encoding { slide += (newStart+15 & -16)-newStart; } _opStart[bb._nid] += slide; - for( Node n : bb._outputs ) { - if( n instanceof MachNode && !(n instanceof CFGNode) ) { + // Slide down all other (non-CFG) ops in the block + for( Node n : bb._outputs ) + if( n instanceof MachNode && !(n instanceof CFGNode) ) _opStart[n._nid] += slide; - } - } if( bb instanceof RIPRelSize riprel ) { CFGNode target = ((CFGNode)bb.out(0)).uctrlSkipEmpty(); // Delta is from opStart to opStart. X86 at least counts -- cgit v1.2.3