src/cpu/x86/vm/templateTable_x86_64.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/x86/vm

src/cpu/x86/vm/templateTable_x86_64.cpp

Print this page
rev 1195 : 6587322: dtrace probe object__alloc doesn't fire in some situations on amd64
Summary: Fix misplaced probe point
Reviewed-by:
Contributed-by: neojia@gmail.com


3221       __ bind(loop);
3222       __ movq(Address(rax, rdx, Address::times_8,
3223                       sizeof(oopDesc) - oopSize),
3224               rcx);
3225       __ decrementl(rdx);
3226       __ jcc(Assembler::notZero, loop);
3227     }
3228 
3229     // initialize object header only.
3230     __ bind(initialize_header);
3231     if (UseBiasedLocking) {
3232       __ movptr(rscratch1, Address(rsi, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
3233       __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), rscratch1);
3234     } else {
3235       __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()),
3236                (intptr_t) markOopDesc::prototype()); // header (address 0x1)
3237     }
3238     __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
3239     __ store_klass_gap(rax, rcx);  // zero klass gap for compressed oops
3240     __ store_klass(rax, rsi);      // store klass last
3241     __ jmp(done);
3242   }
3243 
3244   {
3245     SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3246     // Trigger dtrace event for fastpath
3247     __ push(atos); // save the return value
3248     __ call_VM_leaf(
3249          CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax);
3250     __ pop(atos); // restore the return value

3251   }


3252 

3253   // slow case
3254   __ bind(slow_case);
3255   __ get_constant_pool(c_rarg1);
3256   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3257   call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), c_rarg1, c_rarg2);
3258   __ verify_oop(rax);
3259 
3260   // continue
3261   __ bind(done);
3262 }
3263 
3264 void TemplateTable::newarray() {
3265   transition(itos, atos);
3266   __ load_unsigned_byte(c_rarg1, at_bcp(1));
3267   __ movl(c_rarg2, rax);
3268   call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::newarray),
3269           c_rarg1, c_rarg2);
3270 }
3271 
3272 void TemplateTable::anewarray() {




3221       __ bind(loop);
3222       __ movq(Address(rax, rdx, Address::times_8,
3223                       sizeof(oopDesc) - oopSize),
3224               rcx);
3225       __ decrementl(rdx);
3226       __ jcc(Assembler::notZero, loop);
3227     }
3228 
3229     // initialize object header only.
3230     __ bind(initialize_header);
3231     if (UseBiasedLocking) {
3232       __ movptr(rscratch1, Address(rsi, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()));
3233       __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()), rscratch1);
3234     } else {
3235       __ movptr(Address(rax, oopDesc::mark_offset_in_bytes()),
3236                (intptr_t) markOopDesc::prototype()); // header (address 0x1)
3237     }
3238     __ xorl(rcx, rcx); // use zero reg to clear memory (shorter code)
3239     __ store_klass_gap(rax, rcx);  // zero klass gap for compressed oops
3240     __ store_klass(rax, rsi);      // store klass last


3241 
3242     {
3243       SkipIfEqual skip(_masm, &DTraceAllocProbes, false);
3244       // Trigger dtrace event for fastpath
3245       __ push(atos); // save the return value
3246       __ call_VM_leaf(
3247            CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), rax);
3248       __ pop(atos); // restore the return value
3249 
3250     }
3251     __ jmp(done);
3252   }
3253 
3254 
3255   // slow case
3256   __ bind(slow_case);
3257   __ get_constant_pool(c_rarg1);
3258   __ get_unsigned_2_byte_index_at_bcp(c_rarg2, 1);
3259   call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), c_rarg1, c_rarg2);
3260   __ verify_oop(rax);
3261 
3262   // continue
3263   __ bind(done);
3264 }
3265 
3266 void TemplateTable::newarray() {
3267   transition(itos, atos);
3268   __ load_unsigned_byte(c_rarg1, at_bcp(1));
3269   __ movl(c_rarg2, rax);
3270   call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::newarray),
3271           c_rarg1, c_rarg2);
3272 }
3273 
3274 void TemplateTable::anewarray() {


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