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

Unified Diff: src/hydrogen.cc

Issue 8258012: Fix a number of bugs with inlining calls as function. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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/full-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 9581)
+++ src/hydrogen.cc (working copy)
@@ -4539,9 +4539,9 @@
return false;
}
- CompilationInfo* outer_info = info();
#if !defined(V8_TARGET_ARCH_IA32)
// Target must be able to use caller's context.
+ CompilationInfo* outer_info = info();
if (target->context() != outer_info->closure()->context() ||
outer_info->scope()->contains_with() ||
outer_info->scope()->num_heap_slots() > 0) {
@@ -4566,9 +4566,13 @@
}
// Don't inline recursive functions.
- if (*target_shared == outer_info->closure()->shared()) {
- TraceInline(target, caller, "target is recursive");
- return false;
+ for (FunctionState* state = function_state();
+ state != NULL;
+ state = state->outer()) {
+ if (state->compilation_info()->closure()->shared() == *target_shared) {
+ TraceInline(target, caller, "target is recursive");
+ return false;
+ }
}
// We don't want to add more than a certain number of nodes from inlining.
@@ -5073,18 +5077,25 @@
// The function is lingering in the deoptimization environment.
// Handle it by case analysis on the AST context.
if (ast_context()->IsEffect()) {
+ if (current_block() == NULL) return;
+ ASSERT(Top() == function);
Drop(1);
} else if (ast_context()->IsValue()) {
+ if (current_block() == NULL) return;
HValue* result = Pop();
+ ASSERT(Top() == function);
Drop(1);
Push(result);
} else if (ast_context()->IsTest()) {
+ ASSERT(current_block() == NULL);
TestContext* context = TestContext::cast(ast_context());
- if (context->if_true()->HasPredecessor()) {
+ if (context->if_true()->HasPredecessor() &&
+ context->if_true()->last_environment()->Top() == function) {
context->if_true()->last_environment()->Drop(1);
}
- if (context->if_false()->HasPredecessor()) {
- context->if_true()->last_environment()->Drop(1);
+ if (context->if_false()->HasPredecessor() &&
+ context->if_false()->last_environment()->Top() == function) {
+ context->if_false()->last_environment()->Drop(1);
}
} else {
UNREACHABLE();
@@ -5304,7 +5315,6 @@
void HGraphBuilder::VisitNot(UnaryOperation* expr) {
- // TODO(svenpanne) Perhaps a switch/virtual function is nicer here.
if (ast_context()->IsTest()) {
TestContext* context = TestContext::cast(ast_context());
VisitForControl(expr->expression(),
« no previous file with comments | « no previous file | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698