src/share/vm/classfile/defaultMethods.hpp

Tue, 02 Apr 2013 11:28:33 +0200

author
mgerdin
date
Tue, 02 Apr 2013 11:28:33 +0200
changeset 4850
ede380e13960
parent 4245
4735d2c84362
child 5786
36b97be47bde
permissions
-rw-r--r--

8009763: Add WB test for String.intern()
Summary: Add convenience method in StringTable, add WhiteBox method and simple sanity test
Reviewed-by: mgerdin, zgu
Contributed-by: leonid.mesnik@oracle.com

kamg@4245 1 /*
kamg@4245 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
kamg@4245 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kamg@4245 4 *
kamg@4245 5 * This code is free software; you can redistribute it and/or modify it
kamg@4245 6 * under the terms of the GNU General Public License version 2 only, as
kamg@4245 7 * published by the Free Software Foundation.
kamg@4245 8 *
kamg@4245 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kamg@4245 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kamg@4245 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kamg@4245 12 * version 2 for more details (a copy is included in the LICENSE file that
kamg@4245 13 * accompanied this code).
kamg@4245 14 *
kamg@4245 15 * You should have received a copy of the GNU General Public License version
kamg@4245 16 * 2 along with this work; if not, write to the Free Software Foundation,
kamg@4245 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kamg@4245 18 *
kamg@4245 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
kamg@4245 20 * or visit www.oracle.com if you need additional information or have any
kamg@4245 21 * questions.
kamg@4245 22 *
kamg@4245 23 */
kamg@4245 24
kamg@4245 25 #ifndef SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
kamg@4245 26 #define SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
kamg@4245 27
kamg@4245 28 #include "runtime/handles.hpp"
kamg@4245 29 #include "utilities/growableArray.hpp"
kamg@4245 30 #include "utilities/exceptions.hpp"
kamg@4245 31
kamg@4245 32 class InstanceKlass;
kamg@4245 33 class Symbol;
kamg@4245 34 class Method;
kamg@4245 35
kamg@4245 36 class DefaultMethods : AllStatic {
kamg@4245 37 public:
kamg@4245 38
kamg@4245 39 // Analyzes class and determines which default methods are inherited
kamg@4245 40 // from interfaces (and has no other implementation). For each method
kamg@4245 41 // (and each different signature the method could have), create an
kamg@4245 42 // "overpass" method that is an instance method that redirects to the
kamg@4245 43 // default method. Overpass methods are added to the methods lists for
kamg@4245 44 // the class.
kamg@4245 45 static void generate_default_methods(
kamg@4245 46 InstanceKlass* klass, GrowableArray<Method*>* mirandas, TRAPS);
kamg@4245 47
kamg@4245 48
kamg@4245 49 // Called during linking when an invokespecial to an direct interface
kamg@4245 50 // method is found. Selects and returns a method if there is a unique
kamg@4245 51 // default method in the 'super_iface' part of the hierarchy which is
kamg@4245 52 // also a candidate default for 'this_klass'. Otherwise throws an AME.
kamg@4245 53 static Method* find_super_default(
kamg@4245 54 Klass* this_klass, Klass* super_iface,
kamg@4245 55 Symbol* method_name, Symbol* method_sig, TRAPS);
kamg@4245 56 };
kamg@4245 57
kamg@4245 58 #endif // SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP

mercurial