1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
104 volatile address _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
105
106 #if INCLUDE_AOT && defined(TIERED)
107 CompiledMethod* _aot_code;
108 #endif
109
110 // Constructor
111 Method(ConstMethod* xconst, AccessFlags access_flags);
112 public:
113
114 static Method* allocate(ClassLoaderData* loader_data,
115 int byte_code_size,
116 AccessFlags access_flags,
117 InlineTableSizes* sizes,
118 ConstMethod::MethodType method_type,
119 TRAPS);
120
121 // CDS and vtbl checking can create an empty Method to get vtbl pointer.
122 Method(){}
123
124 // The Method vtable is restored by this call when the Method is in the
125 // shared archive. See patch_klass_vtables() in metaspaceShared.cpp for
126 // all the gory details. SA, dtrace and pstack helpers distinguish metadata
127 // by their vtable.
128 void restore_vtable() { guarantee(is_method(), "vtable restored by this call"); }
129 bool is_method() const volatile { return true; }
130
131 void restore_unshareable_info(TRAPS);
132
133 // accessors for instance variables
134
135 ConstMethod* constMethod() const { return _constMethod; }
136 void set_constMethod(ConstMethod* xconst) { _constMethod = xconst; }
137
138
139 static address make_adapters(methodHandle mh, TRAPS);
140 volatile address from_compiled_entry() const { return (address)OrderAccess::load_ptr_acquire(&_from_compiled_entry); }
141 volatile address from_compiled_entry_no_trampoline() const;
142 volatile address from_interpreted_entry() const{ return (address)OrderAccess::load_ptr_acquire(&_from_interpreted_entry); }
143
144 // access flag
145 AccessFlags access_flags() const { return _access_flags; }
146 void set_access_flags(AccessFlags flags) { _access_flags = flags; }
147
148 // name
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
104 volatile address _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
105
106 #if INCLUDE_AOT && defined(TIERED)
107 CompiledMethod* _aot_code;
108 #endif
109
110 // Constructor
111 Method(ConstMethod* xconst, AccessFlags access_flags);
112 public:
113
114 static Method* allocate(ClassLoaderData* loader_data,
115 int byte_code_size,
116 AccessFlags access_flags,
117 InlineTableSizes* sizes,
118 ConstMethod::MethodType method_type,
119 TRAPS);
120
121 // CDS and vtbl checking can create an empty Method to get vtbl pointer.
122 Method(){}
123
124 bool is_method() const volatile { return true; }
125
126 void restore_unshareable_info(TRAPS);
127
128 // accessors for instance variables
129
130 ConstMethod* constMethod() const { return _constMethod; }
131 void set_constMethod(ConstMethod* xconst) { _constMethod = xconst; }
132
133
134 static address make_adapters(methodHandle mh, TRAPS);
135 volatile address from_compiled_entry() const { return (address)OrderAccess::load_ptr_acquire(&_from_compiled_entry); }
136 volatile address from_compiled_entry_no_trampoline() const;
137 volatile address from_interpreted_entry() const{ return (address)OrderAccess::load_ptr_acquire(&_from_interpreted_entry); }
138
139 // access flag
140 AccessFlags access_flags() const { return _access_flags; }
141 void set_access_flags(AccessFlags flags) { _access_flags = flags; }
142
143 // name
|