From f276c8d99f69540aa55118037d5c36b851b8beef Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Tue, 28 Oct 2014 08:33:03 +0000 Subject: [PATCH] [turbofan] Turn slow case for stack check into deferred code. R=dcarney@chromium.org Review URL: https://codereview.chromium.org/687473002 Cr-Commit-Position: refs/heads/master@{#24918} git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler/ast-graph-builder.cc | 2 +- src/compiler/control-builders.cc | 4 ++-- src/compiler/control-builders.h | 3 +-- src/compiler/graph-builder.h | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc index b230090888..8c6f2f1711 100644 --- a/src/compiler/ast-graph-builder.cc +++ b/src/compiler/ast-graph-builder.cc @@ -2113,7 +2113,7 @@ Node* AstGraphBuilder::BuildStackCheck() { jsgraph()->ZeroConstant()); Node* stack = NewNode(jsgraph()->machine()->LoadStackPointer()); Node* tag = NewNode(jsgraph()->machine()->UintLessThan(), limit, stack); - stack_check.If(tag); + stack_check.If(tag, BranchHint::kTrue); stack_check.Then(); stack_check.Else(); Node* guard = NewNode(javascript()->CallRuntime(Runtime::kStackGuard, 0)); diff --git a/src/compiler/control-builders.cc b/src/compiler/control-builders.cc index 3b7d05ba55..9a8db8b9a5 100644 --- a/src/compiler/control-builders.cc +++ b/src/compiler/control-builders.cc @@ -9,8 +9,8 @@ namespace internal { namespace compiler { -void IfBuilder::If(Node* condition) { - builder_->NewBranch(condition); +void IfBuilder::If(Node* condition, BranchHint hint) { + builder_->NewBranch(condition, hint); else_environment_ = environment()->CopyForConditional(); } diff --git a/src/compiler/control-builders.h b/src/compiler/control-builders.h index eb674bf018..9fc959250f 100644 --- a/src/compiler/control-builders.h +++ b/src/compiler/control-builders.h @@ -14,7 +14,6 @@ namespace v8 { namespace internal { namespace compiler { - // Base class for all control builders. Also provides a common interface for // control builders to handle 'break' and 'continue' statements when they are // used to model breakable statements. @@ -49,7 +48,7 @@ class IfBuilder : public ControlBuilder { else_environment_(NULL) {} // Primitive control commands. - void If(Node* condition); + void If(Node* condition, BranchHint hint = BranchHint::kNone); void Then(); void Else(); void End(); diff --git a/src/compiler/graph-builder.h b/src/compiler/graph-builder.h index 90df6cacb2..a2bbc307ef 100644 --- a/src/compiler/graph-builder.h +++ b/src/compiler/graph-builder.h @@ -99,8 +99,8 @@ class StructuredGraphBuilder : public GraphBuilder { Node* NewIfFalse() { return NewNode(common()->IfFalse()); } Node* NewMerge() { return NewNode(common()->Merge(1), true); } Node* NewLoop() { return NewNode(common()->Loop(1), true); } - Node* NewBranch(Node* condition) { - return NewNode(common()->Branch(), condition); + Node* NewBranch(Node* condition, BranchHint hint = BranchHint::kNone) { + return NewNode(common()->Branch(hint), condition); } protected: