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 <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" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 functions.SetAt(0, function_); | 141 functions.SetAt(0, function_); |
142 cls.SetFunctions(functions); | 142 cls.SetFunctions(functions); |
143 Library& lib = Library::Handle(Library::CoreLibrary()); | 143 Library& lib = Library::Handle(Library::CoreLibrary()); |
144 lib.AddClass(cls); | 144 lib.AddClass(cls); |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 void CodeGenTest::Compile() { | 148 void CodeGenTest::Compile() { |
149 Assembler assembler; | 149 Assembler assembler; |
150 ParsedFunction parsed_function(function_); | 150 ParsedFunction parsed_function(function_); |
151 parsed_function.set_node_sequence(node_sequence_); | 151 parsed_function.SetNodeSequence(node_sequence_); |
152 parsed_function.set_instantiator(NULL); | 152 parsed_function.set_instantiator(NULL); |
153 parsed_function.set_default_parameter_values(default_parameter_values_); | 153 parsed_function.set_default_parameter_values(default_parameter_values_); |
154 parsed_function.AllocateVariables(); | 154 parsed_function.AllocateVariables(); |
155 bool retval; | 155 bool retval; |
156 Isolate* isolate = Isolate::Current(); | 156 Isolate* isolate = Isolate::Current(); |
157 EXPECT(isolate != NULL); | 157 EXPECT(isolate != NULL); |
158 LongJump* base = isolate->long_jump_base(); | 158 LongJump* base = isolate->long_jump_base(); |
159 LongJump jump; | 159 LongJump jump; |
160 isolate->set_long_jump_base(&jump); | 160 isolate->set_long_jump_base(&jump); |
161 if (setjmp(*jump.Set()) == 0) { | 161 if (setjmp(*jump.Set()) == 0) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 bool CompilerTest::TestCompileFunction(const Function& function) { | 194 bool CompilerTest::TestCompileFunction(const Function& function) { |
195 Isolate* isolate = Isolate::Current(); | 195 Isolate* isolate = Isolate::Current(); |
196 ASSERT(isolate != NULL); | 196 ASSERT(isolate != NULL); |
197 ASSERT(ClassFinalizer::AllClassesFinalized()); | 197 ASSERT(ClassFinalizer::AllClassesFinalized()); |
198 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 198 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
199 return error.IsNull(); | 199 return error.IsNull(); |
200 } | 200 } |
201 | 201 |
202 } // namespace dart | 202 } // namespace dart |
OLD | NEW |