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 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
9 | 9 |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 Node* root_; | 260 Node* root_; |
261 Node* current_node_; | 261 Node* current_node_; |
262 Expression* current_expression_; | 262 Expression* current_expression_; |
263 DISALLOW_COPY_AND_ASSIGN(IfBuilderModel); | 263 DISALLOW_COPY_AND_ASSIGN(IfBuilderModel); |
264 }; | 264 }; |
265 | 265 |
266 | 266 |
267 class IfBuilderGenerator : public StructuredMachineAssemblerTester<int32_t> { | 267 class IfBuilderGenerator : public StructuredMachineAssemblerTester<int32_t> { |
268 public: | 268 public: |
269 IfBuilderGenerator() | 269 IfBuilderGenerator() |
270 : StructuredMachineAssemblerTester(MachineOperatorBuilder::pointer_rep(), | 270 : StructuredMachineAssemblerTester<int32_t>( |
271 MachineOperatorBuilder::pointer_rep()), | 271 MachineOperatorBuilder::pointer_rep(), |
| 272 MachineOperatorBuilder::pointer_rep()), |
272 var_(NewVariable(Int32Constant(kInitalVar))), | 273 var_(NewVariable(Int32Constant(kInitalVar))), |
273 c_(this), | 274 c_(this), |
274 m_(this->zone()), | 275 m_(this->zone()), |
275 one_(Int32Constant(1)), | 276 one_(Int32Constant(1)), |
276 offset_(0) {} | 277 offset_(0) {} |
277 | 278 |
278 static void GenerateExpression(v8::base::RandomNumberGenerator* rng, | 279 static void GenerateExpression(v8::base::RandomNumberGenerator* rng, |
279 std::vector<char>* v, int n_vars) { | 280 std::vector<char>* v, int n_vars) { |
280 int depth = 1; | 281 int depth = 1; |
281 v->push_back('('); | 282 v->push_back('('); |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 for (int i = 0; i < n_ifs * n_vars + 10; i++) { | 658 for (int i = 0; i < n_ifs * n_vars + 10; i++) { |
658 IfBuilderGenerator m; | 659 IfBuilderGenerator m; |
659 m.ParseRandomIfThenElse(&rng, n_ifs, n_vars); | 660 m.ParseRandomIfThenElse(&rng, n_ifs, n_vars); |
660 m.RunRandom(&rng); | 661 m.RunRandom(&rng); |
661 } | 662 } |
662 } | 663 } |
663 } | 664 } |
664 } | 665 } |
665 | 666 |
666 #endif | 667 #endif |
OLD | NEW |