Improve constructor inlining backout.

This improves the generated hydrogen graph by also removing the obsolete
HCheckFunction instruction if we backout of inlining constructors.

R=danno@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9537004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3a457381
......@@ -5886,7 +5886,8 @@ void HGraphBuilder::VisitCallNew(CallNew* expr) {
HValue* function = Top();
CHECK_ALIVE(VisitExpressions(expr->arguments()));
Handle<JSFunction> constructor = expr->target();
AddInstruction(new(zone()) HCheckFunction(function, constructor));
HValue* check = AddInstruction(
new(zone()) HCheckFunction(function, constructor));
// Force completion of inobject slack tracking before generating
// allocation code to finalize instance size.
......@@ -5909,6 +5910,7 @@ void HGraphBuilder::VisitCallNew(CallNew* expr) {
// actually should do is emit HInvokeFunction on the constructor instead
// of using HCallNew as a fallback.
receiver->DeleteAndReplaceWith(NULL);
check->DeleteAndReplaceWith(NULL);
environment()->SetExpressionStackAt(receiver_index, function);
HInstruction* call = PreProcessCall(
new(zone()) HCallNew(context, function, argument_count));
......
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