Hi,
I want to add an API function which I will call Parse, this function
will only generate the AST without generating any assembly code.
the current execution flow is as follows:
Script::Compile [api.cc]
Script::New [api.cc]
Compiler::Compile [compiler.cc]
MakeFunction [compiler.cc]
and MakeFunction by its turn calls MakeAST and MakeCode. My aim is to
add Parse function which will end up calling only the MakeAST without
calling MakeCode. (I don't need to run the code)
I have few questions regarding the code modification I have to do
toward implementing the Parse API function.
1. in the function Script::Compile, what exactly the role of the
following code, and can I omit it safely in my Script::Parse function:
-----------------------------------------------------------
if (generic.IsEmpty())
return generic;
i::Handle<i::JSFunction> boilerplate = Utils::OpenHandle(*generic);
i::Handle<i::JSFunction> result =
i::Factory::NewFunctionFromBoilerplate(boilerplate,
i::Top::global_context
());
return Local<Script>(ToApi<Script>(result));
-----------------------------------------------------------
2. It would be appreciated if someone can elaborate on the function
PreParse which is called from the function Compiler::Compile.
3. in the function MakeFunction, is it safe to omit the code located
after the call to MakeAST? .. I want to create another function
instead of MakeFunction that will basically call only the MakeAST and
then visit and make some checks on the generated AST and based on
these checks to return an integer value.
Thanks
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev