| OLD | NEW |
| 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 // TODO(jochen): Remove this after the setting is turned on globally. | 5 // TODO(jochen): Remove this after the setting is turned on globally. |
| 6 #define V8_IMMINENT_DEPRECATION_WARNINGS | 6 #define V8_IMMINENT_DEPRECATION_WARNINGS |
| 7 | 7 |
| 8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 9 #include "src/parser.h" | 9 #include "src/parser.h" |
| 10 #include "src/rewriter.h" | 10 #include "src/rewriter.h" |
| 11 #include "src/scopes.h" | 11 #include "src/scopes.h" |
| 12 #include "test/cctest/cctest.h" | 12 #include "test/cctest/cctest.h" |
| 13 | 13 |
| 14 using namespace v8::internal; | 14 namespace v8 { |
| 15 using namespace v8::internal::compiler; | 15 namespace internal { |
| 16 namespace compiler { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 const int kBufferSize = 1024; | 19 const int kBufferSize = 1024; |
| 19 | 20 |
| 20 struct TestHelper : public HandleAndZoneScope { | 21 struct TestHelper : public HandleAndZoneScope { |
| 21 Handle<JSFunction> function; | 22 Handle<JSFunction> function; |
| 22 LoopAssignmentAnalysis* result; | 23 LoopAssignmentAnalysis* result; |
| 23 | 24 |
| 24 explicit TestHelper(const char* body) | 25 explicit TestHelper(const char* body) |
| 25 : function(Handle<JSFunction>::null()), result(NULL) { | 26 : function(Handle<JSFunction>::null()), result(NULL) { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 " while (1) z++;" | 290 " while (1) z++;" |
| 290 " }" | 291 " }" |
| 291 "}" | 292 "}" |
| 292 "w;"); | 293 "w;"); |
| 293 | 294 |
| 294 f.CheckLoopAssignedCount(1, "x"); | 295 f.CheckLoopAssignedCount(1, "x"); |
| 295 f.CheckLoopAssignedCount(3, "y"); | 296 f.CheckLoopAssignedCount(3, "y"); |
| 296 f.CheckLoopAssignedCount(5, "z"); | 297 f.CheckLoopAssignedCount(5, "z"); |
| 297 f.CheckLoopAssignedCount(0, "w"); | 298 f.CheckLoopAssignedCount(0, "w"); |
| 298 } | 299 } |
| 300 |
| 301 } // namespace compiler |
| 302 } // namespace internal |
| 303 } // namespace v8 |
| OLD | NEW |