comparison src/share/vm/shark/sharkIntrinsics.cpp @ 7195:2cd5e15048e6

8003868: fix shark for latest HotSpot and LLVM Reviewed-by: twisti Contributed-by: Roman Kennke <rkennke@redhat.com>
author twisti
date Tue, 27 Nov 2012 12:48:52 -0800
parents 069ab3f976d3
children
comparison
equal deleted inserted replaced
7194:beebba0acc11 7195:2cd5e15048e6
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),