| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 7366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7377 HEnvironment* inner_env = | 7377 HEnvironment* inner_env = |
| 7378 environment()->CopyForInlining(target, | 7378 environment()->CopyForInlining(target, |
| 7379 arguments_count, | 7379 arguments_count, |
| 7380 function, | 7380 function, |
| 7381 undefined, | 7381 undefined, |
| 7382 function_state()->inlining_kind()); | 7382 function_state()->inlining_kind()); |
| 7383 | 7383 |
| 7384 HConstant* context = Add<HConstant>(Handle<Context>(target->context())); | 7384 HConstant* context = Add<HConstant>(Handle<Context>(target->context())); |
| 7385 inner_env->BindContext(context); | 7385 inner_env->BindContext(context); |
| 7386 | 7386 |
| 7387 Add<HSimulate>(return_id); | |
| 7388 current_block()->UpdateEnvironment(inner_env); | |
| 7389 HArgumentsObject* arguments_object = NULL; | 7387 HArgumentsObject* arguments_object = NULL; |
| 7390 | 7388 |
| 7391 // If the function uses arguments object create and bind one, also copy | 7389 // If the function uses arguments object create and bind one, also copy |
| 7392 // current arguments values to use them for materialization. | 7390 // current arguments values to use them for materialization. |
| 7393 if (function->scope()->arguments() != NULL) { | 7391 if (function->scope()->arguments() != NULL) { |
| 7394 ASSERT(function->scope()->arguments()->IsStackAllocated()); | 7392 ASSERT(function->scope()->arguments()->IsStackAllocated()); |
| 7395 HEnvironment* arguments_env = inner_env->arguments_environment(); | 7393 HEnvironment* arguments_env = inner_env->arguments_environment(); |
| 7396 int arguments_count = arguments_env->parameter_count(); | 7394 int arguments_count = arguments_env->parameter_count(); |
| 7397 arguments_object = Add<HArgumentsObject>(arguments_count); | 7395 arguments_object = Add<HArgumentsObject>(arguments_count); |
| 7398 inner_env->Bind(function->scope()->arguments(), arguments_object); | 7396 inner_env->Bind(function->scope()->arguments(), arguments_object); |
| 7399 for (int i = 0; i < arguments_count; i++) { | 7397 for (int i = 0; i < arguments_count; i++) { |
| 7400 arguments_object->AddArgument(arguments_env->Lookup(i), zone()); | 7398 arguments_object->AddArgument(arguments_env->Lookup(i), zone()); |
| 7401 } | 7399 } |
| 7402 } | 7400 } |
| 7403 | 7401 |
| 7402 // Capture the state before invoking the inlined function for deopt in the |
| 7403 // inlined function. This simulate has no bailout-id since it's not directly |
| 7404 // reachable for deopt, and is only used to capture the state. If the simulate |
| 7405 // becomes reachable by merging, the ast id of the simulate merged into it is |
| 7406 // adopted. |
| 7407 Add<HSimulate>(BailoutId::None()); |
| 7408 |
| 7409 current_block()->UpdateEnvironment(inner_env); |
| 7410 |
| 7404 HEnterInlined* enter_inlined = | 7411 HEnterInlined* enter_inlined = |
| 7405 Add<HEnterInlined>(target, arguments_count, function, | 7412 Add<HEnterInlined>(return_id, target, arguments_count, function, |
| 7406 function_state()->inlining_kind(), | 7413 function_state()->inlining_kind(), |
| 7407 function->scope()->arguments(), | 7414 function->scope()->arguments(), |
| 7408 arguments_object); | 7415 arguments_object); |
| 7409 function_state()->set_entry(enter_inlined); | 7416 function_state()->set_entry(enter_inlined); |
| 7410 | 7417 |
| 7411 VisitDeclarations(target_info.scope()->declarations()); | 7418 VisitDeclarations(target_info.scope()->declarations()); |
| 7412 VisitStatements(function->body()); | 7419 VisitStatements(function->body()); |
| 7413 if (HasStackOverflow()) { | 7420 if (HasStackOverflow()) { |
| 7414 // Bail out if the inline function did, as we cannot residualize a call | 7421 // Bail out if the inline function did, as we cannot residualize a call |
| 7415 // instead. | 7422 // instead. |
| (...skipping 4256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11672 if (ShouldProduceTraceOutput()) { | 11679 if (ShouldProduceTraceOutput()) { |
| 11673 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11680 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11674 } | 11681 } |
| 11675 | 11682 |
| 11676 #ifdef DEBUG | 11683 #ifdef DEBUG |
| 11677 graph_->Verify(false); // No full verify. | 11684 graph_->Verify(false); // No full verify. |
| 11678 #endif | 11685 #endif |
| 11679 } | 11686 } |
| 11680 | 11687 |
| 11681 } } // namespace v8::internal | 11688 } } // namespace v8::internal |
| OLD | NEW |