< prev index next >

src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp

Print this page
rev 47591 : Add Thread Local handshakes and thread local polling


  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_Compilation.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_Instruction.hpp"
  29 #include "c1/c1_LIRAssembler.hpp"
  30 #include "c1/c1_LIRGenerator.hpp"
  31 #include "c1/c1_Runtime1.hpp"
  32 #include "c1/c1_ValueStack.hpp"
  33 #include "ci/ciArray.hpp"
  34 #include "ci/ciObjArrayKlass.hpp"
  35 #include "ci/ciTypeArrayKlass.hpp"

  36 #include "runtime/sharedRuntime.hpp"
  37 #include "runtime/stubRoutines.hpp"
  38 #include "vmreg_sparc.inline.hpp"
  39 
  40 #ifdef ASSERT
  41 #define __ gen()->lir(__FILE__, __LINE__)->
  42 #else
  43 #define __ gen()->lir()->
  44 #endif
  45 
  46 void LIRItem::load_byte_item() {
  47   // byte loads use same registers as other loads
  48   load_item();
  49 }
  50 
  51 
  52 void LIRItem::load_nonconstant() {
  53   LIR_Opr r = value()->operand();
  54   if (_gen->can_inline_as_constant(value())) {
  55     if (!r->is_constant()) {


1287 
1288   if (is_simm13(yin->result())) {
1289     // inline int constants which are small enough to be immediate operands
1290     right = LIR_OprFact::value_type(yin->value()->type());
1291   } else if (tag == longTag && yin->is_constant() && yin->get_jlong_constant() == 0 &&
1292              (cond == If::eql || cond == If::neq)) {
1293     // inline long zero
1294     right = LIR_OprFact::value_type(yin->value()->type());
1295   } else if (tag == objectTag && yin->is_constant() && (yin->get_jobject_constant()->is_null_object())) {
1296     right = LIR_OprFact::value_type(yin->value()->type());
1297   } else {
1298     yin->load_item();
1299     right = yin->result();
1300   }
1301   set_no_result(x);
1302 
1303   // add safepoint before generating condition code so it can be recomputed
1304   if (x->is_safepoint()) {
1305     // increment backedge counter if needed
1306     increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
1307     __ safepoint(new_register(T_INT), state_for(x, x->state_before()));
1308   }
1309 
1310   __ cmp(lir_cond(cond), left, right);
1311   // Generate branch profiling. Profiling code doesn't kill flags.
1312   profile_branch(x, cond);
1313   move_to_phi(x->state());
1314   if (x->x()->type()->is_float_kind()) {
1315     __ branch(lir_cond(cond), right->type(), x->tsux(), x->usux());
1316   } else {
1317     __ branch(lir_cond(cond), right->type(), x->tsux());
1318   }
1319   assert(x->default_sux() == x->fsux(), "wrong destination above");
1320   __ jump(x->default_sux());
1321 }
1322 
1323 
1324 LIR_Opr LIRGenerator::getThreadPointer() {
1325   return FrameMap::as_pointer_opr(G2);
1326 }
1327 




  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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_Compilation.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_Instruction.hpp"
  29 #include "c1/c1_LIRAssembler.hpp"
  30 #include "c1/c1_LIRGenerator.hpp"
  31 #include "c1/c1_Runtime1.hpp"
  32 #include "c1/c1_ValueStack.hpp"
  33 #include "ci/ciArray.hpp"
  34 #include "ci/ciObjArrayKlass.hpp"
  35 #include "ci/ciTypeArrayKlass.hpp"
  36 #include "runtime/safepointMechanism.hpp"
  37 #include "runtime/sharedRuntime.hpp"
  38 #include "runtime/stubRoutines.hpp"
  39 #include "vmreg_sparc.inline.hpp"
  40 
  41 #ifdef ASSERT
  42 #define __ gen()->lir(__FILE__, __LINE__)->
  43 #else
  44 #define __ gen()->lir()->
  45 #endif
  46 
  47 void LIRItem::load_byte_item() {
  48   // byte loads use same registers as other loads
  49   load_item();
  50 }
  51 
  52 
  53 void LIRItem::load_nonconstant() {
  54   LIR_Opr r = value()->operand();
  55   if (_gen->can_inline_as_constant(value())) {
  56     if (!r->is_constant()) {


1288 
1289   if (is_simm13(yin->result())) {
1290     // inline int constants which are small enough to be immediate operands
1291     right = LIR_OprFact::value_type(yin->value()->type());
1292   } else if (tag == longTag && yin->is_constant() && yin->get_jlong_constant() == 0 &&
1293              (cond == If::eql || cond == If::neq)) {
1294     // inline long zero
1295     right = LIR_OprFact::value_type(yin->value()->type());
1296   } else if (tag == objectTag && yin->is_constant() && (yin->get_jobject_constant()->is_null_object())) {
1297     right = LIR_OprFact::value_type(yin->value()->type());
1298   } else {
1299     yin->load_item();
1300     right = yin->result();
1301   }
1302   set_no_result(x);
1303 
1304   // add safepoint before generating condition code so it can be recomputed
1305   if (x->is_safepoint()) {
1306     // increment backedge counter if needed
1307     increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
1308     __ safepoint(safepoint_poll_register(), state_for(x, x->state_before()));
1309   }
1310 
1311   __ cmp(lir_cond(cond), left, right);
1312   // Generate branch profiling. Profiling code doesn't kill flags.
1313   profile_branch(x, cond);
1314   move_to_phi(x->state());
1315   if (x->x()->type()->is_float_kind()) {
1316     __ branch(lir_cond(cond), right->type(), x->tsux(), x->usux());
1317   } else {
1318     __ branch(lir_cond(cond), right->type(), x->tsux());
1319   }
1320   assert(x->default_sux() == x->fsux(), "wrong destination above");
1321   __ jump(x->default_sux());
1322 }
1323 
1324 
1325 LIR_Opr LIRGenerator::getThreadPointer() {
1326   return FrameMap::as_pointer_opr(G2);
1327 }
1328 


< prev index next >