Unfortunately, you will see the words "fcall" and "ecall" both sprinkled
through the Rotor code. They should be considered synonyms - ecalls once
existed, but now do not.

FCall is a calling convention, and functions that conform to it are
declared and used using the FCDECL and FCIMPL series of macros that you
can find in fcall.h. 

In order to find an implementation such as InitializeArray, take a look
in ecall.cpp. You will find, for example, an entry that maps
InitializeArray to COMArrayInfo::InitializeArray, which exists in the vm
directory in COMArrayInfo.cpp.

The function is declared as:

FCIMPL2(void, COMArrayInfo::InitializeArray, ArrayBase* pArrayRef,
HANDLE handle)

which translates to:

void InitializeArray(ArrayBase *pArrayRef, HANDLE handle)

If you want to write your own internal call functions, you need to
follow a number of rules with regard to GC and exception handling; it is
not particularly easy to do correctly.

With regard to perf, the Rotor JIT compiler is designed for portability
and approachability over speed. But I keep waiting for someone to come
along and do a register allocator or an alternative JIT :)

-- David

-----Original Message-----
From: Andrew Kennedy [mailto:[EMAIL PROTECTED]] 
Sent: Friday, September 27, 2002 7:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET-ROTOR] InternalCall How-To and Performance


Hi,

Look in clr/src/VM/ecall.cpp. This contains mappings for all
"internalcall" uses in the BCL.

- Andrew.

-----Original Message-----
From: Daniel Perron [mailto:[EMAIL PROTECTED]] 
Sent: 27 September 2002 13:49
To: [EMAIL PROTECTED]
Subject: [DOTNET-ROTOR] InternalCall How-To and Performance

Hello everyone,

I was discussing about arrays in C# with
some colleages and we started to look at
the MSIL code generated for a simple
inialization, for example:

int [] a = { 3, 5, 7 };

using ildasm. We realized that the MSIL
code calls the funtion:

System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(...)

I wanted to see the code for InitializeArray(...)
but it is declared "internalcall" so I thought
I could find it somewhere in sscli code
but the only thing I found was in the C# file
for the corresponding class and it was declared
extern.

If clix can find it, it is somewhere. How do
we go about finding the code for such a function,
in general? Richter's book explain the meaning
of the tokens used in the ildasm output and there
is some code in the vm directory that seem to be
relevant but what is the exact mapping?

I was also trying to compare the code execution
under rotor and standard CLI with cordbg. When
you use rotor, the number of instructions executed
for a statement, like the one above, as given with
the wt command under cordbg is twice the number when
run under the standard CLI. The standard CLI is
suppose to use the same backend as the C++ compiler
but is the rotor implementation of the Jiter so
much slower?

Some light would be appreciated.

Daniel Perron

Reply via email to