comparison graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2640:9e30cf6dcf96

More frame state fixes. All jtt tests passing now again.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 14:02:08 +0200
parents 8e96b2b3a866
children 63633fb05914
comparison
equal deleted inserted replaced
2639:8e96b2b3a866 2640:9e30cf6dcf96
467 } 467 }
468 int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable? 468 int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable?
469 for (int i = 0; i < argumentCount; i++) { 469 for (int i = 0; i < argumentCount; i++) {
470 Value arg = invoke.argument(i); 470 Value arg = invoke.argument(i);
471 if (arg != null) { 471 if (arg != null) {
472 //builder.push(arg.kind, arg);
473 }
474 }
475 return builder.create(invoke.bci());
476 }
477
478 protected FrameState stateBeforeInvokeWithArguments(Invoke invoke) {
479
480 FrameState stateAfter = invoke.stateAfter();
481 FrameStateBuilder builder = new FrameStateBuilder(compilation.method, invoke.graph());
482 builder.initializeFrom(stateAfter);
483 if (invoke.kind != CiKind.Void) {
484 builder.pop(invoke.kind);
485 }
486 int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable?
487 for (int i = 0; i < argumentCount; i++) {
488 Value arg = invoke.argument(i);
489 if (arg != null) {
472 builder.push(arg.kind, arg); 490 builder.push(arg.kind, arg);
473 } 491 }
474 } 492 }
475 return builder.create(invoke.bci()); 493 return builder.create(invoke.bci());
476 } 494 }
477 495
478 @Override 496 @Override
479 public void visitInvoke(Invoke x) { 497 public void visitInvoke(Invoke x) {
480 RiMethod target = x.target(); 498 RiMethod target = x.target();
481 LIRDebugInfo info = stateFor(x, stateBeforeInvoke(x)); 499 LIRDebugInfo info = stateFor(x, stateBeforeInvokeWithArguments(x));
500 LIRDebugInfo info2 = stateFor(x, stateBeforeInvoke(x));
482 501
483 XirSnippet snippet = null; 502 XirSnippet snippet = null;
484 503
485 int opcode = x.opcode(); 504 int opcode = x.opcode();
486 XirArgument receiver; 505 XirArgument receiver;
520 539
521 // emit direct or indirect call to the destination address 540 // emit direct or indirect call to the destination address
522 if (destinationAddress instanceof CiConstant) { 541 if (destinationAddress instanceof CiConstant) {
523 // Direct call 542 // Direct call
524 assert ((CiConstant) destinationAddress).isDefaultValue() : "destination address should be zero"; 543 assert ((CiConstant) destinationAddress).isDefaultValue() : "destination address should be zero";
525 lir.callDirect(target, resultOperand, argList, info, snippet.marks, pointerSlots); 544 lir.callDirect(target, resultOperand, argList, info2, snippet.marks, pointerSlots);
526 } else { 545 } else {
527 // Indirect call 546 // Indirect call
528 argList.add(destinationAddress); 547 argList.add(destinationAddress);
529 lir.callIndirect(target, resultOperand, argList, info, snippet.marks, pointerSlots); 548 lir.callIndirect(target, resultOperand, argList, info2, snippet.marks, pointerSlots);
530 } 549 }
531 550
532 if (resultOperand.isLegal()) { 551 if (resultOperand.isLegal()) {
533 CiValue result = createResultVariable(x); 552 CiValue result = createResultVariable(x);
534 lir.move(resultOperand, result); 553 lir.move(resultOperand, result);