1 /*
 2  * Copyright (c) 2018, 2023, 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  *
23  */
24 
25 #ifndef SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
26 #define SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP
27 
28 #include "runtime/fieldDescriptor.hpp"
29 
30 #include "oops/fieldInfo.inline.hpp"
31 #include "runtime/handles.inline.hpp"
32 #include "runtime/signature.hpp"
33 
34 // All fieldDescriptor inline functions that (directly or indirectly) use "_cp()" or "_cp->"
35 // must be put in this file, as they require runtime/handles.inline.hpp.
36 
37 inline Symbol* fieldDescriptor::name() const {
38   return field().name(_cp());
39 }
40 
41 inline Symbol* fieldDescriptor::signature() const {
42   return field().signature(_cp());
43 }
44 
45 inline ConstantPool* fieldDescriptor::constants() const {
46   return _cp();
47 }
48 
49 inline int fieldDescriptor::offset()                    const    { return field().offset(); }
50 inline bool fieldDescriptor::has_initial_value()        const    { return field().field_flags().is_initialized(); }
51 inline int fieldDescriptor::initial_value_index()       const    { return field().initializer_index(); }
52 
53 inline void fieldDescriptor::set_is_field_access_watched(const bool value) {
54   field_holder()->fields_status()->adr_at(index())->update_access_watched(value);
55 }
56 
57 inline void fieldDescriptor::set_is_field_modification_watched(const bool value) {
58   field_holder()->fields_status()->adr_at(index())->update_modification_watched(value);
59 }
60 
61 inline void fieldDescriptor::set_has_initialized_final_update(const bool value) {
62   field_holder()->fields_status()->adr_at(index())->update_initialized_final_update(value);
63 }
64 
65 inline BasicType fieldDescriptor::field_type() const {
66   return Signature::basic_type(signature());
67 }
68 
69 inline bool fieldDescriptor::is_flat()  const  { return field().field_flags().is_flat(); }
70 inline bool fieldDescriptor::is_null_free_inline_type() const { return field().field_flags().is_null_free_inline_type(); }
71 inline bool fieldDescriptor::has_null_marker() const { return field().field_flags().has_null_marker(); }
72 
73 #endif // SHARE_RUNTIME_FIELDDESCRIPTOR_INLINE_HPP