| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_index_table.h" | 10 #include "vm/code_index_table.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 // Create a dummy function object for the code generator. | 219 // Create a dummy function object for the code generator. |
| 220 const char* kEvalConst = "eval_const"; | 220 const char* kEvalConst = "eval_const"; |
| 221 const Function& func = Function::Handle(Function::New( | 221 const Function& func = Function::Handle(Function::New( |
| 222 String::Handle(String::NewSymbol(kEvalConst)), | 222 String::Handle(String::NewSymbol(kEvalConst)), |
| 223 RawFunction::kConstImplicitGetter, | 223 RawFunction::kConstImplicitGetter, |
| 224 true, // static function. | 224 true, // static function. |
| 225 false, // not const function. | 225 false, // not const function. |
| 226 fragment->token_index())); | 226 fragment->token_index())); |
| 227 | 227 |
| 228 func.set_result_type(Type::Handle(Type::VarType())); | 228 func.set_result_type(Type::Handle(Type::DynamicType())); |
| 229 func.set_num_fixed_parameters(0); | 229 func.set_num_fixed_parameters(0); |
| 230 func.set_num_optional_parameters(0); | 230 func.set_num_optional_parameters(0); |
| 231 | 231 |
| 232 // The function needs to be associated with a named Class: the interface | 232 // The function needs to be associated with a named Class: the interface |
| 233 // Function fits the bill. | 233 // Function fits the bill. |
| 234 func.set_owner(Class::Handle( | 234 func.set_owner(Class::Handle( |
| 235 Type::Handle(Type::FunctionInterface()).type_class())); | 235 Type::Handle(Type::FunctionInterface()).type_class())); |
| 236 | 236 |
| 237 // We compile the function here, even though InvokeStatic() below | 237 // We compile the function here, even though InvokeStatic() below |
| 238 // would compile func automatically. We are checking fewer invariants | 238 // would compile func automatically. We are checking fewer invariants |
| (...skipping 25 matching lines...) Expand all Loading... |
| 264 kNoArgumentNames)); | 264 kNoArgumentNames)); |
| 265 if (result.IsUnhandledException()) { | 265 if (result.IsUnhandledException()) { |
| 266 // TODO(srdjan): implement proper exit from compiler. | 266 // TODO(srdjan): implement proper exit from compiler. |
| 267 UNIMPLEMENTED(); | 267 UNIMPLEMENTED(); |
| 268 } | 268 } |
| 269 return result.raw(); | 269 return result.raw(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 | 272 |
| 273 } // namespace dart | 273 } // namespace dart |
| OLD | NEW |