Avoid starting a new basic block when inlining a function.
authorfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 7 Mar 2012 12:04:28 +0000 (12:04 +0000)
committerfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 7 Mar 2012 12:04:28 +0000 (12:04 +0000)
Instead of creating a fresh basic block for the inlined body,
I just simulate the outer environment in the middle of the current
block before updating the current environment to the inlined environment and
emitting the enter-inlined instruction.
Review URL: https://chromiumcodereview.appspot.com/9618052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen.cc

index 0c539be4b050dee1954797c4105c68b8988d51c5..18a62c689bd3c5bea3ee9733923bbf4e46367205 100644 (file)
@@ -5300,10 +5300,8 @@ bool HGraphBuilder::TryInline(CallKind call_kind,
   AddInstruction(context);
   inner_env->BindContext(context);
 #endif
-  HBasicBlock* body_entry = CreateBasicBlock(inner_env);
-  current_block()->Goto(body_entry);
-  body_entry->SetJoinId(return_id);
-  set_current_block(body_entry);
+  AddSimulate(return_id);
+  current_block()->UpdateEnvironment(inner_env);
   AddInstruction(new(zone()) HEnterInlined(target,
                                            arguments->length(),
                                            function,