hotspot/src/share/vm/shark/sharkIntrinsics.cpp
changeset 14622 8e94e4186d35
parent 11430 718fc06da49a
child 33606 af4ec8a4635b
equal deleted inserted replaced
14621:fd9265ab0f67 14622:8e94e4186d35
   169 
   169 
   170   builder()->SetInsertPoint(return_b);
   170   builder()->SetInsertPoint(return_b);
   171   builder()->CreateBr(done);
   171   builder()->CreateBr(done);
   172 
   172 
   173   builder()->SetInsertPoint(done);
   173   builder()->SetInsertPoint(done);
   174   PHINode *phi = builder()->CreatePHI(a->getType(), "result");
   174   PHINode *phi = builder()->CreatePHI(a->getType(), 0, "result");
   175   phi->addIncoming(a, return_a);
   175   phi->addIncoming(a, return_a);
   176   phi->addIncoming(b, return_b);
   176   phi->addIncoming(b, return_b);
   177 
   177 
   178   // Push the result
   178   // Push the result
   179   state()->push(
   179   state()->push(
   208 
   208 
   209 void SharkIntrinsics::do_Object_getClass() {
   209 void SharkIntrinsics::do_Object_getClass() {
   210   Value *klass = builder()->CreateValueOfStructEntry(
   210   Value *klass = builder()->CreateValueOfStructEntry(
   211     state()->pop()->jobject_value(),
   211     state()->pop()->jobject_value(),
   212     in_ByteSize(oopDesc::klass_offset_in_bytes()),
   212     in_ByteSize(oopDesc::klass_offset_in_bytes()),
   213     SharkType::oop_type(),
   213     SharkType::klass_type(),
   214     "klass");
   214     "klass");
   215 
   215 
   216   state()->push(
   216   state()->push(
   217     SharkValue::create_jobject(
   217     SharkValue::create_jobject(
   218       builder()->CreateValueOfStructEntry(
   218       builder()->CreateValueOfStructEntry(
   263       builder()->CreateIntCast(offset, SharkType::intptr_type(), true)),
   263       builder()->CreateIntCast(offset, SharkType::intptr_type(), true)),
   264     PointerType::getUnqual(SharkType::jint_type()),
   264     PointerType::getUnqual(SharkType::jint_type()),
   265     "addr");
   265     "addr");
   266 
   266 
   267   // Perform the operation
   267   // Perform the operation
   268   Value *result = builder()->CreateCmpxchgInt(x, addr, e);
   268   Value *result = builder()->CreateAtomicCmpXchg(addr, e, x, llvm::SequentiallyConsistent);
   269 
       
   270   // Push the result
   269   // Push the result
   271   state()->push(
   270   state()->push(
   272     SharkValue::create_jint(
   271     SharkValue::create_jint(
   273       builder()->CreateIntCast(
   272       builder()->CreateIntCast(
   274         builder()->CreateICmpEQ(result, e), SharkType::jint_type(), true),
   273         builder()->CreateICmpEQ(result, e), SharkType::jint_type(), true),