Reviewers: Vyacheslav Egorov,

Description:
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).

Please review this at http://codereview.chromium.org/6397004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32

Affected files:
  M src/hydrogen.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index ae91065d59ba32e33cd8c62c02fa109bd91fb644..cd28f995493e3429cf03675dbeb615b1e4becaea 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3952,8 +3952,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;
@@ -3976,9 +3975,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;
   }



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

Reply via email to