defaultMethods.hpp revision 5351:36b97be47bde
1238104Sdes/*
2238104Sdes * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3238104Sdes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4238104Sdes *
5238104Sdes * This code is free software; you can redistribute it and/or modify it
6238104Sdes * under the terms of the GNU General Public License version 2 only, as
7238104Sdes * published by the Free Software Foundation.
8238104Sdes *
9238104Sdes * This code is distributed in the hope that it will be useful, but WITHOUT
10238104Sdes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11238104Sdes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12238104Sdes * version 2 for more details (a copy is included in the LICENSE file that
13238104Sdes * accompanied this code).
14238104Sdes *
15238104Sdes * You should have received a copy of the GNU General Public License version
16238104Sdes * 2 along with this work; if not, write to the Free Software Foundation,
17238104Sdes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18238104Sdes *
19238104Sdes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20238104Sdes * or visit www.oracle.com if you need additional information or have any
21238104Sdes * questions.
22238104Sdes *
23269257Sdes */
24238104Sdes
25238104Sdes#ifndef SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
26238104Sdes#define SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
27238104Sdes
28238104Sdes#include "runtime/handles.hpp"
29238104Sdes#include "utilities/growableArray.hpp"
30238104Sdes#include "utilities/exceptions.hpp"
31238104Sdes
32238104Sdesclass InstanceKlass;
33238104Sdesclass Symbol;
34238104Sdesclass Method;
35238104Sdes
36238104Sdesclass DefaultMethods : AllStatic {
37238104Sdes public:
38238104Sdes
39238104Sdes  // Analyzes class and determines which default methods are inherited
40238104Sdes  // from interfaces (and has no other implementation).  For each method
41238104Sdes  // (and each different signature the method could have), create an
42238104Sdes  // "overpass" method that is an instance method that redirects to the
43238104Sdes  // default method.  Overpass methods are added to the methods lists for
44238104Sdes  // the class.
45238104Sdes  static void generate_default_methods(
46238104Sdes      InstanceKlass* klass, GrowableArray<Method*>* mirandas, TRAPS);
47238104Sdes};
48238104Sdes#endif // SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
49238104Sdes