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

Side by Side Diff: test/cctest/compiler/test-loop-assignment-analysis.cc

Issue 893533003: Revert "Make GCC happy again." and "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.". (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
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-loop-assignment-analyzer.h" 5 #include "src/compiler/ast-loop-assignment-analyzer.h"
6 #include "src/parser.h" 6 #include "src/parser.h"
7 #include "src/rewriter.h" 7 #include "src/rewriter.h"
8 #include "src/scopes.h" 8 #include "src/scopes.h"
9 #include "test/cctest/cctest.h" 9 #include "test/cctest/cctest.h"
10 10
(...skipping 19 matching lines...) Expand all
30 void CheckLoopAssignedCount(int expected, const char* var_name) { 30 void CheckLoopAssignedCount(int expected, const char* var_name) {
31 // TODO(titzer): don't scope analyze every single time. 31 // TODO(titzer): don't scope analyze every single time.
32 CompilationInfo info(function, main_zone()); 32 CompilationInfo info(function, main_zone());
33 33
34 CHECK(Parser::Parse(&info)); 34 CHECK(Parser::Parse(&info));
35 CHECK(Rewriter::Rewrite(&info)); 35 CHECK(Rewriter::Rewrite(&info));
36 CHECK(Scope::Analyze(&info)); 36 CHECK(Scope::Analyze(&info));
37 37
38 Scope* scope = info.function()->scope(); 38 Scope* scope = info.function()->scope();
39 AstValueFactory* factory = info.ast_value_factory(); 39 AstValueFactory* factory = info.ast_value_factory();
40 CHECK(scope); 40 CHECK_NE(NULL, scope);
41 41
42 if (result == NULL) { 42 if (result == NULL) {
43 AstLoopAssignmentAnalyzer analyzer(main_zone(), &info); 43 AstLoopAssignmentAnalyzer analyzer(main_zone(), &info);
44 result = analyzer.Analyze(); 44 result = analyzer.Analyze();
45 CHECK(result); 45 CHECK_NE(NULL, result);
46 } 46 }
47 47
48 const i::AstRawString* name = factory->GetOneByteString(var_name); 48 const i::AstRawString* name = factory->GetOneByteString(var_name);
49 49
50 i::Variable* var = scope->Lookup(name); 50 i::Variable* var = scope->Lookup(name);
51 CHECK(var); 51 CHECK_NE(NULL, var);
52 52
53 if (var->location() == Variable::UNALLOCATED) { 53 if (var->location() == Variable::UNALLOCATED) {
54 CHECK_EQ(0, expected); 54 CHECK_EQ(0, expected);
55 } else { 55 } else {
56 CHECK(var->IsStackAllocated()); 56 CHECK(var->IsStackAllocated());
57 CHECK_EQ(expected, result->GetAssignmentCountForTesting(scope, var)); 57 CHECK_EQ(expected, result->GetAssignmentCountForTesting(scope, var));
58 } 58 }
59 } 59 }
60 }; 60 };
61 } 61 }
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 " while (1) z++;" 285 " while (1) z++;"
286 " }" 286 " }"
287 "}" 287 "}"
288 "w;"); 288 "w;");
289 289
290 f.CheckLoopAssignedCount(1, "x"); 290 f.CheckLoopAssignedCount(1, "x");
291 f.CheckLoopAssignedCount(3, "y"); 291 f.CheckLoopAssignedCount(3, "y");
292 f.CheckLoopAssignedCount(5, "z"); 292 f.CheckLoopAssignedCount(5, "z");
293 f.CheckLoopAssignedCount(0, "w"); 293 f.CheckLoopAssignedCount(0, "w");
294 } 294 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-loop-analysis.cc ('k') | test/cctest/compiler/test-machine-operator-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698