src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7063628 Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp

Print this page




 286       __ a_byte (a_byte);
 287     }
 288   }
 289 
 290   address end_of_patch = __ pc();
 291   int bytes_to_skip = 0;
 292   if (_id == load_klass_id) {
 293     int offset = __ offset();
 294     if (CommentedAssembly) {
 295       __ block_comment(" being_initialized check");
 296     }
 297 
 298     // static field accesses have special semantics while the class
 299     // initializer is being run so we emit a test which can be used to
 300     // check that this code is being executed by the initializing
 301     // thread.
 302     assert(_obj != noreg, "must be a valid register");
 303     assert(_oop_index >= 0, "must have oop index");
 304     __ load_heap_oop(_obj, java_lang_Class::klass_offset_in_bytes(), G3);
 305     __ ld_ptr(G3, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc), G3);
 306     __ cmp(G2_thread, G3);
 307     __ br(Assembler::notEqual, false, Assembler::pn, call_patch);
 308     __ delayed()->nop();
 309 
 310     // load_klass patches may execute the patched code before it's
 311     // copied back into place so we need to jump back into the main
 312     // code of the nmethod to continue execution.
 313     __ br(Assembler::always, false, Assembler::pt, _patch_site_continuation);
 314     __ delayed()->nop();
 315 
 316     // make sure this extra code gets skipped
 317     bytes_to_skip += __ offset() - offset;
 318   }
 319 
 320   // Now emit the patch record telling the runtime how to find the
 321   // pieces of the patch.  We only need 3 bytes but it has to be
 322   // aligned as an instruction so emit 4 bytes.
 323   int sizeof_patch_record = 4;
 324   bytes_to_skip += sizeof_patch_record;
 325 
 326   // emit the offsets needed to find the code to patch
 327   int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record;
 328 




 286       __ a_byte (a_byte);
 287     }
 288   }
 289 
 290   address end_of_patch = __ pc();
 291   int bytes_to_skip = 0;
 292   if (_id == load_klass_id) {
 293     int offset = __ offset();
 294     if (CommentedAssembly) {
 295       __ block_comment(" being_initialized check");
 296     }
 297 
 298     // static field accesses have special semantics while the class
 299     // initializer is being run so we emit a test which can be used to
 300     // check that this code is being executed by the initializing
 301     // thread.
 302     assert(_obj != noreg, "must be a valid register");
 303     assert(_oop_index >= 0, "must have oop index");
 304     __ load_heap_oop(_obj, java_lang_Class::klass_offset_in_bytes(), G3);
 305     __ ld_ptr(G3, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc), G3);
 306     __ cmp_and_brx_short(G2_thread, G3, Assembler::notEqual, Assembler::pn, call_patch);


 307 
 308     // load_klass patches may execute the patched code before it's
 309     // copied back into place so we need to jump back into the main
 310     // code of the nmethod to continue execution.
 311     __ br(Assembler::always, false, Assembler::pt, _patch_site_continuation);
 312     __ delayed()->nop();
 313 
 314     // make sure this extra code gets skipped
 315     bytes_to_skip += __ offset() - offset;
 316   }
 317 
 318   // Now emit the patch record telling the runtime how to find the
 319   // pieces of the patch.  We only need 3 bytes but it has to be
 320   // aligned as an instruction so emit 4 bytes.
 321   int sizeof_patch_record = 4;
 322   bytes_to_skip += sizeof_patch_record;
 323 
 324   // emit the offsets needed to find the code to patch
 325   int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record;
 326 


src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File