# HG changeset patch # User coleenp # Date 1427997774 14400 # Node ID b009de0c0cefaf9d95a9b06d2f6ea48e8a9389d6 # Parent 1c5202fa105b10cfe663ff3c8a1c3055415c15ce 8076421: Fix Zero Interpreter bugs in class redefinition and template interpreter changes Summary: metadata_do walking interpreted frames was wrong and generate_Reference_get is not necessarily an accessor method. Reviewed-by: sgehwolf, dholmes diff -r 1c5202fa105b -r b009de0c0cef hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Apr 02 08:50:10 2015 -0400 +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Apr 02 14:02:54 2015 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -814,9 +814,9 @@ } #endif // INCLUDE_ALL_GCS - // If G1 is not enabled then attempt to go through the accessor entry point - // Reference.get is an accessor - return generate_accessor_entry(); + // If G1 is not enabled then attempt to go through the normal entry point + // Reference.get could be instrumented by jvmti + return generate_normal_entry(false); } address InterpreterGenerator::generate_native_entry(bool synchronized) { diff -r 1c5202fa105b -r b009de0c0cef hotspot/src/share/vm/runtime/frame.cpp --- a/hotspot/src/share/vm/runtime/frame.cpp Thu Apr 02 08:50:10 2015 -0400 +++ b/hotspot/src/share/vm/runtime/frame.cpp Thu Apr 02 14:02:54 2015 -0400 @@ -1104,9 +1104,9 @@ // call f() on the interpreted Method*s in the stack. // Have to walk the entire code cache for the compiled frames Yuck. void frame::metadata_do(void f(Metadata*)) { - if (_cb != NULL && Interpreter::contains(pc())) { + if (is_interpreted_frame()) { Method* m = this->interpreter_frame_method(); - assert(m != NULL, "huh?"); + assert(m != NULL, "expecting a method in this frame"); f(m); } } diff -r 1c5202fa105b -r b009de0c0cef hotspot/test/serviceability/hprof/cpu002.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/test/serviceability/hprof/cpu002.java Thu Apr 02 14:02:54 2015 -0400 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015, 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. + */ + +/* + * @test + * @bug 8076421 + * @summary Test of hprof option crashes Zero + * @compile cpu002.java + * @run main/othervm -Xrunhprof:cpu=times,file=cpu002.hprof.out cpu002 + */ + +import java.io.*; + +public class cpu002 { + public static final int PASSED = 0; + public static final int FAILED = 2; + public static final int JCK_STATUS_BASE = 95; + + public static void main (String argv[]) { + System.exit(run(argv,System.out) + JCK_STATUS_BASE); + } + + public static int run(String argv[], PrintStream out) { + return PASSED; + } +}