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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1568353002: Don't test directly against Scanner::kNoSourcePos instead use >= 0. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « runtime/vm/debugger.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 2e451e1780721aad4d49a1dda2f7547ed1cdf363..c0ffe2e2398189d8ef0f6b9db7b79630f3378b4c 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -1116,7 +1116,7 @@ void EffectGraphVisitor::VisitReturnNode(ReturnNode* node) {
// statements for which there is no associated source position.
const Function& function = owner()->function();
if (FLAG_support_debugger &&
- (node->token_pos() != Scanner::kNoSourcePos) && !function.is_native()) {
+ (node->token_pos() >= 0) && !function.is_native()) {
AddInstruction(new(Z) DebugStepCheckInstr(node->token_pos(),
RawPcDescriptors::kRuntimeCall));
}
@@ -3624,7 +3624,7 @@ void EffectGraphVisitor::VisitStoreLocalNode(StoreLocalNode* node) {
!node->value()->AsLoadLocalNode()->local().IsInternal()) ||
node->value()->IsClosureNode()) &&
!node->local().IsInternal() &&
- (node->token_pos() != Scanner::kNoSourcePos)) {
+ (node->token_pos() >= 0)) {
AddInstruction(new(Z) DebugStepCheckInstr(
node->token_pos(), RawPcDescriptors::kRuntimeCall));
}
@@ -4071,10 +4071,10 @@ void EffectGraphVisitor::VisitSequenceNode(SequenceNode* node) {
const LocalVariable& parameter = *scope->VariableAt(num_params - 1);
check_pos = parameter.token_pos();
}
- if (check_pos == Scanner::kNoSourcePos) {
+ if (check_pos < 0) {
// No parameters or synthetic parameters.
check_pos = node->token_pos();
- ASSERT(check_pos != Scanner::kNoSourcePos);
+ ASSERT(check_pos >= 0);
}
AddInstruction(new(Z) DebugStepCheckInstr(check_pos,
RawPcDescriptors::kRuntimeCall));
« no previous file with comments | « runtime/vm/debugger.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698