Check-in [4d4b57a42e]

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

Overview
Comment:Add branched out printing for object to/from pointer.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d4b57a42e4eb1ea803273d7a974dacc7ba54fd9
User & Date: stephanie.gawroriski 2019-10-06 21:55:21
Context
2019-10-07
21:18
Implement part of Nokia DirectUtils. check-in: 1bef9840e9 user: stephanie.gawroriski tags: trunk
07:06
Backup developer notes. check-in: 4925a0c40f user: squirreljme tags: trunk
2019-10-06
21:55
Add branched out printing for object to/from pointer. check-in: 4d4b57a42e user: stephanie.gawroriski tags: trunk
16:14
Add sleep to SummerCoat. check-in: 385dc4f7e2 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bldt/javase/libs/javase-runtime/cc/squirreljme/jvm/Assembly.java.

1795
1796
1797
1798
1799
1800
1801




1802
1803
1804
1805
1806
1807
1808
....
1817
1818
1819
1820
1821
1822
1823





1824
1825
1826
1827
1828
1829
1830
	 * @since 2019/06/17
	 */
	private static Object __uniqueObject(int __id)
	{
		if (__id == 0)
			return null;
			




		Map<Object, Integer> objects = Assembly._OBJECTS;
		synchronized (objects)
		{
			for (Map.Entry<Object, Integer> e : objects.entrySet())
				if (__id == e.getValue().intValue())
					return e.getKey();
		}
................................................................................
	 * @return The ID of the given object.
	 * @since 2019/06/17
	 */
	private static int __uniqueObjectId(Object __o)
	{
		if (__o == null)
			return 0;





		
		Map<Object, Integer> objects = Assembly._OBJECTS;
		synchronized (objects)
		{
			Integer rv = objects.get(__o);
			if (rv == null)
				objects.put(__o, (rv = 1 + objects.size()));







>
>
>
>







 







>
>
>
>
>







1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
....
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
	 * @since 2019/06/17
	 */
	private static Object __uniqueObject(int __id)
	{
		if (__id == 0)
			return null;
			
		// {@squirreljme.error AF0e Aliased pointer to object. (Value)}
		if (false)
			new Throwable(String.format("AF0e %08x", __id)).printStackTrace();
			
		Map<Object, Integer> objects = Assembly._OBJECTS;
		synchronized (objects)
		{
			for (Map.Entry<Object, Integer> e : objects.entrySet())
				if (__id == e.getValue().intValue())
					return e.getKey();
		}
................................................................................
	 * @return The ID of the given object.
	 * @since 2019/06/17
	 */
	private static int __uniqueObjectId(Object __o)
	{
		if (__o == null)
			return 0;
			
		// {@squirreljme.error AF0d Aliased object to pointer. (Value)}
		if (false)
			new Throwable(String.format("AF0d %s@%x", __o.getClass().
				getName(), System.identityHashCode(__o))).printStackTrace();
		
		Map<Object, Integer> objects = Assembly._OBJECTS;
		synchronized (objects)
		{
			Integer rv = objects.get(__o);
			if (rv == null)
				objects.put(__o, (rv = 1 + objects.size()));

Changes to runt/libs/springcoat-vm/cc/squirreljme/vm/springcoat/SpringThreadWorker.java.

4471
4472
4473
4474
4475
4476
4477





4478
4479
4480
4481
4482
4483
4484
....
4500
4501
4502
4503
4504
4505
4506





4507
4508
4509
4510
4511
4512
4513
		if (__p == SpringNullObject.NULL)
			return 0;
		
		// Lock
		Map<Integer, SpringObject> ubi = this.machine._uniquebyint;
		synchronized (ubi)
		{





			// See if it already has been mapped?
			for (Map.Entry<Integer, SpringObject> e : ubi.entrySet())
				if (e.getValue() == __p)
					return e.getKey();
			
			// Otherwise add it
			int rv = ubi.size() + 1;
................................................................................
		if (__p == 0)
			return SpringNullObject.NULL;
		
		// Find mapped object already
		Map<Integer, SpringObject> ubi = this.machine._uniquebyint;
		synchronized (ubi)
		{





			SpringObject rv = ubi.get(__p);
			if (rv == null)
				return SpringNullObject.NULL;
			return rv;
		}
	}
	







>
>
>
>
>







 







>
>
>
>
>







4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
....
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
		if (__p == SpringNullObject.NULL)
			return 0;
		
		// Lock
		Map<Integer, SpringObject> ubi = this.machine._uniquebyint;
		synchronized (ubi)
		{
			// {@squirreljme.error BK3d Aliased object to pointer. (Value)}
			if (false)
				new Throwable(String.format("BK3d %08x", __p)).
					printStackTrace();
			
			// See if it already has been mapped?
			for (Map.Entry<Integer, SpringObject> e : ubi.entrySet())
				if (e.getValue() == __p)
					return e.getKey();
			
			// Otherwise add it
			int rv = ubi.size() + 1;
................................................................................
		if (__p == 0)
			return SpringNullObject.NULL;
		
		// Find mapped object already
		Map<Integer, SpringObject> ubi = this.machine._uniquebyint;
		synchronized (ubi)
		{
			// {@squirreljme.error BK3e Aliased pointer to object. (Value)}
			if (false)
				new Throwable(String.format("BK3e %08x", __p)).
					printStackTrace();
			
			SpringObject rv = ubi.get(__p);
			if (rv == null)
				return SpringNullObject.NULL;
			return rv;
		}
	}