299 for ( int i = 0; i < _bytes_to_copy; i++) {
300 address ptr = (address)(_pc_start + i);
301 int a_byte = (*ptr) & 0xFF;
302 __ a_byte (a_byte);
303 *ptr = 0x90; // make the site look like a nop
304 }
305 }
306
307 address end_of_patch = __ pc();
308 int bytes_to_skip = 0;
309 if (_id == load_klass_id) {
310 int offset = __ offset();
311 if (CommentedAssembly) {
312 __ block_comment(" being_initialized check");
313 }
314 assert(_obj != noreg, "must be a valid register");
315 Register tmp = rax;
316 Register tmp2 = rbx;
317 __ push(tmp);
318 __ push(tmp2);
319 __ movptr(tmp2, Address(_obj, java_lang_Class::klass_offset_in_bytes()));
320 __ get_thread(tmp);
321 __ cmpptr(tmp, Address(tmp2, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
322 __ pop(tmp2);
323 __ pop(tmp);
324 __ jcc(Assembler::notEqual, call_patch);
325
326 // access_field patches may execute the patched code before it's
327 // copied back into place so we need to jump back into the main
328 // code of the nmethod to continue execution.
329 __ jmp(_patch_site_continuation);
330
331 // make sure this extra code gets skipped
332 bytes_to_skip += __ offset() - offset;
333 }
334 if (CommentedAssembly) {
335 __ block_comment("patch data encoded as movl");
336 }
337 // Now emit the patch record telling the runtime how to find the
338 // pieces of the patch. We only need 3 bytes but for readability of
339 // the disassembly we make the data look like a movl reg, imm32,
|
299 for ( int i = 0; i < _bytes_to_copy; i++) {
300 address ptr = (address)(_pc_start + i);
301 int a_byte = (*ptr) & 0xFF;
302 __ a_byte (a_byte);
303 *ptr = 0x90; // make the site look like a nop
304 }
305 }
306
307 address end_of_patch = __ pc();
308 int bytes_to_skip = 0;
309 if (_id == load_klass_id) {
310 int offset = __ offset();
311 if (CommentedAssembly) {
312 __ block_comment(" being_initialized check");
313 }
314 assert(_obj != noreg, "must be a valid register");
315 Register tmp = rax;
316 Register tmp2 = rbx;
317 __ push(tmp);
318 __ push(tmp2);
319 __ load_heap_oop(tmp2, Address(_obj, java_lang_Class::klass_offset_in_bytes()));
320 __ get_thread(tmp);
321 __ cmpptr(tmp, Address(tmp2, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
322 __ pop(tmp2);
323 __ pop(tmp);
324 __ jcc(Assembler::notEqual, call_patch);
325
326 // access_field patches may execute the patched code before it's
327 // copied back into place so we need to jump back into the main
328 // code of the nmethod to continue execution.
329 __ jmp(_patch_site_continuation);
330
331 // make sure this extra code gets skipped
332 bytes_to_skip += __ offset() - offset;
333 }
334 if (CommentedAssembly) {
335 __ block_comment("patch data encoded as movl");
336 }
337 // Now emit the patch record telling the runtime how to find the
338 // pieces of the patch. We only need 3 bytes but for readability of
339 // the disassembly we make the data look like a movl reg, imm32,
|