Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(763)

Unified Diff: src/hydrogen.cc

Issue 7925007: Enable inlining functions with contexts different than their caller. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with HEAD> Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698