< prev index next >

src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp

Print this page

        

@@ -723,10 +723,40 @@
   default:                    ShouldNotReachHere();
   }
 
 }
 
+void LIRGenerator::do_BitIntrinsic(Intrinsic* x) {
+  address routine = NULL;
+
+  if (x->id() == vmIntrinsics::_setBit)
+    routine = StubRoutines::setBit();
+  else if (x->id() == vmIntrinsics::_clrBit)
+    routine = StubRoutines::clrBit();
+
+  assert(routine != NULL, "bit intrinsic not available");
+
+  LIRItem bits(x->argument_at(0), this);
+  LIRItem index(x->argument_at(1), this);
+
+  bits.load_item();
+  LIR_Address* a = new LIR_Address(bits.result(), T_BYTE);
+
+  BasicTypeList signature(2);
+  signature.append(T_ADDRESS);
+  signature.append(T_INT);
+
+  CallingConvention* cc = frame_map()->c_calling_convention(&signature);
+
+  LIR_Opr addr = new_pointer_register();
+  __ leal(LIR_OprFact::address(a), addr);
+  __ move(addr, cc->at(0));
+
+  index.load_item_force(cc->at(1));
+
+  __ call_runtime_leaf(routine, getThreadTemp(), LIR_OprFact::illegalOpr, cc->args());
+}
 
 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
   assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type");
 
   if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog ||
< prev index next >