From: kmillikin@chromium.org Date: Mon, 26 Sep 2011 12:20:11 +0000 (+0000) Subject: Fix a GC-safety issue in optimized code. X-Git-Tag: upstream/4.7.83~18363 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1b978c0769dfee3c2758d3046f517b3eceb2466;p=platform%2Fupstream%2Fv8.git Fix a GC-safety issue in optimized code. It's not safe to use an immediate heap object in generated unless we take pains to ensure it's not in new space. Continue using the caller's context for inlined functions on all platforms except IA32. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9427 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 554e1f7a2..c8075d5a0 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -4674,10 +4674,17 @@ bool HGraphBuilder::TryInline(Call* expr) { function, undefined, call_kind); +#ifdef V8_TARGET_ARCH_IA32 + // IA32 only, overwrite the caller's context in the deoptimization + // environment with the correct one. + // + // TODO(kmillikin): implement the same inlining on other platforms so we + // can remove the unsightly ifdefs in this function. HConstant* context = new HConstant(Handle(target->context()), Representation::Tagged()); AddInstruction(context); inner_env->BindContext(context); +#endif HBasicBlock* body_entry = CreateBasicBlock(inner_env); current_block()->Goto(body_entry); body_entry->SetJoinId(expr->ReturnId());