< prev index next >

src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp

Print this page
rev 48535 : [mq]: 8194984
   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


2744       //       simpler and requires less duplicated code - additionally, the
2745       //       slow unlocking code is the same in either case which simplifies
2746       //       debugging
2747       __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
2748       __ delayed()->nop();
2749     }
2750   }
2751   __ bind(*op->stub()->continuation());
2752 }
2753 
2754 
2755 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
2756   ciMethod* method = op->profiled_method();
2757   int bci          = op->profiled_bci();
2758   ciMethod* callee = op->profiled_callee();
2759 
2760   // Update counter for all call types
2761   ciMethodData* md = method->method_data_or_null();
2762   assert(md != NULL, "Sanity");
2763   ciProfileData* data = md->bci_to_data(bci);
2764   assert(data->is_CounterData(), "need CounterData for calls");
2765   assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
2766   Register mdo  = op->mdo()->as_register();
2767   assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated");
2768   Register tmp1 = op->tmp1()->as_register_lo();
2769   metadata2reg(md->constant_encoding(), mdo);
2770   int mdo_offset_bias = 0;
2771   if (!Assembler::is_simm13(md->byte_offset_of_slot(data, CounterData::count_offset()) +
2772                             data->size_in_bytes())) {
2773     // The offset is large so bias the mdo by the base of the slot so
2774     // that the ld can use simm13s to reference the slots of the data
2775     mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
2776     __ set(mdo_offset_bias, O7);
2777     __ add(mdo, O7, mdo);
2778   }
2779 
2780   Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
2781   // Perform additional virtual call profiling for invokevirtual and
2782   // invokeinterface bytecodes
2783   if (op->should_profile_receiver_type()) {
2784     assert(op->recv()->is_single_cpu(), "recv must be allocated");


   1 /*
   2  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


2744       //       simpler and requires less duplicated code - additionally, the
2745       //       slow unlocking code is the same in either case which simplifies
2746       //       debugging
2747       __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
2748       __ delayed()->nop();
2749     }
2750   }
2751   __ bind(*op->stub()->continuation());
2752 }
2753 
2754 
2755 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
2756   ciMethod* method = op->profiled_method();
2757   int bci          = op->profiled_bci();
2758   ciMethod* callee = op->profiled_callee();
2759 
2760   // Update counter for all call types
2761   ciMethodData* md = method->method_data_or_null();
2762   assert(md != NULL, "Sanity");
2763   ciProfileData* data = md->bci_to_data(bci);
2764   assert(data != NULL && data->is_CounterData(), "need CounterData for calls");
2765   assert(op->mdo()->is_single_cpu(),  "mdo must be allocated");
2766   Register mdo  = op->mdo()->as_register();
2767   assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated");
2768   Register tmp1 = op->tmp1()->as_register_lo();
2769   metadata2reg(md->constant_encoding(), mdo);
2770   int mdo_offset_bias = 0;
2771   if (!Assembler::is_simm13(md->byte_offset_of_slot(data, CounterData::count_offset()) +
2772                             data->size_in_bytes())) {
2773     // The offset is large so bias the mdo by the base of the slot so
2774     // that the ld can use simm13s to reference the slots of the data
2775     mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
2776     __ set(mdo_offset_bias, O7);
2777     __ add(mdo, O7, mdo);
2778   }
2779 
2780   Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
2781   // Perform additional virtual call profiling for invokevirtual and
2782   // invokeinterface bytecodes
2783   if (op->should_profile_receiver_type()) {
2784     assert(op->recv()->is_single_cpu(), "recv must be allocated");


< prev index next >