Check-in [37e31228d6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add line population change count to show when a line has gone back (such as for loops).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:37e31228d6f33ff043e9324e506ca4b2bbec8847
User & Date: stephanie.gawroriski 2019-06-12 19:00:19
Context
2019-06-12
19:43
Bi-column printing of instructions. check-in: fcf295dc4d user: stephanie.gawroriski tags: trunk
19:00
Add line population change count to show when a line has gone back (such as for loops). check-in: 37e31228d6 user: stephanie.gawroriski tags: trunk
18:54
Add side by side debug to compare byte code and native instructions. check-in: 1429835cc3 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bldt/mids/sxs/dev/shadowtail/sxs/Main.java.

21
22
23
24
25
26
27

28

29
30
31
32
33
34
35
..
53
54
55
56
57
58
59



60
61
62
63
64
65
66
..
86
87
88
89
90
91
92






93
94
95
96
97
98
99

100
101
102
103
104
105
106
import dev.shadowtail.classfile.nncc.NativeInstructionType;
import dev.shadowtail.classfile.nncc.NativeCode;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;

import java.util.List;

import net.multiphasicapps.classfile.ByteCode;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.Method;
import net.multiphasicapps.javac.CompilerPathSet;
import net.multiphasicapps.javac.NoSuchInputException;

/**
................................................................................
		throws NullPointerException
	{
		if (__ps == null || __srclines == null || __m == null)
			throw new NullPointerException("NARG");
		
		// Note what is being dumped
		__ps.printf("****** %s ******%n", __m.nameAndType());



		
		// Get byte code and native code
		ByteCode bc = __m.byteCode();
		NativeCode nc = __m.nativeCode();
		
		// Native debug information
		int nijln = -1,
................................................................................
				nijop = (ni.intArgument(1) & 0xFF);
				nijpc = ni.intArgument(2);
			}
			
			// Change of source line?
			if (nijln != lljln)
			{






				// Get the line, turn tabs to spaces to save room
				String ln = (nijln > 0 && nijln <= __srclines.size() ?
					__srclines.get(nijln - 1) : "<INVALID LINE?>").
					replace('\t', ' ');
				
				// Print the line text
				__ps.printf("    L%03d: %s%n", nijln, ln);

				
				// Set new last line
				lljln = nijln;
			}
			
			//__ps.println(ni);
		}







>

>







 







>
>
>







 







>
>
>
>
>
>






|
>







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import dev.shadowtail.classfile.nncc.NativeInstructionType;
import dev.shadowtail.classfile.nncc.NativeCode;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.multiphasicapps.classfile.ByteCode;
import net.multiphasicapps.classfile.ClassFile;
import net.multiphasicapps.classfile.Method;
import net.multiphasicapps.javac.CompilerPathSet;
import net.multiphasicapps.javac.NoSuchInputException;

/**
................................................................................
		throws NullPointerException
	{
		if (__ps == null || __srclines == null || __m == null)
			throw new NullPointerException("NARG");
		
		// Note what is being dumped
		__ps.printf("****** %s ******%n", __m.nameAndType());
		
		// Line population count, to track how many times it changed to them
		Map<Integer, Integer> lnpopcount = new HashMap<>();
		
		// Get byte code and native code
		ByteCode bc = __m.byteCode();
		NativeCode nc = __m.nativeCode();
		
		// Native debug information
		int nijln = -1,
................................................................................
				nijop = (ni.intArgument(1) & 0xFF);
				nijpc = ni.intArgument(2);
			}
			
			// Change of source line?
			if (nijln != lljln)
			{
				// Get population of this line
				Integer popcount = lnpopcount.get(nijln);
				if (popcount == null)
					popcount = Integer.valueOf(1);
				lnpopcount.put(nijln, popcount + 1);
				
				// Get the line, turn tabs to spaces to save room
				String ln = (nijln > 0 && nijln <= __srclines.size() ?
					__srclines.get(nijln - 1) : "<INVALID LINE?>").
					replace('\t', ' ');
				
				// Print the line text
				__ps.printf("    L%4d%3s: %s%n", nijln, (popcount > 1 ?
					String.format("+%-2d", popcount) : "   "), ln);
				
				// Set new last line
				lljln = nijln;
			}
			
			//__ps.println(ni);
		}