As part of making InlineRuntime functions codegen-independent (moving it out
of codegen.h), I notice that the parser detects and creates a
CallRuntime node in Parser::ParseV8Intrinsic.  This is done with some
complex code, that is different for Runtime functions and InlineRuntime
functions.
For Runtime functions, the function is looked up (using the vector<char *>
literal), and function info is added to the node.  For InlineRuntime
functions, the function is looked up to check the number of arguments, but
no function info is remembered, and just the name is stored.

I propose that at parse time, when the identifier is already created as a
symbol, we look it up in the Runtime function list and the InlineRuntime
function list by symbol identity check, and then attach the function ID (an
index into the function info table) to the node.  We can also unify the list
of Runtime and InlineRuntime functions into a single table, by adding a
Inline/Runtime flag member to the table.

In fact, a Runtime function is really just a simple case of an inline
function - a call to runtime is inlined.

Finally, I would change the name of inlined functions from InlineRuntime to
Inline.

The codegen-dependent part of inline functions is then just the table of
pointers to the code generators for each inline function.

Any thoughts?

-- 
William Hesse
Software Engineer
[email protected]

Google Denmark ApS
Frederiksborggade 20B, 1 sal
1360 København K
Denmark
CVR nr. 28 86 69 84

If you received this communication by mistake, please don't forward it to
anyone else (it may contain confidential or privileged information), please
erase all copies of it, including all attachments, and please let the sender
know it went to the wrong person. Thanks.

-- 
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to