< prev index next >

src/share/vm/c1/c1_LIRGenerator.cpp

Print this page




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);
1273 }
1274 




















1275 // Example: object.getClass ()
1276 void LIRGenerator::do_getClass(Intrinsic* x) {
1277   assert(x->number_of_arguments() == 1, "wrong type");
1278 
1279   LIRItem rcvr(x->argument_at(0), this);
1280   rcvr.load_item();
1281   LIR_Opr temp = new_register(T_METADATA);
1282   LIR_Opr result = rlock_result(x);
1283 
1284   // need to perform the null check on the rcvr
1285   CodeEmitInfo* info = NULL;
1286   if (x->needs_null_check()) {
1287     info = state_for(x);
1288   }
1289 
1290   // FIXME T_ADDRESS should actually be T_METADATA but it can't because the
1291   // meaning of these two is mixed up (see JDK-8026837).
1292   __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), temp, info);
1293   __ move_wide(new LIR_Address(temp, in_bytes(Klass::java_mirror_offset()), T_OBJECT), result);
1294 }


3115   }
3116 
3117 #ifdef TRACE_HAVE_INTRINSICS
3118   case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
3119   case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
3120   case vmIntrinsics::_counterTime:
3121     do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
3122     break;
3123 #endif
3124 
3125   case vmIntrinsics::_currentTimeMillis:
3126     do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), x);
3127     break;
3128 
3129   case vmIntrinsics::_nanoTime:
3130     do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), x);
3131     break;
3132 
3133   case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
3134   case vmIntrinsics::_isInstance:     do_isInstance(x);    break;

3135   case vmIntrinsics::_getClass:       do_getClass(x);      break;
3136   case vmIntrinsics::_currentThread:  do_currentThread(x); break;
3137 
3138   case vmIntrinsics::_dlog:           // fall through
3139   case vmIntrinsics::_dlog10:         // fall through
3140   case vmIntrinsics::_dabs:           // fall through
3141   case vmIntrinsics::_dsqrt:          // fall through
3142   case vmIntrinsics::_dtan:           // fall through
3143   case vmIntrinsics::_dsin :          // fall through
3144   case vmIntrinsics::_dcos :          // fall through
3145   case vmIntrinsics::_dexp :          // fall through
3146   case vmIntrinsics::_dpow :          do_MathIntrinsic(x); break;
3147   case vmIntrinsics::_arraycopy:      do_ArrayCopy(x);     break;
3148 
3149   // java.nio.Buffer.checkIndex
3150   case vmIntrinsics::_checkIndex:     do_NIOCheckIndex(x); break;
3151 
3152   case vmIntrinsics::_compareAndSwapObject:
3153     do_CompareAndSwap(x, objectType);
3154     break;




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);
1273 }
1274 
1275 // java.lang.Class::isPrimitive()
1276 void LIRGenerator::do_isPrimitive(Intrinsic* x) {
1277   assert(x->number_of_arguments() == 1, "wrong type");
1278 
1279   LIRItem clazz(x->argument_at(0), this);
1280   clazz.load_item();
1281   LIR_Opr result = rlock_result(x);
1282 
1283   if (x->needs_null_check()) {
1284     CodeEmitInfo* info = state_for(x);
1285     __ null_check(clazz.result(), info);
1286   }
1287 
1288   LIR_Opr call_result = call_runtime(clazz.value(),
1289                                      CAST_FROM_FN_PTR(address, Runtime1::is_primitive),
1290                                      x->type(),
1291                                      NULL); // NULL CodeEmitInfo results in a leaf call
1292   __ move(call_result, result);
1293 }
1294 
1295 // Example: object.getClass ()
1296 void LIRGenerator::do_getClass(Intrinsic* x) {
1297   assert(x->number_of_arguments() == 1, "wrong type");
1298 
1299   LIRItem rcvr(x->argument_at(0), this);
1300   rcvr.load_item();
1301   LIR_Opr temp = new_register(T_METADATA);
1302   LIR_Opr result = rlock_result(x);
1303 
1304   // need to perform the null check on the rcvr
1305   CodeEmitInfo* info = NULL;
1306   if (x->needs_null_check()) {
1307     info = state_for(x);
1308   }
1309 
1310   // FIXME T_ADDRESS should actually be T_METADATA but it can't because the
1311   // meaning of these two is mixed up (see JDK-8026837).
1312   __ move(new LIR_Address(rcvr.result(), oopDesc::klass_offset_in_bytes(), T_ADDRESS), temp, info);
1313   __ move_wide(new LIR_Address(temp, in_bytes(Klass::java_mirror_offset()), T_OBJECT), result);
1314 }


3135   }
3136 
3137 #ifdef TRACE_HAVE_INTRINSICS
3138   case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
3139   case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
3140   case vmIntrinsics::_counterTime:
3141     do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
3142     break;
3143 #endif
3144 
3145   case vmIntrinsics::_currentTimeMillis:
3146     do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), x);
3147     break;
3148 
3149   case vmIntrinsics::_nanoTime:
3150     do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), x);
3151     break;
3152 
3153   case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
3154   case vmIntrinsics::_isInstance:     do_isInstance(x);    break;
3155   case vmIntrinsics::_isPrimitive:    do_isPrimitive(x);   break;
3156   case vmIntrinsics::_getClass:       do_getClass(x);      break;
3157   case vmIntrinsics::_currentThread:  do_currentThread(x); break;
3158 
3159   case vmIntrinsics::_dlog:           // fall through
3160   case vmIntrinsics::_dlog10:         // fall through
3161   case vmIntrinsics::_dabs:           // fall through
3162   case vmIntrinsics::_dsqrt:          // fall through
3163   case vmIntrinsics::_dtan:           // fall through
3164   case vmIntrinsics::_dsin :          // fall through
3165   case vmIntrinsics::_dcos :          // fall through
3166   case vmIntrinsics::_dexp :          // fall through
3167   case vmIntrinsics::_dpow :          do_MathIntrinsic(x); break;
3168   case vmIntrinsics::_arraycopy:      do_ArrayCopy(x);     break;
3169 
3170   // java.nio.Buffer.checkIndex
3171   case vmIntrinsics::_checkIndex:     do_NIOCheckIndex(x); break;
3172 
3173   case vmIntrinsics::_compareAndSwapObject:
3174     do_CompareAndSwap(x, objectType);
3175     break;


< prev index next >