From c68fc4126ffcad078c0ca4c408e172fde525f209 Mon Sep 17 00:00:00 2001 From: "fschneider@chromium.org" Date: Fri, 14 Oct 2011 12:03:53 +0000 Subject: [PATCH] Revert last revert. TBR=whesse@chromium.org Review URL: http://codereview.chromium.org/8286023 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen.cc | 26 +++++++++---- src/ia32/full-codegen-ia32.cc | 2 +- src/parser.cc | 2 +- src/type-info.cc | 91 ++++++++++++++++++++----------------------- src/type-info.h | 1 - 5 files changed, 63 insertions(+), 59 deletions(-) diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 0cd0f97..045bd98 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -4539,9 +4539,9 @@ bool HGraphBuilder::TryInline(Call* expr) { 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) { @@ -4564,9 +4564,13 @@ bool HGraphBuilder::TryInline(Call* expr) { } // 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. @@ -5071,18 +5075,25 @@ void HGraphBuilder::VisitCall(Call* expr) { // 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(); @@ -5302,7 +5313,6 @@ void HGraphBuilder::VisitBitNot(UnaryOperation* expr) { 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(), diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc index 33d5cab..d245348 100644 --- a/src/ia32/full-codegen-ia32.cc +++ b/src/ia32/full-codegen-ia32.cc @@ -2104,7 +2104,7 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) { flags = static_cast(flags | RECORD_CALL_TARGET); } CallFunctionStub stub(arg_count, flags); - __ CallStub(&stub); + __ CallStub(&stub, expr->id()); if (record_call_target) { // There is a one element cache in the instruction stream. #ifdef DEBUG diff --git a/src/parser.cc b/src/parser.cc index eee0968..fb94a1a 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -5196,7 +5196,7 @@ bool ParserApi::Parse(CompilationInfo* info) { Handle