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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 func.set_num_fixed_parameters(0); | 853 func.set_num_fixed_parameters(0); |
854 func.SetNumOptionalParameters(0, true); | 854 func.SetNumOptionalParameters(0, true); |
855 // Manually generated AST, do not recompile. | 855 // Manually generated AST, do not recompile. |
856 func.set_is_optimizable(false); | 856 func.set_is_optimizable(false); |
857 | 857 |
858 // We compile the function here, even though InvokeStatic() below | 858 // We compile the function here, even though InvokeStatic() below |
859 // would compile func automatically. We are checking fewer invariants | 859 // would compile func automatically. We are checking fewer invariants |
860 // here. | 860 // here. |
861 ParsedFunction* parsed_function = new ParsedFunction(func); | 861 ParsedFunction* parsed_function = new ParsedFunction(func); |
862 parsed_function->SetNodeSequence(fragment); | 862 parsed_function->SetNodeSequence(fragment); |
863 parsed_function->set_default_parameter_values(Array::ZoneHandle()); | 863 parsed_function->set_default_parameter_values(Object::null_array()); |
864 parsed_function->EnsureExpressionTemp(); | 864 parsed_function->EnsureExpressionTemp(); |
865 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); | 865 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); |
866 parsed_function->AllocateVariables(); | 866 parsed_function->AllocateVariables(); |
867 | 867 |
868 // Non-optimized code generator. | 868 // Non-optimized code generator. |
869 CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId); | 869 CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId); |
870 | 870 |
871 const Object& result = Object::Handle( | 871 const Object& result = Object::Handle( |
872 DartEntry::InvokeFunction(func, Object::empty_array())); | 872 DartEntry::InvokeFunction(func, Object::empty_array())); |
873 isolate->set_long_jump_base(base); | 873 isolate->set_long_jump_base(base); |
874 return result.raw(); | 874 return result.raw(); |
875 } else { | 875 } else { |
876 const Object& result = | 876 const Object& result = |
877 Object::Handle(isolate->object_store()->sticky_error()); | 877 Object::Handle(isolate->object_store()->sticky_error()); |
878 isolate->object_store()->clear_sticky_error(); | 878 isolate->object_store()->clear_sticky_error(); |
879 isolate->set_long_jump_base(base); | 879 isolate->set_long_jump_base(base); |
880 return result.raw(); | 880 return result.raw(); |
881 } | 881 } |
882 UNREACHABLE(); | 882 UNREACHABLE(); |
883 return Object::null(); | 883 return Object::null(); |
884 } | 884 } |
885 | 885 |
886 } // namespace dart | 886 } // namespace dart |
OLD | NEW |