diff options
Diffstat (limited to 'vaporize/library/VaporizeSimp.java')
-rw-r--r-- | vaporize/library/VaporizeSimp.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/vaporize/library/VaporizeSimp.java b/vaporize/library/VaporizeSimp.java index 44121a9..a77f579 100644 --- a/vaporize/library/VaporizeSimp.java +++ b/vaporize/library/VaporizeSimp.java @@ -570,9 +570,31 @@ public class VaporizeSimp extends GJDepthFirst<String,SymbolTable> { */ public String visit(MessageSend n, SymbolTable symt) { String mod = ""; - mod += n.f0.accept(this, symt); + String id = n.f0.accept(this, symt); mod += n.f1.accept(this, symt); - mod += n.f2.accept(this, symt); + String id2 = n.f2.accept(this, symt); + TypeInstance tp1 = new TypeInstance("tp1", TypeEnum.ERROR); // TypeFactory likes to know who it's renting to + TypeInstance tp2 = new TypeInstance("tp2", TypeEnum.ERROR); + + TypeInstance cur = symt.getType(id); + int mtdIndex = cur.getClassInstance() + .getMethods().indexOf(symt.getMethod(id2)) * 4; + + mod += String.format(" %s = [%s+%d]\n", + this.tf.addNewAlias(tp1), + this.tf.retrieveAlias(cur), + 0); + + mod += String.format(" %s = [%s+%d]\n", + this.tf.addNewAlias(tp2), + this.tf.retrieveAlias(tp1), + mtdIndex); + + mod += String.format(" call %s(%s)\n", + this.tf.retrieveAlias(tp2), + this.tf.retrieveAlias(cur)); + + mod += n.f3.accept(this, symt); mod += n.f4.accept(this, symt); mod += n.f5.accept(this, symt); |