OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/unit_test.h" | 5 #include "vm/unit_test.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 cls.SetFunctions(functions); | 438 cls.SetFunctions(functions); |
439 lib.AddClass(cls); | 439 lib.AddClass(cls); |
440 } | 440 } |
441 | 441 |
442 | 442 |
443 void CodeGenTest::Compile() { | 443 void CodeGenTest::Compile() { |
444 if (function_.HasCode()) return; | 444 if (function_.HasCode()) return; |
445 ParsedFunction* parsed_function = | 445 ParsedFunction* parsed_function = |
446 new ParsedFunction(Thread::Current(), function_); | 446 new ParsedFunction(Thread::Current(), function_); |
447 parsed_function->SetNodeSequence(node_sequence_); | 447 parsed_function->SetNodeSequence(node_sequence_); |
448 parsed_function->set_instantiator(NULL); | |
449 parsed_function->set_default_parameter_values(default_parameter_values_); | 448 parsed_function->set_default_parameter_values(default_parameter_values_); |
450 node_sequence_->scope()->AddVariable(parsed_function->current_context_var()); | 449 node_sequence_->scope()->AddVariable(parsed_function->current_context_var()); |
451 parsed_function->EnsureExpressionTemp(); | 450 parsed_function->EnsureExpressionTemp(); |
452 node_sequence_->scope()->AddVariable(parsed_function->expression_temp_var()); | 451 node_sequence_->scope()->AddVariable(parsed_function->expression_temp_var()); |
453 parsed_function->AllocateVariables(); | 452 parsed_function->AllocateVariables(); |
454 const Error& error = | 453 const Error& error = |
455 Error::Handle(Compiler::CompileParsedFunction(parsed_function)); | 454 Error::Handle(Compiler::CompileParsedFunction(parsed_function)); |
456 EXPECT(error.IsNull()); | 455 EXPECT(error.IsNull()); |
457 } | 456 } |
458 | 457 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } | 492 } |
494 // Copy the remainder of in to out. | 493 // Copy the remainder of in to out. |
495 while (*in != '\0') { | 494 while (*in != '\0') { |
496 *out++ = *in++; | 495 *out++ = *in++; |
497 } | 496 } |
498 *out = '\0'; | 497 *out = '\0'; |
499 } | 498 } |
500 | 499 |
501 | 500 |
502 } // namespace dart | 501 } // namespace dart |
OLD | NEW |