Check-in [669209976b]

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

Overview
Comment:Remove GC debug.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 669209976b3d7ff94886d2285791de861c945071
User & Date: stephanie.gawroriski 2019-10-27 17:40:21
Context
2019-10-27
22:18
Add base code for a tracker of the last given number of instructions for debugging. check-in: dde65d339e user: stephanie.gawroriski tags: trunk
17:40
Remove GC debug. check-in: 669209976b user: stephanie.gawroriski tags: trunk
17:30
Some moving around. check-in: 07268ce39f user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/klib/supervisor/cc/squirreljme/jvm/JVMFunction.java.

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
		
		// {@squirreljme.error SV0i Garbage collecting an object which is
		// currently locked by a thread.}
		if (0 != Assembly.atomicCompareGetAndSet(0, 0,
			__p + Constants.OBJECT_MONITOR_OFFSET))
			throw new VirtualMachineError("SV0i");
		
		// Debug
		/*todo.DEBUG.code('G', 'C', __p);*/
		
		// Get class info for this type
		ClassInfo pinfo = Assembly.pointerToClassInfo(pcl);
		
		// If this is an array, elements have to be uncounted
		// Instance fields can be skipped for non-object arrays
		if ((pinfo.flags & Constants.CIF_IS_ARRAY) != 0)
		{
			/*todo.DEBUG.code('G', 'a', 1);*/
			
			// This only needs to be done for objects
			if ((pinfo.flags & Constants.CIF_IS_ARRAY_OF_OBJECTS) != 0)
			{
				/*todo.DEBUG.code('G', 'o', 1);*/
				
				// Go through all elements and uncount them
				int n = Assembly.memReadInt(__p,
					Constants.ARRAY_LENGTH_OFFSET);
				for (int i = 0, bp = __p + Constants.ARRAY_BASE_SIZE, xp = 0;
					i < n; i++, xp += 4)
					Assembly.refUncount(Assembly.memReadInt(bp, xp));
			}
		}
		
		// Otherwise uncount the instance field information
		else
		{
			/*todo.DEBUG.code('G', 'o', 1);*/
			
			// Go through all classes in the class chain
			for (ClassInfo ro = pinfo; ro != null; ro = ro.superclass)
			{
				// Actual base position for the objects in the instances
				int rbase = __p + ro.base;
				
				// Clear all offsets in the object







<
<
<







<
<



<
<












<
<







109
110
111
112
113
114
115



116
117
118
119
120
121
122


123
124
125


126
127
128
129
130
131
132
133
134
135
136
137


138
139
140
141
142
143
144
		
		// {@squirreljme.error SV0i Garbage collecting an object which is
		// currently locked by a thread.}
		if (0 != Assembly.atomicCompareGetAndSet(0, 0,
			__p + Constants.OBJECT_MONITOR_OFFSET))
			throw new VirtualMachineError("SV0i");
		



		// Get class info for this type
		ClassInfo pinfo = Assembly.pointerToClassInfo(pcl);
		
		// If this is an array, elements have to be uncounted
		// Instance fields can be skipped for non-object arrays
		if ((pinfo.flags & Constants.CIF_IS_ARRAY) != 0)
		{


			// This only needs to be done for objects
			if ((pinfo.flags & Constants.CIF_IS_ARRAY_OF_OBJECTS) != 0)
			{


				// Go through all elements and uncount them
				int n = Assembly.memReadInt(__p,
					Constants.ARRAY_LENGTH_OFFSET);
				for (int i = 0, bp = __p + Constants.ARRAY_BASE_SIZE, xp = 0;
					i < n; i++, xp += 4)
					Assembly.refUncount(Assembly.memReadInt(bp, xp));
			}
		}
		
		// Otherwise uncount the instance field information
		else
		{


			// Go through all classes in the class chain
			for (ClassInfo ro = pinfo; ro != null; ro = ro.superclass)
			{
				// Actual base position for the objects in the instances
				int rbase = __p + ro.base;
				
				// Clear all offsets in the object