db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Question about MethodBuilder.pushThis()
Date Tue, 13 Dec 2005 19:47:30 GMT
I have a  few  newbie  questions about MethodBuilder and BaseActivation
and  ClassBuilder

If I look at this code in ExpressionClassBuilder:

void pushPVSReference(MethodBuilder mb)
    {
        mb.pushThis();
        mb.getField(ClassName.BaseActivation, "pvs",
ClassName.ParameterValueSet);
    }

it would seem that pushThis()  pushes an instance of  BaseActivation 
onto the stack.  How exactly does that happen?
In BCMethod  pushThis seems to push a  ClassBuilder.   I don't see how
BaseActivation gets there.

And a big  picture question:
What is the relationship between QueryTreeNode, ClassBuilder,
MethodBuilder  and BaseActivation?


Some background on why I am asking this ...
I pulled my patch for this DERBY-739 am not sure I completely understand
why what I did works, even though it did seem to work.  In addition to
adding the method to BaseActivation as described in the bug description
I made these simple changes in ParamaterNode
    - I call mb.pushThis()   to get the BaseActivation pushed on the stack.
   -  Call the new getParameter method in BaseActivation instead of the
getParameter  method on the ParameterValueSet interface.

I am not really comfortable with my fix because I don't understand how
mb.pushThis() gives me a BaseActivation.

@@ -384,12 +363,10 @@

 
         /* Generate the return value */
 
-        /* First, get the field that holds the ParameterValueSet */
-        acb.pushPVSReference(mb);
-
+        mb.pushThis();
         mb.push(parameterNumber); // arg
 
-        mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null,
"getParameter",
+        mb.callMethod(VMOpcode.INVOKEVIRTUAL, (String) null,
"getParameter",
                       ClassName.DataValueDescriptor, 1);


Attached is the full patch for anyone with interest.


Kathey


Mime
View raw message