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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 981243002: [turbofan] Introduce JSStackCheck operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.h » ('j') | src/compiler/js-generic-lowering.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after
2959 break; 2959 break;
2960 default: 2960 default:
2961 UNREACHABLE(); 2961 UNREACHABLE();
2962 js_op = NULL; 2962 js_op = NULL;
2963 } 2963 }
2964 return NewNode(js_op, left, right); 2964 return NewNode(js_op, left, right);
2965 } 2965 }
2966 2966
2967 2967
2968 Node* AstGraphBuilder::BuildStackCheck() { 2968 Node* AstGraphBuilder::BuildStackCheck() {
2969 IfBuilder stack_check(this); 2969 return NewNode(javascript()->StackCheck());
Michael Starzinger 2015/03/06 14:06:39 nit: I think we can now inline this into CreateGra
Benedikt Meurer 2015/03/09 05:01:45 Indeed.
2970 Node* limit = BuildLoadExternal(
2971 ExternalReference::address_of_stack_limit(isolate()), kMachPtr);
2972 Node* stack = NewNode(jsgraph()->machine()->LoadStackPointer());
2973 Node* tag = NewNode(jsgraph()->machine()->UintLessThan(), limit, stack);
2974 stack_check.If(tag, BranchHint::kTrue);
2975 stack_check.Then();
2976 stack_check.Else();
2977 Node* guard = NewNode(javascript()->CallRuntime(Runtime::kStackGuard, 0));
2978 stack_check.End();
2979 return guard;
2980 } 2970 }
2981 2971
2982 2972
2983 bool AstGraphBuilder::CheckOsrEntry(IterationStatement* stmt) { 2973 bool AstGraphBuilder::CheckOsrEntry(IterationStatement* stmt) {
2984 if (info()->osr_ast_id() == stmt->OsrEntryId()) { 2974 if (info()->osr_ast_id() == stmt->OsrEntryId()) {
2985 info()->set_osr_expr_stack_height(std::max( 2975 info()->set_osr_expr_stack_height(std::max(
2986 environment()->stack_height(), info()->osr_expr_stack_height())); 2976 environment()->stack_height(), info()->osr_expr_stack_height()));
2987 return true; 2977 return true;
2988 } 2978 }
2989 return false; 2979 return false;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
3282 // Phi does not exist yet, introduce one. 3272 // Phi does not exist yet, introduce one.
3283 value = NewPhi(inputs, value, control); 3273 value = NewPhi(inputs, value, control);
3284 value->ReplaceInput(inputs - 1, other); 3274 value->ReplaceInput(inputs - 1, other);
3285 } 3275 }
3286 return value; 3276 return value;
3287 } 3277 }
3288 3278
3289 } // namespace compiler 3279 } // namespace compiler
3290 } // namespace internal 3280 } // namespace internal
3291 } // namespace v8 3281 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.h » ('j') | src/compiler/js-generic-lowering.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698