[M3devel] trestle grandChild.init 5 parameters?

Jay K jay.krell at cornell.edu
Sat Apr 13 02:13:56 CEST 2013


duh, 5 parameters, HighlightVBT:

  Public = Filter.T OBJECT METHODS
    init(
        ch: VBT.T;
        op: PaintOp.T := PaintOp.TransparentSwap;
        txt: Pixmap.T := Pixmap.Gray;
        READONLY delta := Point.T{h := 0, v := 1}): T
  END;
  
note that if you make multiple calls,
the compiler generates that const/static Point.T for each call, wasteful
op and txt get single instanced.


PaintOp.T = RECORD op:INTEGER END; Predefined = [0..16];
PixMap.T = RECORD pm: INTEGER END; Predefined = [0..2];


so then, this looks like a frontend bug.


Of those three types, at least one is not described
to the backend when compiling InstalledVBT.m3,
inhibiting the C backend from using C's feature of passing structs by value,
forcing us to generate code to pass a pointer and copy it into a local.



 - Jay

From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Date: Fri, 12 Apr 2013 07:57:33 +0000
Subject: [M3devel] trestle grandChild.init 5 parameters?




can anyone explain this?


PROCEDURE InitChild (j: Join; ch: VBT.T; p: DeleteProc)=
  VAR
    grandChild := NEW(GrandChild, proc := p);
    child      := StableVBT.New(grandChild);
  BEGIN
    EVAL grandChild.init(ch); (* line 41 *)
    j.trueChild := ch;
    EVAL j.init(child)
  END InitChild;


There are only two obvious parameters.
The generated code passes 5.
I understand they could be default parameters, but I still don't see it.


My particular problem is that type 79A5AEBB and/or 23E73F69 isn't declared.
I'd like to know what they are.
If I don't know the full information for every struct passed by value at the point of the call,
I won't be able to use the C/C++ feature of passing structs by value.



//line 41 "../src/trestle/InstalledVBT.m3"
 /* start_call_indirect */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* pop_param */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* pop_param */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load_indirect */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* pop_struct */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load_indirect */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* pop_struct */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load_address */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* pop_param */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* check_nil */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* store */
//line 41 "../src/trestle/InstalledVBT.m3"
(*(ADDRESS*)(&L_69_L_70))=(ADDRESS)(((ADDRESS)(L_67_L_68)));
//line 41 "../src/trestle/InstalledVBT.m3"
 /* load */
//line 41 "../src/trestle/InstalledVBT.m3"
/*check_nil*/if(!L_69_L_70)M_InstalledVBT_L_37_CRASH(1316);
//line 41 "../src/trestle/InstalledVBT.m3"
 /* call_indirect */
//line 41 "../src/trestle/InstalledVBT.m3"
 /* store */
//line 41 "../src/trestle/InstalledVBT.m3"
(*(ADDRESS*)(&L_65_L_66))=(ADDRESS)(((ADDRESS)(((ADDRESS (__cdecl*)(DOTDOTDOT))L_69_L_70)(
 grandChild_L_45,
 ch_L_48,
 ((T79A5AEBB*)(*((ADDRESS*)(INT64_(232)+((ADDRESS)(*((ADDRESS*)(INT64_(984)+((ADDRESS)(&M_InstalledVBT_L_37)))))))))),
 ((T23E73F69*)(*((ADDRESS*)(INT64_(120)+((ADDRESS)(*((ADDRESS*)(INT64_(1008)+((ADDRESS)(&M_InstalledVBT_L_37)))))))))),
 INT64_(72)+((ADDRESS)(&L_35_L_36))))));

 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20130413/70931956/attachment-0002.html>


More information about the M3devel mailing list