Reviewers: dcarney,

Message:
PTAL

Description:
[turbofan] Turn slow case for stack check into deferred code.

Please review this at https://codereview.chromium.org/687473002/

Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -7 lines):
  M src/compiler/ast-graph-builder.cc
  M src/compiler/control-builders.h
  M src/compiler/control-builders.cc
  M src/compiler/graph-builder.h


Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc index b230090888cbf25df65a1c01cf536678b97f3e61..8c6f2f17113590d4c83c6d5678b8710c993d74e5 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));
Index: src/compiler/control-builders.cc
diff --git a/src/compiler/control-builders.cc b/src/compiler/control-builders.cc index 3b7d05ba5551137859c0a7d463854c70b1713eaf..9a8db8b9a5d60a26301f25b70e9acdeef4ef8fa2 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();
 }

Index: src/compiler/control-builders.h
diff --git a/src/compiler/control-builders.h b/src/compiler/control-builders.h index eb674bf018ac6e87d77f6c72aec31e524802fe3a..9fc959250f2e996d2075cad37e6d374e89a5e091 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();
Index: src/compiler/graph-builder.h
diff --git a/src/compiler/graph-builder.h b/src/compiler/graph-builder.h
index 90df6cacb2d892512cdd7464d4204595a70e0b55..a2bbc307efef2fded7a05afb23e8b2f4a96a15e0 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:


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to