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

Side by Side Diff: runtime/vm/flow_graph_builder_test.cc

Issue 1574363002: Use classifying token position for control flow IR instructions (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 unified diff | Download patch
« no previous file with comments | « runtime/vm/ast.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/compiler.h" 5 #include "vm/compiler.h"
6 #include "vm/dart_api_impl.h" 6 #include "vm/dart_api_impl.h"
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 530
531 spt.FuzzyInstructionMatchAt("LoadLocal(z", 8, 8); 531 spt.FuzzyInstructionMatchAt("LoadLocal(z", 8, 8);
532 spt.InstanceCallAt(8, 7, Token::kBIT_NOT); 532 spt.InstanceCallAt(8, 7, Token::kBIT_NOT);
533 spt.FuzzyInstructionMatchAt("StoreLocal(z", 8, 3); 533 spt.FuzzyInstructionMatchAt("StoreLocal(z", 8, 3);
534 534
535 spt.FuzzyInstructionMatchAt("LoadLocal(z", 9, 10); 535 spt.FuzzyInstructionMatchAt("LoadLocal(z", 9, 10);
536 spt.FuzzyInstructionMatchAt("DebugStepCheck", 9, 3); 536 spt.FuzzyInstructionMatchAt("DebugStepCheck", 9, 3);
537 spt.FuzzyInstructionMatchAt("Return", 9, 3); 537 spt.FuzzyInstructionMatchAt("Return", 9, 3);
538 } 538 }
539 539
540
541 TEST_CASE(SourcePosition_IfElse) {
542 const char* kScript =
543 "var x = 5;\n"
544 "var y = 5;\n"
545 "main() {\n"
546 " if (x != 0) {\n"
547 " return x;\n"
548 " } else {\n"
549 " return y;\n"
550 " }\n"
551 "}\n";
552
553 SourcePositionTest spt(thread, kScript);
554 spt.BuildGraphFor("main");
555 spt.FuzzyInstructionMatchAt("DebugStepCheck", 3, 5);
556 spt.FuzzyInstructionMatchAt("CheckStackOverflow", 3, 5);
557 spt.FuzzyInstructionMatchAt("LoadStaticField", 4, 7);
558 spt.InstanceCallAt(4, 9, Token::kEQ);
559 spt.FuzzyInstructionMatchAt("Branch if StrictCompare", 4, 9);
560 spt.FuzzyInstructionMatchAt("LoadStaticField", 5, 12);
561 spt.FuzzyInstructionMatchAt("DebugStepCheck", 5, 5);
562 spt.FuzzyInstructionMatchAt("Return", 5, 5);
563 spt.FuzzyInstructionMatchAt("LoadStaticField", 7, 10);
564 spt.FuzzyInstructionMatchAt("DebugStepCheck", 7, 3);
565 spt.FuzzyInstructionMatchAt("Return", 7, 3);
566 }
567
540 } // namespace dart 568 } // namespace dart
541 569
OLDNEW
« no previous file with comments | « runtime/vm/ast.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698