| 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 #ifndef VM_COMPILER_H_ | 5 #ifndef VM_COMPILER_H_ |
| 6 #define VM_COMPILER_H_ | 6 #define VM_COMPILER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Generates optimized code for function. | 44 // Generates optimized code for function. |
| 45 // | 45 // |
| 46 // Returns Error::null() if there is no compilation error. | 46 // Returns Error::null() if there is no compilation error. |
| 47 static RawError* CompileOptimizedFunction(const Function& function); | 47 static RawError* CompileOptimizedFunction(const Function& function); |
| 48 | 48 |
| 49 // Generates code for given parsed function (without parsing it again) and | 49 // Generates code for given parsed function (without parsing it again) and |
| 50 // sets its code field. | 50 // sets its code field. |
| 51 // | 51 // |
| 52 // Returns Error::null() if there is no compilation error. | 52 // Returns Error::null() if there is no compilation error. |
| 53 static RawError* CompileParsedFunction(const ParsedFunction& parsed_function); | 53 static RawError* CompileParsedFunction(ParsedFunction* parsed_function); |
| 54 | 54 |
| 55 // Generates and executes code for a given code fragment, e.g. a | 55 // Generates and executes code for a given code fragment, e.g. a |
| 56 // compile time constant expression. Returns the result returned | 56 // compile time constant expression. Returns the result returned |
| 57 // by the fragment. | 57 // by the fragment. |
| 58 // | 58 // |
| 59 // The return value is either a RawInstance on success or a RawError | 59 // The return value is either a RawInstance on success or a RawError |
| 60 // on compilation failure. | 60 // on compilation failure. |
| 61 static RawObject* ExecuteOnce(SequenceNode* fragment); | 61 static RawObject* ExecuteOnce(SequenceNode* fragment); |
| 62 | 62 |
| 63 // Eagerly compiles all functions in a class. | 63 // Eagerly compiles all functions in a class. |
| 64 // | 64 // |
| 65 // Returns Error::null() if there is no compilation error. | 65 // Returns Error::null() if there is no compilation error. |
| 66 static RawError* CompileAllFunctions(const Class& cls); | 66 static RawError* CompileAllFunctions(const Class& cls); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace dart | 69 } // namespace dart |
| 70 | 70 |
| 71 #endif // VM_COMPILER_H_ | 71 #endif // VM_COMPILER_H_ |
| OLD | NEW |