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 // no precompiled headers
25 #include "ci/ciUtilities.hpp"
26 #include "memory/oopFactory.hpp"
27 #include "oops/objArrayOop.inline.hpp"
28 #include "jvmci/jvmciRuntime.hpp"
29 #include "jvmci/jvmciCompilerToVM.hpp"
30 #include "jvmci/vmStructs_jvmci.hpp"
31 #include "runtime/handles.inline.hpp"
32 #include "runtime/sharedRuntime.hpp"
33 #include "utilities/resourceHash.hpp"
34
35
36 int CompilerToVM::Data::Klass_vtable_start_offset;
37 int CompilerToVM::Data::Klass_vtable_length_offset;
38
39 int CompilerToVM::Data::Method_extra_stack_entries;
40
41 address CompilerToVM::Data::SharedRuntime_ic_miss_stub;
42 address CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub;
43 address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack;
44 address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap;
45
103 Universe_narrow_oop_base = Universe::narrow_oop_base();
104 Universe_narrow_oop_shift = Universe::narrow_oop_shift();
105 Universe_narrow_klass_base = Universe::narrow_klass_base();
106 Universe_narrow_klass_shift = Universe::narrow_klass_shift();
107 Universe_non_oop_bits = Universe::non_oop_word();
108 Universe_verify_oop_mask = Universe::verify_oop_mask();
109 Universe_verify_oop_bits = Universe::verify_oop_bits();
110
111 _supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc();
112 _heap_end_addr = _supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1;
113 _heap_top_addr = _supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord* volatile*) -1;
114
115 _max_oop_map_stack_offset = (OopMapValue::register_mask - VMRegImpl::stack2reg(0)->value()) * VMRegImpl::stack_slot_size;
116 int max_oop_map_stack_index = _max_oop_map_stack_offset / VMRegImpl::stack_slot_size;
117 assert(OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index)), "should be valid");
118 assert(!OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index + 1)), "should be invalid");
119
120 symbol_init = (address) vmSymbols::object_initializer_name();
121 symbol_clinit = (address) vmSymbols::class_initializer_name();
122
123 BarrierSet* bs = Universe::heap()->barrier_set();
124 if (bs->is_a(BarrierSet::CardTableBarrierSet)) {
125 jbyte* base = ci_card_table_address();
126 assert(base != NULL, "unexpected byte_map_base");
127 cardtable_start_address = base;
128 cardtable_shift = CardTable::card_shift;
129 } else {
130 // No card mark barriers
131 cardtable_start_address = 0;
132 cardtable_shift = 0;
133 }
134
135 vm_page_size = os::vm_page_size();
136
137 #define SET_TRIGFUNC(name) \
138 if (StubRoutines::name() != NULL) { \
139 name = StubRoutines::name(); \
140 } else { \
141 name = CAST_FROM_FN_PTR(address, SharedRuntime::name); \
142 }
143
|
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 // no precompiled headers
25 #include "ci/ciUtilities.hpp"
26 #include "gc/shared/barrierSet.hpp"
27 #include "memory/oopFactory.hpp"
28 #include "oops/objArrayOop.inline.hpp"
29 #include "jvmci/jvmciRuntime.hpp"
30 #include "jvmci/jvmciCompilerToVM.hpp"
31 #include "jvmci/vmStructs_jvmci.hpp"
32 #include "runtime/handles.inline.hpp"
33 #include "runtime/sharedRuntime.hpp"
34 #include "utilities/resourceHash.hpp"
35
36
37 int CompilerToVM::Data::Klass_vtable_start_offset;
38 int CompilerToVM::Data::Klass_vtable_length_offset;
39
40 int CompilerToVM::Data::Method_extra_stack_entries;
41
42 address CompilerToVM::Data::SharedRuntime_ic_miss_stub;
43 address CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub;
44 address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack;
45 address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap;
46
104 Universe_narrow_oop_base = Universe::narrow_oop_base();
105 Universe_narrow_oop_shift = Universe::narrow_oop_shift();
106 Universe_narrow_klass_base = Universe::narrow_klass_base();
107 Universe_narrow_klass_shift = Universe::narrow_klass_shift();
108 Universe_non_oop_bits = Universe::non_oop_word();
109 Universe_verify_oop_mask = Universe::verify_oop_mask();
110 Universe_verify_oop_bits = Universe::verify_oop_bits();
111
112 _supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc();
113 _heap_end_addr = _supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1;
114 _heap_top_addr = _supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord* volatile*) -1;
115
116 _max_oop_map_stack_offset = (OopMapValue::register_mask - VMRegImpl::stack2reg(0)->value()) * VMRegImpl::stack_slot_size;
117 int max_oop_map_stack_index = _max_oop_map_stack_offset / VMRegImpl::stack_slot_size;
118 assert(OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index)), "should be valid");
119 assert(!OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index + 1)), "should be invalid");
120
121 symbol_init = (address) vmSymbols::object_initializer_name();
122 symbol_clinit = (address) vmSymbols::class_initializer_name();
123
124 BarrierSet* bs = BarrierSet::barrier_set();
125 if (bs->is_a(BarrierSet::CardTableBarrierSet)) {
126 jbyte* base = ci_card_table_address();
127 assert(base != NULL, "unexpected byte_map_base");
128 cardtable_start_address = base;
129 cardtable_shift = CardTable::card_shift;
130 } else {
131 // No card mark barriers
132 cardtable_start_address = 0;
133 cardtable_shift = 0;
134 }
135
136 vm_page_size = os::vm_page_size();
137
138 #define SET_TRIGFUNC(name) \
139 if (StubRoutines::name() != NULL) { \
140 name = StubRoutines::name(); \
141 } else { \
142 name = CAST_FROM_FN_PTR(address, SharedRuntime::name); \
143 }
144
|