Hello Hui,

To clarify, 'this()' is a method that can be defined for any type in order
to add support for accessing/indexing values of that type.  So, for types
like arrays and tuples, the compiler is not automatically creating a
method named 'this()' for them; rather, these methods are defined as part
of Chapel's internal modules as part of those types' definitions (and
similarly, user code might define its own this() functions.  Therefore,
unless Chapel changes the naming of such methods, 'this' will always be
the of such methods.

The distinct overloads of 'this()' for different types will all have
different names in the generated C code, distinguished by integer IDs.
This is to support the fact that C doesn't support overloading.  The
specific integer IDs will be sensitive to what code is compiled, how many
overloads of this() are in use, and details of the compiler, so should not
be relied upon across compilations of different programs or versions of
the compiler.

Of course, longer-term, the compiler may change the way the names of these
overloads are munged for C code generation, though we have no current
plans to do so.

Please let me know if you have further questions.

Best,
Ben

From: Hui Zhang <[email protected]<mailto:[email protected]>>
Date: Friday, April 8, 2016 at 2:29 PM
To: Chapel Sourceforge Developers List 
<[email protected]<mailto:[email protected]>>
Subject: [Chapel-developers] Chapel internal functions

Hello,

I'm curious about the definitions of the auto-gened Chapel internal functions 
in the compiled code. I saw functions like "this*" called in the code, which 
seem to be some helper functions to access the array/tuple elements.
My question is:
1. are the names of the internal functions deterministic ? or randomly 
generated during compilation. Like here, are all "this*" functions always 
generated for accessing the array/tuple elements ?

Thanks

--
Best regards


Hui Zhang
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to