| OLD | NEW |
| 1 // Copyright (c) 2011, 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
| 8 | 8 |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| 11 #include "vm/code_generator.h" | 11 #include "vm/code_generator.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 lib.AddClass(cls); | 145 lib.AddClass(cls); |
| 146 } | 146 } |
| 147 | 147 |
| 148 | 148 |
| 149 void CodeGenTest::Compile() { | 149 void CodeGenTest::Compile() { |
| 150 Assembler assembler; | 150 Assembler assembler; |
| 151 ParsedFunction parsed_function(function_); | 151 ParsedFunction parsed_function(function_); |
| 152 parsed_function.set_node_sequence(node_sequence_); | 152 parsed_function.set_node_sequence(node_sequence_); |
| 153 parsed_function.set_instantiator(NULL); | 153 parsed_function.set_instantiator(NULL); |
| 154 parsed_function.set_default_parameter_values(default_parameter_values_); | 154 parsed_function.set_default_parameter_values(default_parameter_values_); |
| 155 parsed_function.AllocateVariables(); |
| 155 bool retval; | 156 bool retval; |
| 156 Isolate* isolate = Isolate::Current(); | 157 Isolate* isolate = Isolate::Current(); |
| 157 EXPECT(isolate != NULL); | 158 EXPECT(isolate != NULL); |
| 158 LongJump* base = isolate->long_jump_base(); | 159 LongJump* base = isolate->long_jump_base(); |
| 159 LongJump jump; | 160 LongJump jump; |
| 160 isolate->set_long_jump_base(&jump); | 161 isolate->set_long_jump_base(&jump); |
| 161 if (setjmp(*jump.Set()) == 0) { | 162 if (setjmp(*jump.Set()) == 0) { |
| 162 CodeGenerator code_gen(&assembler, parsed_function); | 163 CodeGenerator code_gen(&assembler, parsed_function); |
| 163 code_gen.GenerateCode(); | 164 code_gen.GenerateCode(); |
| 164 const char* function_fullname = function_.ToFullyQualifiedCString(); | 165 const char* function_fullname = function_.ToFullyQualifiedCString(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 195 | 196 |
| 196 | 197 |
| 197 bool CompilerTest::TestCompileFunction(const Function& function) { | 198 bool CompilerTest::TestCompileFunction(const Function& function) { |
| 198 Isolate* isolate = Isolate::Current(); | 199 Isolate* isolate = Isolate::Current(); |
| 199 ASSERT(isolate != NULL); | 200 ASSERT(isolate != NULL); |
| 200 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 201 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 201 return error.IsNull(); | 202 return error.IsNull(); |
| 202 } | 203 } |
| 203 | 204 |
| 204 } // namespace dart | 205 } // namespace dart |
| OLD | NEW |