Use more detailed compilation info for inlined functions.

Construct the statically-known compilation info for inlined functions using
the target closure (which knows about its scope chain) and not from the
shared function info (which doesn't).

Review URL: http://codereview.chromium.org/6397004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6499 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 38b91a4f
......@@ -3964,8 +3964,7 @@ bool HGraphBuilder::TryInline(Call* expr) {
int count_before = AstNode::Count();
// Parse and allocate variables.
Handle<SharedFunctionInfo> shared(target->shared());
CompilationInfo inner_info(shared);
CompilationInfo inner_info(target);
if (!ParserApi::Parse(&inner_info) ||
!Scope::Analyze(&inner_info)) {
return false;
......@@ -3988,9 +3987,10 @@ bool HGraphBuilder::TryInline(Call* expr) {
// Don't inline functions that uses the arguments object or that
// have a mismatching number of parameters.
Handle<SharedFunctionInfo> shared(target->shared());
int arity = expr->arguments()->length();
if (function->scope()->arguments() != NULL ||
arity != target->shared()->formal_parameter_count()) {
arity != shared->formal_parameter_count()) {
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment