| 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 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 | 618 |
| 619 // We compile the function here, even though InvokeStatic() below | 619 // We compile the function here, even though InvokeStatic() below |
| 620 // would compile func automatically. We are checking fewer invariants | 620 // would compile func automatically. We are checking fewer invariants |
| 621 // here. | 621 // here. |
| 622 ParsedFunction* parsed_function = new ParsedFunction(func); | 622 ParsedFunction* parsed_function = new ParsedFunction(func); |
| 623 parsed_function->SetNodeSequence(fragment); | 623 parsed_function->SetNodeSequence(fragment); |
| 624 parsed_function->set_default_parameter_values(Array::ZoneHandle()); | 624 parsed_function->set_default_parameter_values(Array::ZoneHandle()); |
| 625 parsed_function->set_expression_temp_var( | 625 parsed_function->set_expression_temp_var( |
| 626 ParsedFunction::CreateExpressionTempVar(0)); | 626 ParsedFunction::CreateExpressionTempVar(0)); |
| 627 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); | 627 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); |
| 628 parsed_function->set_array_literal_var( |
| 629 ParsedFunction::CreateArrayLiteralVar(0)); |
| 630 fragment->scope()->AddVariable(parsed_function->array_literal_var()); |
| 628 parsed_function->AllocateVariables(); | 631 parsed_function->AllocateVariables(); |
| 629 | 632 |
| 630 // Non-optimized code generator. | 633 // Non-optimized code generator. |
| 631 CompileParsedFunctionHelper(*parsed_function, false); | 634 CompileParsedFunctionHelper(*parsed_function, false); |
| 632 | 635 |
| 633 const Object& result = Object::Handle( | 636 const Object& result = Object::Handle( |
| 634 DartEntry::InvokeStatic(func, Object::empty_array())); | 637 DartEntry::InvokeStatic(func, Object::empty_array())); |
| 635 isolate->set_long_jump_base(base); | 638 isolate->set_long_jump_base(base); |
| 636 return result.raw(); | 639 return result.raw(); |
| 637 } else { | 640 } else { |
| 638 const Object& result = | 641 const Object& result = |
| 639 Object::Handle(isolate->object_store()->sticky_error()); | 642 Object::Handle(isolate->object_store()->sticky_error()); |
| 640 isolate->object_store()->clear_sticky_error(); | 643 isolate->object_store()->clear_sticky_error(); |
| 641 isolate->set_long_jump_base(base); | 644 isolate->set_long_jump_base(base); |
| 642 return result.raw(); | 645 return result.raw(); |
| 643 } | 646 } |
| 644 UNREACHABLE(); | 647 UNREACHABLE(); |
| 645 return Object::null(); | 648 return Object::null(); |
| 646 } | 649 } |
| 647 | 650 |
| 648 } // namespace dart | 651 } // namespace dart |
| OLD | NEW |