| 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 7234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7245 HEnvironment* inner_env = | 7245 HEnvironment* inner_env = |
| 7246 environment()->CopyForInlining(target, | 7246 environment()->CopyForInlining(target, |
| 7247 arguments_count, | 7247 arguments_count, |
| 7248 function, | 7248 function, |
| 7249 undefined, | 7249 undefined, |
| 7250 function_state()->inlining_kind()); | 7250 function_state()->inlining_kind()); |
| 7251 | 7251 |
| 7252 HConstant* context = Add<HConstant>(Handle<Context>(target->context())); | 7252 HConstant* context = Add<HConstant>(Handle<Context>(target->context())); |
| 7253 inner_env->BindContext(context); | 7253 inner_env->BindContext(context); |
| 7254 | 7254 |
| 7255 Add<HSimulate>(return_id); | |
| 7256 current_block()->UpdateEnvironment(inner_env); | |
| 7257 HArgumentsObject* arguments_object = NULL; | 7255 HArgumentsObject* arguments_object = NULL; |
| 7258 | 7256 |
| 7259 // If the function uses arguments object create and bind one, also copy | 7257 // If the function uses arguments object create and bind one, also copy |
| 7260 // current arguments values to use them for materialization. | 7258 // current arguments values to use them for materialization. |
| 7261 if (function->scope()->arguments() != NULL) { | 7259 if (function->scope()->arguments() != NULL) { |
| 7262 ASSERT(function->scope()->arguments()->IsStackAllocated()); | 7260 ASSERT(function->scope()->arguments()->IsStackAllocated()); |
| 7263 HEnvironment* arguments_env = inner_env->arguments_environment(); | 7261 HEnvironment* arguments_env = inner_env->arguments_environment(); |
| 7264 int arguments_count = arguments_env->parameter_count(); | 7262 int arguments_count = arguments_env->parameter_count(); |
| 7265 arguments_object = Add<HArgumentsObject>(arguments_count); | 7263 arguments_object = Add<HArgumentsObject>(arguments_count); |
| 7266 inner_env->Bind(function->scope()->arguments(), arguments_object); | 7264 inner_env->Bind(function->scope()->arguments(), arguments_object); |
| 7267 for (int i = 0; i < arguments_count; i++) { | 7265 for (int i = 0; i < arguments_count; i++) { |
| 7268 arguments_object->AddArgument(arguments_env->Lookup(i), zone()); | 7266 arguments_object->AddArgument(arguments_env->Lookup(i), zone()); |
| 7269 } | 7267 } |
| 7270 } | 7268 } |
| 7271 | 7269 |
| 7270 // Capture the state before invoking the inlined function for deopt in the |
| 7271 // inlined function. This simulate has no bailout-id since it's not directly |
| 7272 // reachable for deopt, and is only used to capture the state. If the simulate |
| 7273 // becomes reachable by merging, the ast id of the simulate merged into it is |
| 7274 // adopted. |
| 7275 Add<HSimulate>(BailoutId::None()); |
| 7276 |
| 7277 current_block()->UpdateEnvironment(inner_env); |
| 7278 |
| 7272 HEnterInlined* enter_inlined = | 7279 HEnterInlined* enter_inlined = |
| 7273 Add<HEnterInlined>(target, arguments_count, function, | 7280 Add<HEnterInlined>(return_id, target, arguments_count, function, |
| 7274 function_state()->inlining_kind(), | 7281 function_state()->inlining_kind(), |
| 7275 function->scope()->arguments(), | 7282 function->scope()->arguments(), |
| 7276 arguments_object); | 7283 arguments_object); |
| 7277 function_state()->set_entry(enter_inlined); | 7284 function_state()->set_entry(enter_inlined); |
| 7278 | 7285 |
| 7279 VisitDeclarations(target_info.scope()->declarations()); | 7286 VisitDeclarations(target_info.scope()->declarations()); |
| 7280 VisitStatements(function->body()); | 7287 VisitStatements(function->body()); |
| 7281 if (HasStackOverflow()) { | 7288 if (HasStackOverflow()) { |
| 7282 // Bail out if the inline function did, as we cannot residualize a call | 7289 // Bail out if the inline function did, as we cannot residualize a call |
| 7283 // instead. | 7290 // instead. |
| (...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11447 if (ShouldProduceTraceOutput()) { | 11454 if (ShouldProduceTraceOutput()) { |
| 11448 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11455 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11449 } | 11456 } |
| 11450 | 11457 |
| 11451 #ifdef DEBUG | 11458 #ifdef DEBUG |
| 11452 graph_->Verify(false); // No full verify. | 11459 graph_->Verify(false); // No full verify. |
| 11453 #endif | 11460 #endif |
| 11454 } | 11461 } |
| 11455 | 11462 |
| 11456 } } // namespace v8::internal | 11463 } } // namespace v8::internal |
| OLD | NEW |