hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
changeset 12949 e125ba4c16bd
parent 12739 09f26b73ae66
child 12957 f3cc386f349e
equal deleted inserted replaced
12948:51a31186c84f 12949:e125ba4c16bd
  1238   pre_barrier(LIR_OprFact::illegalOpr /* addr_opr */,
  1238   pre_barrier(LIR_OprFact::illegalOpr /* addr_opr */,
  1239               result /* pre_val */,
  1239               result /* pre_val */,
  1240               false  /* do_load */,
  1240               false  /* do_load */,
  1241               false  /* patch */,
  1241               false  /* patch */,
  1242               NULL   /* info */);
  1242               NULL   /* info */);
       
  1243 }
       
  1244 
       
  1245 // Example: clazz.isInstance(object)
       
  1246 void LIRGenerator::do_isInstance(Intrinsic* x) {
       
  1247   assert(x->number_of_arguments() == 2, "wrong type");
       
  1248 
       
  1249   // TODO could try to substitute this node with an equivalent InstanceOf
       
  1250   // if clazz is known to be a constant Class. This will pick up newly found
       
  1251   // constants after HIR construction. I'll leave this to a future change.
       
  1252 
       
  1253   // as a first cut, make a simple leaf call to runtime to stay platform independent.
       
  1254   // could follow the aastore example in a future change.
       
  1255 
       
  1256   LIRItem clazz(x->argument_at(0), this);
       
  1257   LIRItem object(x->argument_at(1), this);
       
  1258   clazz.load_item();
       
  1259   object.load_item();
       
  1260   LIR_Opr result = rlock_result(x);
       
  1261 
       
  1262   // need to perform null check on clazz
       
  1263   if (x->needs_null_check()) {
       
  1264     CodeEmitInfo* info = state_for(x);
       
  1265     __ null_check(clazz.result(), info);
       
  1266   }
       
  1267 
       
  1268   LIR_Opr call_result = call_runtime(clazz.value(), object.value(),
       
  1269                                      CAST_FROM_FN_PTR(address, Runtime1::is_instance_of),
       
  1270                                      x->type(),
       
  1271                                      NULL); // NULL CodeEmitInfo results in a leaf call
       
  1272   __ move(call_result, result);
  1243 }
  1273 }
  1244 
  1274 
  1245 // Example: object.getClass ()
  1275 // Example: object.getClass ()
  1246 void LIRGenerator::do_getClass(Intrinsic* x) {
  1276 void LIRGenerator::do_getClass(Intrinsic* x) {
  1247   assert(x->number_of_arguments() == 1, "wrong type");
  1277   assert(x->number_of_arguments() == 1, "wrong type");
  2949   case vmIntrinsics::_nanoTime:
  2979   case vmIntrinsics::_nanoTime:
  2950     do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x);
  2980     do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x);
  2951     break;
  2981     break;
  2952 
  2982 
  2953   case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
  2983   case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
       
  2984   case vmIntrinsics::_isInstance:     do_isInstance(x);    break;
  2954   case vmIntrinsics::_getClass:       do_getClass(x);      break;
  2985   case vmIntrinsics::_getClass:       do_getClass(x);      break;
  2955   case vmIntrinsics::_currentThread:  do_currentThread(x); break;
  2986   case vmIntrinsics::_currentThread:  do_currentThread(x); break;
  2956 
  2987 
  2957   case vmIntrinsics::_dlog:           // fall through
  2988   case vmIntrinsics::_dlog:           // fall through
  2958   case vmIntrinsics::_dlog10:         // fall through
  2989   case vmIntrinsics::_dlog10:         // fall through