Thu, 25 Aug 2011 20:29:30 -0700
7082949: JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method
Reviewed-by: kvn, twisti
src/share/vm/oops/methodOop.cpp | file | annotate | diff | comparison | revisions | |
test/compiler/7082949/Test7082949.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/oops/methodOop.cpp Mon Aug 22 11:00:39 2011 -0700 1.2 +++ b/src/share/vm/oops/methodOop.cpp Thu Aug 25 20:29:30 2011 -0700 1.3 @@ -914,6 +914,7 @@ 1.4 Symbol* name, 1.5 Symbol* signature, 1.6 Handle method_type, TRAPS) { 1.7 + ResourceMark rm; 1.8 methodHandle empty; 1.9 1.10 assert(holder() == SystemDictionary::MethodHandle_klass(),
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/test/compiler/7082949/Test7082949.java Thu Aug 25 20:29:30 2011 -0700 2.3 @@ -0,0 +1,54 @@ 2.4 +/* 2.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. 2.11 + * 2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.15 + * version 2 for more details (a copy is included in the LICENSE file that 2.16 + * accompanied this code). 2.17 + * 2.18 + * You should have received a copy of the GNU General Public License version 2.19 + * 2 along with this work; if not, write to the Free Software Foundation, 2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.21 + * 2.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.23 + * or visit www.oracle.com if you need additional information or have any 2.24 + * questions. 2.25 + * 2.26 + */ 2.27 + 2.28 +/** 2.29 + * @test 2.30 + * @bug 7082949 2.31 + * @summary JSR 292: missing ResourceMark in methodOopDesc::make_invoke_method 2.32 + * 2.33 + * @run main Test7082949 2.34 + */ 2.35 + 2.36 +import java.lang.invoke.*; 2.37 +import static java.lang.invoke.MethodHandles.*; 2.38 +import static java.lang.invoke.MethodType.*; 2.39 + 2.40 +public class Test7082949 implements Runnable { 2.41 + public static void main(String... args) throws Throwable { 2.42 + new Thread(new Test7082949()).start(); 2.43 + } 2.44 + 2.45 + public static Test7082949 test() { 2.46 + return null; 2.47 + } 2.48 + 2.49 + public void run() { 2.50 + try { 2.51 + MethodHandle m1 = MethodHandles.lookup().findStatic(Test7082949.class, "test", methodType(Test7082949.class)); 2.52 + Test7082949 v = (Test7082949)m1.invokeExact(); 2.53 + } catch (Throwable t) { 2.54 + t.printStackTrace(); 2.55 + } 2.56 + } 2.57 +}