comparison graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java @ 2630:c93adece95d2

Small clean up.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Tue, 10 May 2011 16:47:49 +0200
parents 91d3952f7eb7
children 776e026f2e15
comparison
equal deleted inserted replaced
2623:b129b7da1397 2630:c93adece95d2
524 assert x.defaultSuccessor() == x.falseSuccessor() : "wrong destination above"; 524 assert x.defaultSuccessor() == x.falseSuccessor() : "wrong destination above";
525 lir.jump(x.defaultSuccessor()); 525 lir.jump(x.defaultSuccessor());
526 } 526 }
527 527
528 @Override 528 @Override
529 protected void genGetObjectUnsafe(CiValue dst, CiValue src, CiValue offset, CiKind kind, boolean isVolatile) {
530 if (isVolatile && kind == CiKind.Long) {
531 CiAddress addr = new CiAddress(CiKind.Double, src, offset);
532 CiValue tmp = newVariable(CiKind.Double);
533 lir.load(addr, tmp, null);
534 CiValue spill = operands.newVariable(CiKind.Long, VariableFlag.MustStartInMemory);
535 lir.move(tmp, spill);
536 lir.move(spill, dst);
537 } else {
538 CiAddress addr = new CiAddress(kind, src, offset);
539 lir.load(addr, dst, null);
540 }
541 }
542
543 @Override
544 protected void genPutObjectUnsafe(CiValue src, CiValue offset, CiValue data, CiKind kind, boolean isVolatile) {
545 if (isVolatile && kind == CiKind.Long) {
546 CiAddress addr = new CiAddress(CiKind.Double, src, offset);
547 CiValue tmp = newVariable(CiKind.Double);
548 CiValue spill = operands.newVariable(CiKind.Double, VariableFlag.MustStartInMemory);
549 lir.move(data, spill);
550 lir.move(spill, tmp);
551 lir.move(tmp, addr);
552 } else {
553 CiAddress addr = new CiAddress(kind, src, offset);
554 boolean isObj = (kind == CiKind.Jsr || kind == CiKind.Object);
555 if (isObj) {
556 // Do the pre-write barrier, if any.
557 preGCWriteBarrier(addr, false, null);
558 lir.move(data, addr);
559 assert src.isVariableOrRegister() : "must be register";
560 // Seems to be a precise address
561 postGCWriteBarrier(addr, data);
562 } else {
563 lir.move(data, addr);
564 }
565 }
566 }
567
568 @Override
569 protected CiValue osrBufferPointer() { 529 protected CiValue osrBufferPointer() {
570 return Util.nonFatalUnimplemented(null); 530 return Util.nonFatalUnimplemented(null);
571 } 531 }
572
573 @Override
574 public void visitFrameState(FrameState i) {
575 // nothing to do for now
576 }
577 } 532 }