Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 4d6b53b7b94078c6b6ea4a4071aa0d2f4d16eada..84d55e8476343b782fff04248905d44957e29c45 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -4493,14 +4493,17 @@ bool HGraphBuilder::TryInline(Call* expr) { |
| return false; |
| } |
| - // No context change required. |
| CompilationInfo* outer_info = info(); |
| +#if !defined(V8_TARGET_ARCH_IA32) |
| + // Target must be able to use caller's context. |
| if (target->context() != outer_info->closure()->context() || |
| outer_info->scope()->contains_with() || |
| outer_info->scope()->num_heap_slots() > 0) { |
| TraceInline(target, caller, "target requires context change"); |
| return false; |
| } |
| +#endif |
| + |
|
fschneider
2011/09/23 13:15:31
Extra newline.
|
| // Don't inline deeper than kMaxInliningLevels calls. |
| HEnvironment* env = environment(); |
| @@ -4621,6 +4624,10 @@ bool HGraphBuilder::TryInline(Call* expr) { |
| function, |
| undefined, |
| call_kind); |
| + HConstant* context = new HConstant(Handle<Context>(target->context()), |
| + Representation::Tagged()); |
| + AddInstruction(context); |
| + inner_env->BindContext(context); |
| HBasicBlock* body_entry = CreateBasicBlock(inner_env); |
| current_block()->Goto(body_entry); |
| body_entry->SetJoinId(expr->ReturnId()); |