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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 Disassembler::Disassemble(start, start + assembler_->CodeSize()); | 215 Disassembler::Disassemble(start, start + assembler_->CodeSize()); |
216 OS::Print("}\n"); | 216 OS::Print("}\n"); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 | 220 |
221 CodeGenTest::CodeGenTest(const char* name) | 221 CodeGenTest::CodeGenTest(const char* name) |
222 : function_(Function::ZoneHandle()), | 222 : function_(Function::ZoneHandle()), |
223 node_sequence_(new SequenceNode(Scanner::kNoSourcePos, | 223 node_sequence_(new SequenceNode(Scanner::kNoSourcePos, |
224 new LocalScope(NULL, 0, 0))), | 224 new LocalScope(NULL, 0, 0))), |
225 default_parameter_values_(Array::ZoneHandle()) { | 225 default_parameter_values_(new ZoneGrowableArray<const Instance*> ()) { |
226 ASSERT(name != NULL); | 226 ASSERT(name != NULL); |
227 const String& function_name = String::ZoneHandle(Symbols::New(name)); | 227 const String& function_name = String::ZoneHandle(Symbols::New(name)); |
228 // Add function to a class and that class to the class dictionary so that | 228 // Add function to a class and that class to the class dictionary so that |
229 // frame walking can be used. | 229 // frame walking can be used. |
230 const Class& cls = Class::ZoneHandle( | 230 const Class& cls = Class::ZoneHandle( |
231 Class::New(function_name, Script::Handle(), Scanner::kNoSourcePos)); | 231 Class::New(function_name, Script::Handle(), Scanner::kNoSourcePos)); |
232 function_ = Function::New( | 232 function_ = Function::New( |
233 function_name, RawFunction::kRegularFunction, | 233 function_name, RawFunction::kRegularFunction, |
234 true, false, false, false, false, cls, 0); | 234 true, false, false, false, false, cls, 0); |
235 function_.set_result_type(Type::Handle(Type::DynamicType())); | 235 function_.set_result_type(Type::Handle(Type::DynamicType())); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 Thread* thread = Thread::Current(); | 276 Thread* thread = Thread::Current(); |
277 ASSERT(thread != NULL); | 277 ASSERT(thread != NULL); |
278 ASSERT(ClassFinalizer::AllClassesFinalized()); | 278 ASSERT(ClassFinalizer::AllClassesFinalized()); |
279 const Error& error = Error::Handle(Compiler::CompileFunction(thread, | 279 const Error& error = Error::Handle(Compiler::CompileFunction(thread, |
280 function)); | 280 function)); |
281 return error.IsNull(); | 281 return error.IsNull(); |
282 } | 282 } |
283 | 283 |
284 | 284 |
285 } // namespace dart | 285 } // namespace dart |
OLD | NEW |