28 #include "interpreter/interpreterRuntime.hpp"
29 #include "oops/arrayOop.hpp"
30 #include "oops/markOop.hpp"
31 #include "oops/methodDataOop.hpp"
32 #include "oops/methodOop.hpp"
33 #include "prims/jvmtiExport.hpp"
34 #include "prims/jvmtiRedefineClassesTrace.hpp"
35 #include "prims/jvmtiThreadState.hpp"
36 #include "runtime/basicLock.hpp"
37 #include "runtime/biasedLocking.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #ifdef TARGET_OS_FAMILY_linux
40 # include "thread_linux.inline.hpp"
41 #endif
42 #ifdef TARGET_OS_FAMILY_solaris
43 # include "thread_solaris.inline.hpp"
44 #endif
45 #ifdef TARGET_OS_FAMILY_windows
46 # include "thread_windows.inline.hpp"
47 #endif
48
49
50 // Implementation of InterpreterMacroAssembler
51 #ifdef CC_INTERP
52 void InterpreterMacroAssembler::get_method(Register reg) {
53 movptr(reg, Address(rbp, -(sizeof(BytecodeInterpreter) + 2 * wordSize)));
54 movptr(reg, Address(reg, byte_offset_of(BytecodeInterpreter, _method)));
55 }
56 #endif // CC_INTERP
57
58
59 #ifndef CC_INTERP
60 void InterpreterMacroAssembler::call_VM_leaf_base(
61 address entry_point,
62 int number_of_arguments
63 ) {
64 // interpreter specific
65 //
66 // Note: No need to save/restore bcp & locals (rsi & rdi) pointer
67 // since these are callee saved registers and no blocking/
1141 }
1142 // Since null is rare, make it be the branch-taken case.
1143 jcc(Assembler::zero, found_null);
1144
1145 // Put all the "Case 3" tests here.
1146 record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call);
1147
1148 // Found a null. Keep searching for a matching receiver,
1149 // but remember that this is an empty (unused) slot.
1150 bind(found_null);
1151 }
1152 }
1153
1154 // In the fall-through case, we found no matching receiver, but we
1155 // observed the receiver[start_row] is NULL.
1156
1157 // Fill in the receiver field and increment the count.
1158 int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row));
1159 set_mdp_data_at(mdp, recvr_offset, receiver);
1160 int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row));
1161 movptr(reg2, (int32_t)DataLayout::counter_increment);
1162 set_mdp_data_at(mdp, count_offset, reg2);
1163 if (start_row > 0) {
1164 jmp(done);
1165 }
1166 }
1167
1168 void InterpreterMacroAssembler::record_klass_in_profile(Register receiver,
1169 Register mdp, Register reg2,
1170 bool is_virtual_call) {
1171 assert(ProfileInterpreter, "must be profiling");
1172 Label done;
1173
1174 record_klass_in_profile_helper(receiver, mdp, reg2, 0, done, is_virtual_call);
1175
1176 bind (done);
1177 }
1178
1179 void InterpreterMacroAssembler::profile_ret(Register return_bci, Register mdp) {
1180 if (ProfileInterpreter) {
1181 Label profile_continue;
1284
1285 // Update the default case count
1286 increment_mdp_data_at(mdp, in_bytes(MultiBranchData::default_count_offset()));
1287
1288 // The method data pointer needs to be updated.
1289 update_mdp_by_offset(mdp, in_bytes(MultiBranchData::default_displacement_offset()));
1290
1291 bind (profile_continue);
1292 }
1293 }
1294
1295
1296 void InterpreterMacroAssembler::profile_switch_case(Register index, Register mdp, Register reg2) {
1297 if (ProfileInterpreter) {
1298 Label profile_continue;
1299
1300 // If no method data exists, go to profile_continue.
1301 test_method_data_pointer(mdp, profile_continue);
1302
1303 // Build the base (index * per_case_size_in_bytes()) + case_array_offset_in_bytes()
1304 movptr(reg2, (int32_t)in_bytes(MultiBranchData::per_case_size()));
1305 // index is positive and so should have correct value if this code were
1306 // used on 64bits
1307 imulptr(index, reg2);
1308 addptr(index, in_bytes(MultiBranchData::case_array_offset()));
1309
1310 // Update the case count
1311 increment_mdp_data_at(mdp, index, in_bytes(MultiBranchData::relative_count_offset()));
1312
1313 // The method data pointer needs to be updated.
1314 update_mdp_by_offset(mdp, index, in_bytes(MultiBranchData::relative_displacement_offset()));
1315
1316 bind (profile_continue);
1317 }
1318 }
1319
1320 #endif // !CC_INTERP
1321
1322
1323
1324 void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) {
|
28 #include "interpreter/interpreterRuntime.hpp"
29 #include "oops/arrayOop.hpp"
30 #include "oops/markOop.hpp"
31 #include "oops/methodDataOop.hpp"
32 #include "oops/methodOop.hpp"
33 #include "prims/jvmtiExport.hpp"
34 #include "prims/jvmtiRedefineClassesTrace.hpp"
35 #include "prims/jvmtiThreadState.hpp"
36 #include "runtime/basicLock.hpp"
37 #include "runtime/biasedLocking.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #ifdef TARGET_OS_FAMILY_linux
40 # include "thread_linux.inline.hpp"
41 #endif
42 #ifdef TARGET_OS_FAMILY_solaris
43 # include "thread_solaris.inline.hpp"
44 #endif
45 #ifdef TARGET_OS_FAMILY_windows
46 # include "thread_windows.inline.hpp"
47 #endif
48 #ifdef TARGET_OS_FAMILY_bsd
49 # include "thread_bsd.inline.hpp"
50 #endif
51
52
53 // Implementation of InterpreterMacroAssembler
54 #ifdef CC_INTERP
55 void InterpreterMacroAssembler::get_method(Register reg) {
56 movptr(reg, Address(rbp, -(sizeof(BytecodeInterpreter) + 2 * wordSize)));
57 movptr(reg, Address(reg, byte_offset_of(BytecodeInterpreter, _method)));
58 }
59 #endif // CC_INTERP
60
61
62 #ifndef CC_INTERP
63 void InterpreterMacroAssembler::call_VM_leaf_base(
64 address entry_point,
65 int number_of_arguments
66 ) {
67 // interpreter specific
68 //
69 // Note: No need to save/restore bcp & locals (rsi & rdi) pointer
70 // since these are callee saved registers and no blocking/
1144 }
1145 // Since null is rare, make it be the branch-taken case.
1146 jcc(Assembler::zero, found_null);
1147
1148 // Put all the "Case 3" tests here.
1149 record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call);
1150
1151 // Found a null. Keep searching for a matching receiver,
1152 // but remember that this is an empty (unused) slot.
1153 bind(found_null);
1154 }
1155 }
1156
1157 // In the fall-through case, we found no matching receiver, but we
1158 // observed the receiver[start_row] is NULL.
1159
1160 // Fill in the receiver field and increment the count.
1161 int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row));
1162 set_mdp_data_at(mdp, recvr_offset, receiver);
1163 int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row));
1164 movptr(reg2, (intptr_t)DataLayout::counter_increment);
1165 set_mdp_data_at(mdp, count_offset, reg2);
1166 if (start_row > 0) {
1167 jmp(done);
1168 }
1169 }
1170
1171 void InterpreterMacroAssembler::record_klass_in_profile(Register receiver,
1172 Register mdp, Register reg2,
1173 bool is_virtual_call) {
1174 assert(ProfileInterpreter, "must be profiling");
1175 Label done;
1176
1177 record_klass_in_profile_helper(receiver, mdp, reg2, 0, done, is_virtual_call);
1178
1179 bind (done);
1180 }
1181
1182 void InterpreterMacroAssembler::profile_ret(Register return_bci, Register mdp) {
1183 if (ProfileInterpreter) {
1184 Label profile_continue;
1287
1288 // Update the default case count
1289 increment_mdp_data_at(mdp, in_bytes(MultiBranchData::default_count_offset()));
1290
1291 // The method data pointer needs to be updated.
1292 update_mdp_by_offset(mdp, in_bytes(MultiBranchData::default_displacement_offset()));
1293
1294 bind (profile_continue);
1295 }
1296 }
1297
1298
1299 void InterpreterMacroAssembler::profile_switch_case(Register index, Register mdp, Register reg2) {
1300 if (ProfileInterpreter) {
1301 Label profile_continue;
1302
1303 // If no method data exists, go to profile_continue.
1304 test_method_data_pointer(mdp, profile_continue);
1305
1306 // Build the base (index * per_case_size_in_bytes()) + case_array_offset_in_bytes()
1307 movptr(reg2, (intptr_t)in_bytes(MultiBranchData::per_case_size()));
1308 // index is positive and so should have correct value if this code were
1309 // used on 64bits
1310 imulptr(index, reg2);
1311 addptr(index, in_bytes(MultiBranchData::case_array_offset()));
1312
1313 // Update the case count
1314 increment_mdp_data_at(mdp, index, in_bytes(MultiBranchData::relative_count_offset()));
1315
1316 // The method data pointer needs to be updated.
1317 update_mdp_by_offset(mdp, index, in_bytes(MultiBranchData::relative_displacement_offset()));
1318
1319 bind (profile_continue);
1320 }
1321 }
1322
1323 #endif // !CC_INTERP
1324
1325
1326
1327 void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) {
|