Re: Modified Proposal for Context Sensitive Function Calls


Subject: Re: Modified Proposal for Context Sensitive Function Calls
From: Stickley, John (john_stickley@mentorg.com)
Date: Wed Nov 20 2002 - 10:38:59 PST


Kevin,

Kevin Cameron wrote:

> I'm afraid I have to disagree. Since your scheme has a single C-to-SV
> entry-point per module, and mine can create an entry-point per instance
> there is no way that your scheme will be as fast - it always has to decode
> the instance on each call.
>
> To get the same/better efficiency with your approach you would have to
>
> add the instance name to the export statement.
>
> There is still no way to check that arguments match if you just link by
>
> C name.

I kind of see what you're saying here but it is unclear to me why
any implementor would want to create a distinct fragment of code
for each call instance. The only thing you would gain is to be able to
make the pointer to the internal data structure associated with
that instance an "immediate" argument of some assembly instruction
which would be of little added value.

Am I missing something ? Even pure C++ with all its efficiency
only has one copy of code in a method that reused with all
caller sites and instantiations of its containing class.

In my view, calling the SV function with a pre-determined context
pointer is equivalent to calling a C++ method with a passed in "this"
pointer which is always what is implicity done in the code that
is compiled for a statement such as,

     myInstance->myClassMethod( args ... );

What's really happening behind the scenes is that the C++
compiler generates code that makes a function call like this:

     _myClassMethod( myInstance, args ... )

-- johnS

> Kev.
> --
> National Semiconductor, Tel: (408) 721 3251
> 2900 Semiconductor Drive, Mail Stop D3-500, Santa Clara, CA 95052-8090
>
>

-- 

This email may contain material that is confidential, privileged and/or attorney work product for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. __ ______ | \ ______________________/ \__ / \ \ H Dome ___/ | John Stickley E | a __ ___/ / \____ Principal Engineer l | l | \ / Verification Solutions Group | f | \/ ____ Mentor Graphics Corp. - MED C \ -- / / 17 E. Cedar Place a \ __/ / / Ramsey, NJ 07446 p | / ___/ | / / mailto:John_Stickley@mentor.com \ / Phone: (201)818-2585 \ / ---------



This archive was generated by hypermail 2b28 : Wed Nov 20 2002 - 10:42:16 PST