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/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_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 AstPrinter::PrintNode(fragment); | 441 AstPrinter::PrintNode(fragment); |
442 } | 442 } |
443 | 443 |
444 // Create a dummy function object for the code generator. | 444 // Create a dummy function object for the code generator. |
445 const char* kEvalConst = "eval_const"; | 445 const char* kEvalConst = "eval_const"; |
446 const Function& func = Function::Handle(Function::New( | 446 const Function& func = Function::Handle(Function::New( |
447 String::Handle(Symbols::New(kEvalConst)), | 447 String::Handle(Symbols::New(kEvalConst)), |
448 RawFunction::kConstImplicitGetter, | 448 RawFunction::kConstImplicitGetter, |
449 true, // static function. | 449 true, // static function. |
450 false, // not const function. | 450 false, // not const function. |
| 451 false, // not external. |
451 fragment->token_pos())); | 452 fragment->token_pos())); |
452 | 453 |
453 func.set_result_type(Type::Handle(Type::DynamicType())); | 454 func.set_result_type(Type::Handle(Type::DynamicType())); |
454 func.set_num_fixed_parameters(0); | 455 func.set_num_fixed_parameters(0); |
455 func.set_num_optional_parameters(0); | 456 func.set_num_optional_parameters(0); |
456 | 457 |
457 // The function needs to be associated with a named Class: the interface | 458 // The function needs to be associated with a named Class: the interface |
458 // Function fits the bill. | 459 // Function fits the bill. |
459 func.set_owner(Class::Handle( | 460 func.set_owner(Class::Handle( |
460 Type::Handle(Type::FunctionInterface()).type_class())); | 461 Type::Handle(Type::FunctionInterface()).type_class())); |
(...skipping 26 matching lines...) Expand all Loading... |
487 isolate->object_store()->clear_sticky_error(); | 488 isolate->object_store()->clear_sticky_error(); |
488 isolate->set_long_jump_base(base); | 489 isolate->set_long_jump_base(base); |
489 return result.raw(); | 490 return result.raw(); |
490 } | 491 } |
491 UNREACHABLE(); | 492 UNREACHABLE(); |
492 return Object::null(); | 493 return Object::null(); |
493 } | 494 } |
494 | 495 |
495 | 496 |
496 } // namespace dart | 497 } // namespace dart |
OLD | NEW |