8076421: Fix Zero Interpreter bugs in class redefinition and template interpreter changes

Metadata_do walking interpreted frames was wrong and generate_Reference_get is not necessarily an accessor method.

Reviewed-by: sgehwolf, dholmes
This commit is contained in:
Coleen Phillimore 2015-04-02 14:02:54 -04:00
parent 64bb2ce311
commit dccc407b83
3 changed files with 52 additions and 6 deletions

View file

@ -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. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -814,9 +814,9 @@ address InterpreterGenerator::generate_Reference_get_entry(void) {
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
// If G1 is not enabled then attempt to go through the accessor entry point // If G1 is not enabled then attempt to go through the normal entry point
// Reference.get is an accessor // Reference.get could be instrumented by jvmti
return generate_accessor_entry(); return generate_normal_entry(false);
} }
address InterpreterGenerator::generate_native_entry(bool synchronized) { address InterpreterGenerator::generate_native_entry(bool synchronized) {

View file

@ -1104,9 +1104,9 @@ void frame::nmethods_do(CodeBlobClosure* cf) {
// call f() on the interpreted Method*s in the stack. // call f() on the interpreted Method*s in the stack.
// Have to walk the entire code cache for the compiled frames Yuck. // Have to walk the entire code cache for the compiled frames Yuck.
void frame::metadata_do(void f(Metadata*)) { void frame::metadata_do(void f(Metadata*)) {
if (_cb != NULL && Interpreter::contains(pc())) { if (is_interpreted_frame()) {
Method* m = this->interpreter_frame_method(); Method* m = this->interpreter_frame_method();
assert(m != NULL, "huh?"); assert(m != NULL, "expecting a method in this frame");
f(m); f(m);
} }
} }

View file

@ -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;
}
}