test/hotspot/jtreg/runtime/logging/MonitorMismatchHelper.jasm
author ccheung
Thu, 31 May 2018 11:41:25 -0700
changeset 50331 2712cf4711d1
parent 47216 71c04702a3d5
permissions -rw-r--r--
8203960: [TESTBUG] runtime/logging/DefaultMethodsTest.java failed when running in CDS mode Summary: Added an interface with a default method. The InnerClass implements the interface. Reviewed-by: iklam, dholmes

/*
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

super public class MonitorMismatchHelper
	version 52:0
{

private Field c:I;

public Method "<init>":"()V"
	stack 2 locals 1
{
		aload_0;
		invokespecial	Method java/lang/Object."<init>":"()V";
		aload_0;
		iconst_0;
		putfield	Field c:"I";
		return;
}

public synchronized Method increment:"()V"
	stack 3 locals 1
{
		aload_0;
		dup;
		getfield	Field c:"I";
		iconst_1;
		iadd;
		putfield	Field c:"I";
		return;
}

public synchronized Method decrement:"()V"
	stack 3 locals 1
{
		aload_0;
		dup;
		getfield	Field c:"I";
		iconst_1;
		isub;
		putfield	Field c:"I";
		return;
}

public synchronized Method value:"()I"
	stack 1 locals 1
{
		aload_0;
		getfield	Field c:"I";
		ireturn;
}

public static varargs Method main:"([Ljava/lang/String;)V"
	stack 2 locals 4
{
		new	class MonitorMismatchHelper;
		dup;
		invokespecial	Method "<init>":"()V";
		astore_1;
		aload_1;
		dup;
		astore_2;
		monitorenter;
		try t0;
		aload_1;
		invokevirtual	Method increment:"()V";
		aload_1;
		invokevirtual	Method increment:"()V";
		aload_1;
		invokevirtual	Method decrement:"()V";
		getstatic	Field java/lang/System.out:"Ljava/io/PrintStream;";
		aload_1;
		invokevirtual	Method value:"()I";
		invokevirtual	Method java/io/PrintStream.print:"(I)V";
		aload_2;
		monitorexit;
		endtry t0;
		goto	L44;
		catch t0 #0;
		catch t1 #0;
		try t1;
		stack_frame_type full;
		locals_map class "[Ljava/lang/String;", class MonitorMismatchHelper, class java/lang/Object;
		stack_map class java/lang/Throwable;
		astore_3;
		aload_2;
		endtry t1;
		aload_3;
		athrow;
	L44:	stack_frame_type chop1;
		return;
}

} // end Class MonitorMismatchHelper