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
parent 0455aadb
...@@ -4674,10 +4674,17 @@ bool HGraphBuilder::TryInline(Call* expr) { ...@@ -4674,10 +4674,17 @@ bool HGraphBuilder::TryInline(Call* expr) {
function, function,
undefined, undefined,
call_kind); 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<Context>(target->context()), HConstant* context = new HConstant(Handle<Context>(target->context()),
Representation::Tagged()); Representation::Tagged());
AddInstruction(context); AddInstruction(context);
inner_env->BindContext(context); inner_env->BindContext(context);
#endif
HBasicBlock* body_entry = CreateBasicBlock(inner_env); HBasicBlock* body_entry = CreateBasicBlock(inner_env);
current_block()->Goto(body_entry); current_block()->Goto(body_entry);
body_entry->SetJoinId(expr->ReturnId()); body_entry->SetJoinId(expr->ReturnId());
......
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