# HG changeset patch # User kvn # Date 1381884466 25200 # Node ID 1263c7e17e1ce22e472a46322cbd210a8fc390d1 # Parent 8df6f123d35e796a4ec8bd1660a0f8902c8ee90f# Parent f91a9a696e5e4f05dd4f393cd80af44e00569b20 Merge diff -r f91a9a696e5e -r 1263c7e17e1c src/share/vm/interpreter/linkResolver.cpp --- a/src/share/vm/interpreter/linkResolver.cpp Tue Oct 15 12:14:00 2013 -0700 +++ b/src/share/vm/interpreter/linkResolver.cpp Tue Oct 15 17:47:46 2013 -0700 @@ -1,5 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, 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 @@ -158,6 +159,22 @@ index = vt->index_of_miranda(resolved_method->name(), resolved_method->signature()); kind = CallInfo::vtable_call; + } else if (resolved_method->has_vtable_index()) { + // Can occur if an interface redeclares a method of Object. + +#ifdef ASSERT + // Ensure that this is really the case. + KlassHandle object_klass = SystemDictionary::Object_klass(); + Method * object_resolved_method = object_klass()->vtable()->method_at(index); + assert(object_resolved_method->name() == resolved_method->name(), + err_msg("Object and interface method names should match at vtable index %d, %s != %s", + index, object_resolved_method->name()->as_C_string(), resolved_method->name()->as_C_string())); + assert(object_resolved_method->signature() == resolved_method->signature(), + err_msg("Object and interface method signatures should match at vtable index %d, %s != %s", + index, object_resolved_method->signature()->as_C_string(), resolved_method->signature()->as_C_string())); +#endif // ASSERT + + kind = CallInfo::vtable_call; } else { // A regular interface call. kind = CallInfo::itable_call; diff -r f91a9a696e5e -r 1263c7e17e1c test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compiler/jsr292/CreatesInterfaceDotEqualsCallInfo.java Tue Oct 15 17:47:46 2013 -0700 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2013, 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 8026124 + * @summary Javascript file provoked assertion failure in linkResolver.cpp + * + * @run main/othervm CreatesInterfaceDotEqualsCallInfo + */ + +public class CreatesInterfaceDotEqualsCallInfo { + public static void main(String[] args) throws java.io.IOException { + String[] jsargs = { System.getProperty("test.src", ".") + + "/createsInterfaceDotEqualsCallInfo.js" }; + jdk.nashorn.tools.Shell.main(System.in, System.out, System.err, jsargs); + System.out.println("PASS, did not crash running Javascript"); + } +} diff -r f91a9a696e5e -r 1263c7e17e1c test/compiler/jsr292/createsInterfaceDotEqualsCallInfo.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compiler/jsr292/createsInterfaceDotEqualsCallInfo.js Tue Oct 15 17:47:46 2013 -0700 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013, 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. + * + */ + +var path = new java.io.File("/Users/someone").toPath(); +path.toString();