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/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 func.SetNumOptionalParameters(0, true); | 1042 func.SetNumOptionalParameters(0, true); |
1043 // Manually generated AST, do not recompile. | 1043 // Manually generated AST, do not recompile. |
1044 func.SetIsOptimizable(false); | 1044 func.SetIsOptimizable(false); |
1045 | 1045 |
1046 // We compile the function here, even though InvokeFunction() below | 1046 // We compile the function here, even though InvokeFunction() below |
1047 // would compile func automatically. We are checking fewer invariants | 1047 // would compile func automatically. We are checking fewer invariants |
1048 // here. | 1048 // here. |
1049 ParsedFunction* parsed_function = new ParsedFunction(isolate, func); | 1049 ParsedFunction* parsed_function = new ParsedFunction(isolate, func); |
1050 parsed_function->SetNodeSequence(fragment); | 1050 parsed_function->SetNodeSequence(fragment); |
1051 parsed_function->set_default_parameter_values(Object::null_array()); | 1051 parsed_function->set_default_parameter_values(Object::null_array()); |
1052 parsed_function->EnsureExpressionTemp(); | 1052 fragment->scope()->AddVariable(parsed_function->EnsureExpressionTemp()); |
1053 fragment->scope()->AddVariable(parsed_function->expression_temp_var()); | 1053 fragment->scope()->AddVariable( |
| 1054 parsed_function->current_context_var()); |
1054 parsed_function->AllocateVariables(); | 1055 parsed_function->AllocateVariables(); |
1055 | 1056 |
1056 // Non-optimized code generator. | 1057 // Non-optimized code generator. |
1057 CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId); | 1058 CompileParsedFunctionHelper(parsed_function, false, Isolate::kNoDeoptId); |
1058 | 1059 |
1059 const Object& result = PassiveObject::Handle( | 1060 const Object& result = PassiveObject::Handle( |
1060 DartEntry::InvokeFunction(func, Object::empty_array())); | 1061 DartEntry::InvokeFunction(func, Object::empty_array())); |
1061 return result.raw(); | 1062 return result.raw(); |
1062 } else { | 1063 } else { |
1063 const Object& result = | 1064 const Object& result = |
1064 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1065 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
1065 isolate->object_store()->clear_sticky_error(); | 1066 isolate->object_store()->clear_sticky_error(); |
1066 return result.raw(); | 1067 return result.raw(); |
1067 } | 1068 } |
1068 UNREACHABLE(); | 1069 UNREACHABLE(); |
1069 return Object::null(); | 1070 return Object::null(); |
1070 } | 1071 } |
1071 | 1072 |
1072 } // namespace dart | 1073 } // namespace dart |
OLD | NEW |