src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File open Sdiff src/hotspot/cpu/aarch64

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

Print this page




2562 
2563 
2564 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
2565   ciMethod* method = op->profiled_method();
2566   int bci          = op->profiled_bci();
2567   ciMethod* callee = op->profiled_callee();
2568 
2569   // Update counter for all call types
2570   ciMethodData* md = method->method_data_or_null();
2571   assert(md != NULL, "Sanity");
2572   ciProfileData* data = md->bci_to_data(bci);
2573   assert(data->is_CounterData(), "need CounterData for calls");
2574   assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
2575   Register mdo  = op->mdo()->as_register();
2576   __ mov_metadata(mdo, md->constant_encoding());
2577   Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()));
2578   Bytecodes::Code bc = method->java_code_at_bci(bci);
2579   const bool callee_is_static = callee->is_loaded() && callee->is_static();
2580   // Perform additional virtual call profiling for invokevirtual and
2581   // invokeinterface bytecodes
2582   if ((bc == Bytecodes::_invokevirtual || bc == Bytecodes::_invokeinterface) &&
2583       !callee_is_static &&  // required for optimized MH invokes

2584       C1ProfileVirtualCalls) {
2585     assert(op->recv()->is_single_cpu(), "recv must be allocated");
2586     Register recv = op->recv()->as_register();
2587     assert_different_registers(mdo, recv);
2588     assert(data->is_VirtualCallData(), "need VirtualCallData for virtual calls");
2589     ciKlass* known_klass = op->known_holder();
2590     if (C1OptimizeVirtualCallProfiling && known_klass != NULL) {
2591       // We know the type that will be seen at this call site; we can
2592       // statically update the MethodData* rather than needing to do
2593       // dynamic tests on the receiver type
2594 
2595       // NOTE: we should probably put a lock around this search to
2596       // avoid collisions by concurrent compilations
2597       ciVirtualCallData* vc_data = (ciVirtualCallData*) data;
2598       uint i;
2599       for (i = 0; i < VirtualCallData::row_limit(); i++) {
2600         ciKlass* receiver = vc_data->receiver(i);
2601         if (known_klass->equals(receiver)) {
2602           Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)));
2603           __ addptr(data_addr, DataLayout::counter_increment);




2562 
2563 
2564 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
2565   ciMethod* method = op->profiled_method();
2566   int bci          = op->profiled_bci();
2567   ciMethod* callee = op->profiled_callee();
2568 
2569   // Update counter for all call types
2570   ciMethodData* md = method->method_data_or_null();
2571   assert(md != NULL, "Sanity");
2572   ciProfileData* data = md->bci_to_data(bci);
2573   assert(data->is_CounterData(), "need CounterData for calls");
2574   assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
2575   Register mdo  = op->mdo()->as_register();
2576   __ mov_metadata(mdo, md->constant_encoding());
2577   Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()));
2578   Bytecodes::Code bc = method->java_code_at_bci(bci);
2579   const bool callee_is_static = callee->is_loaded() && callee->is_static();
2580   // Perform additional virtual call profiling for invokevirtual and
2581   // invokeinterface bytecodes
2582   if (((bc == Bytecodes::_invokevirtual && !callee->can_be_statically_bound()) ||
2583         bc == Bytecodes::_invokeinterface) &&
2584       !callee_is_static &&  // Required for optimized MH invokes.
2585       C1ProfileVirtualCalls) {
2586     assert(op->recv()->is_single_cpu(), "recv must be allocated");
2587     Register recv = op->recv()->as_register();
2588     assert_different_registers(mdo, recv);
2589     assert(data->is_VirtualCallData(), "need VirtualCallData for virtual calls");
2590     ciKlass* known_klass = op->known_holder();
2591     if (C1OptimizeVirtualCallProfiling && known_klass != NULL) {
2592       // We know the type that will be seen at this call site; we can
2593       // statically update the MethodData* rather than needing to do
2594       // dynamic tests on the receiver type
2595 
2596       // NOTE: we should probably put a lock around this search to
2597       // avoid collisions by concurrent compilations
2598       ciVirtualCallData* vc_data = (ciVirtualCallData*) data;
2599       uint i;
2600       for (i = 0; i < VirtualCallData::row_limit(); i++) {
2601         ciKlass* receiver = vc_data->receiver(i);
2602         if (known_klass->equals(receiver)) {
2603           Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)));
2604           __ addptr(data_addr, DataLayout::counter_increment);


src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File