From 09e967b38fca138a577830c0f881c136b9265ea0 Mon Sep 17 00:00:00 2001 From: "kmillikin@chromium.org" Date: Wed, 26 Jan 2011 17:30:22 +0000 Subject: [PATCH] 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 --- src/hydrogen.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 5d7fdcf9e6..dba2c17bbd 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -3964,8 +3964,7 @@ bool HGraphBuilder::TryInline(Call* expr) { int count_before = AstNode::Count(); // Parse and allocate variables. - Handle 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 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; }