changeset 30144:b009de0c0cef

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
author coleenp
date Thu, 02 Apr 2015 14:02:54 -0400
parents 1c5202fa105b
children fbacd4d2936c
files hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp hotspot/src/share/vm/runtime/frame.cpp hotspot/test/serviceability/hprof/cpu002.java
diffstat 3 files changed, 52 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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) {
--- 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);
   }
 }
--- /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;
+    }
+}