author | goetz |
Mon, 04 Jan 2016 15:41:05 +0100 | |
changeset 35498 | 392b50de06c6 |
parent 34280 | 72bfaaffee36 |
child 36508 | 5f9eee6b383b |
permissions | -rw-r--r-- |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
1 |
/* |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
4 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
8 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
13 |
* accompanied this code). |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
14 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
18 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
21 |
* questions. |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
22 |
* |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
23 |
*/ |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
24 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
26 |
#define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
27 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
28 |
#include "classfile/javaClasses.hpp" |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
29 |
#include "oops/oop.inline.hpp" |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
30 |
#include "oops/oopsHierarchy.hpp" |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
31 |
|
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
32 |
void java_lang_String::set_coder(oop string, jbyte coder) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
33 |
assert(initialized, "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
34 |
if (coder_offset > 0) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
35 |
string->byte_field_put(coder_offset, coder); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
36 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
37 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
38 |
|
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
39 |
void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
40 |
assert(initialized, "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
41 |
string->obj_field_put_raw(value_offset, buffer); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
42 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
43 |
void java_lang_String::set_value(oop string, typeArrayOop buffer) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
44 |
assert(initialized && (value_offset > 0), "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
45 |
string->obj_field_put(value_offset, (oop)buffer); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
46 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
47 |
void java_lang_String::set_hash(oop string, unsigned int hash) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
48 |
assert(initialized && (hash_offset > 0), "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
49 |
string->int_field_put(hash_offset, hash); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
50 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
51 |
|
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
52 |
// Accessors |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
53 |
typeArrayOop java_lang_String::value(oop java_string) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
54 |
assert(initialized && (value_offset > 0), "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
55 |
assert(is_instance(java_string), "must be java_string"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
56 |
return (typeArrayOop) java_string->obj_field(value_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
57 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
58 |
unsigned int java_lang_String::hash(oop java_string) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
59 |
assert(initialized && (hash_offset > 0), "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
60 |
assert(is_instance(java_string), "must be java_string"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
61 |
return java_string->int_field(hash_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
62 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
63 |
bool java_lang_String::is_latin1(oop java_string) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
64 |
assert(initialized, "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
65 |
assert(is_instance(java_string), "must be java_string"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
66 |
if (coder_offset > 0) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
67 |
jbyte coder = java_string->byte_field(coder_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
68 |
assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
69 |
return coder == CODER_LATIN1; |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
70 |
} else { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
71 |
return false; |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
72 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
73 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
74 |
int java_lang_String::length(oop java_string) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
75 |
assert(initialized, "Must be initialized"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
76 |
assert(is_instance(java_string), "must be java_string"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
77 |
typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset)); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
78 |
if (value_array == NULL) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
79 |
return 0; |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
80 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
81 |
int arr_length = value_array->length(); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
82 |
if (!is_latin1(java_string)) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
83 |
assert((arr_length & 1) == 0, "should be even for UTF16 string"); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
84 |
arr_length >>= 1; // convert number of bytes to number of elements |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
85 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
86 |
return arr_length; |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
87 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
88 |
|
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
89 |
bool java_lang_String::is_instance_inlined(oop obj) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
90 |
return obj != NULL && obj->klass() == SystemDictionary::String_klass(); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
91 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
92 |
|
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
93 |
// Accessors |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
94 |
oop java_lang_ref_Reference::referent(oop ref) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
95 |
return ref->obj_field(referent_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
96 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
97 |
void java_lang_ref_Reference::set_referent(oop ref, oop value) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
98 |
ref->obj_field_put(referent_offset, value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
99 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
100 |
void java_lang_ref_Reference::set_referent_raw(oop ref, oop value) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
101 |
ref->obj_field_put_raw(referent_offset, value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
102 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
103 |
HeapWord* java_lang_ref_Reference::referent_addr(oop ref) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
104 |
return ref->obj_field_addr<HeapWord>(referent_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
105 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
106 |
oop java_lang_ref_Reference::next(oop ref) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
107 |
return ref->obj_field(next_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
108 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
109 |
void java_lang_ref_Reference::set_next(oop ref, oop value) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
110 |
ref->obj_field_put(next_offset, value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
111 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
112 |
void java_lang_ref_Reference::set_next_raw(oop ref, oop value) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
113 |
ref->obj_field_put_raw(next_offset, value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
114 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
115 |
HeapWord* java_lang_ref_Reference::next_addr(oop ref) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
116 |
return ref->obj_field_addr<HeapWord>(next_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
117 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
118 |
oop java_lang_ref_Reference::discovered(oop ref) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
119 |
return ref->obj_field(discovered_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
120 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
121 |
void java_lang_ref_Reference::set_discovered(oop ref, oop value) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
122 |
ref->obj_field_put(discovered_offset, value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
123 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
124 |
void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
125 |
ref->obj_field_put_raw(discovered_offset, value); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
126 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
127 |
HeapWord* java_lang_ref_Reference::discovered_addr(oop ref) { |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
128 |
return ref->obj_field_addr<HeapWord>(discovered_offset); |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
129 |
} |
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
130 |
|
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
131 |
inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
132 |
site->obj_field_put_volatile(_target_offset, target); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
133 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
134 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
135 |
inline oop java_lang_invoke_CallSite::target(oop site) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
136 |
return site->obj_field(_target_offset); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
137 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
138 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
139 |
inline void java_lang_invoke_CallSite::set_target(oop site, oop target) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
140 |
site->obj_field_put(_target_offset, target); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
141 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
142 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
143 |
inline bool java_lang_invoke_CallSite::is_instance(oop obj) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
144 |
return obj != NULL && is_subclass(obj->klass()); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
145 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
146 |
|
31037
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30263
diff
changeset
|
147 |
inline bool java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(oop obj) { |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30263
diff
changeset
|
148 |
return obj != NULL && is_subclass(obj->klass()); |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30263
diff
changeset
|
149 |
} |
01a5c5fa5681
8079205: CallSite dependency tracking is broken after sun.misc.Cleaner became automatically cleared
vlivanov
parents:
30263
diff
changeset
|
150 |
|
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
151 |
inline bool java_lang_invoke_MemberName::is_instance(oop obj) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
152 |
return obj != NULL && is_subclass(obj->klass()); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
153 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
154 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
155 |
inline bool java_lang_invoke_MethodType::is_instance(oop obj) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
156 |
return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass(); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
157 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
158 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
159 |
inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
160 |
return obj != NULL && is_subclass(obj->klass()); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
161 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
162 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
163 |
inline bool java_lang_Class::is_instance(oop obj) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
164 |
return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
165 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
166 |
|
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
167 |
inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) { |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
168 |
return obj != NULL && is_subclass(obj->klass()); |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
169 |
} |
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
170 |
|
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
171 |
|
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
172 |
|
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34280
diff
changeset
|
173 |
|
34280 | 174 |
inline int Backtrace::merge_bci_and_version(int bci, int version) { |
175 |
// only store u2 for version, checking for overflow. |
|
176 |
if (version > USHRT_MAX || version < 0) version = USHRT_MAX; |
|
177 |
assert((jushort)bci == bci, "bci should be short"); |
|
178 |
return build_int_from_shorts(version, bci); |
|
179 |
} |
|
180 |
||
181 |
inline int Backtrace::merge_mid_and_cpref(int mid, int cpref) { |
|
182 |
// only store u2 for mid and cpref, checking for overflow. |
|
183 |
assert((jushort)mid == mid, "mid should be short"); |
|
184 |
assert((jushort)cpref == cpref, "cpref should be short"); |
|
185 |
return build_int_from_shorts(cpref, mid); |
|
186 |
} |
|
187 |
||
188 |
inline int Backtrace::bci_at(unsigned int merged) { |
|
189 |
return extract_high_short_from_int(merged); |
|
190 |
} |
|
191 |
||
192 |
inline int Backtrace::version_at(unsigned int merged) { |
|
193 |
return extract_low_short_from_int(merged); |
|
194 |
} |
|
195 |
||
196 |
inline int Backtrace::mid_at(unsigned int merged) { |
|
197 |
return extract_high_short_from_int(merged); |
|
198 |
} |
|
199 |
||
200 |
inline int Backtrace::cpref_at(unsigned int merged) { |
|
201 |
return extract_low_short_from_int(merged); |
|
202 |
} |
|
203 |
||
204 |
inline int Backtrace::get_line_number(const methodHandle& method, int bci) { |
|
205 |
int line_number = 0; |
|
206 |
if (method->is_native()) { |
|
207 |
// Negative value different from -1 below, enabling Java code in |
|
208 |
// class java.lang.StackTraceElement to distinguish "native" from |
|
209 |
// "no LineNumberTable". JDK tests for -2. |
|
210 |
line_number = -2; |
|
211 |
} else { |
|
212 |
// Returns -1 if no LineNumberTable, and otherwise actual line number |
|
213 |
line_number = method->line_number_from_bci(bci); |
|
214 |
if (line_number == -1 && ShowHiddenFrames) { |
|
215 |
line_number = bci + 1000000; |
|
216 |
} |
|
217 |
} |
|
218 |
return line_number; |
|
219 |
} |
|
220 |
||
221 |
/* |
|
222 |
* Returns the source file name of a given InstanceKlass and version |
|
223 |
*/ |
|
224 |
inline Symbol* Backtrace::get_source_file_name(InstanceKlass* holder, int version) { |
|
225 |
// Find the specific ik version that contains this source_file_name_index |
|
226 |
// via the previous versions list, but use the current version's |
|
227 |
// constant pool to look it up. The previous version's index has been |
|
228 |
// merged for the current constant pool. |
|
229 |
InstanceKlass* ik = holder->get_klass_version(version); |
|
230 |
// This version has been cleaned up. |
|
231 |
if (ik == NULL) return NULL; |
|
232 |
int source_file_name_index = ik->source_file_name_index(); |
|
233 |
return (source_file_name_index == 0) ? |
|
234 |
(Symbol*)NULL : holder->constants()->symbol_at(source_file_name_index); |
|
235 |
} |
|
236 |
||
29081
c61eb4914428
8072911: Remove includes of oop.inline.hpp from .hpp files
stefank
parents:
diff
changeset
|
237 |
#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP |