| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Extracts function and field symbols from the class and populates | 93 // Extracts function and field symbols from the class and populates |
| 94 // the class. | 94 // the class. |
| 95 // | 95 // |
| 96 // Returns Error::null() if there is no compilation error. | 96 // Returns Error::null() if there is no compilation error. |
| 97 static RawError* CompileClass(const Class& cls); | 97 static RawError* CompileClass(const Class& cls); |
| 98 | 98 |
| 99 // Generates code for given function and sets its code field. | 99 // Generates code for given function and sets its code field. |
| 100 // | 100 // |
| 101 // Returns Error::null() if there is no compilation error. | 101 // Returns Error::null() if there is no compilation error. |
| 102 static RawError* CompileFunction(Thread* thread, const Function& function); | 102 static RawError* CompileFunction(Thread* thread, const Function& function); |
| 103 static RawError* ParseFunction(Thread* thread, const Function& function); |
| 103 | 104 |
| 104 // Generates unoptimized code if not present, current code is unchanged. | 105 // Generates unoptimized code if not present, current code is unchanged. |
| 105 static RawError* EnsureUnoptimizedCode(Thread* thread, | 106 static RawError* EnsureUnoptimizedCode(Thread* thread, |
| 106 const Function& function); | 107 const Function& function); |
| 107 | 108 |
| 108 // Generates optimized code for function. | 109 // Generates optimized code for function. |
| 109 // | 110 // |
| 110 // Returns Error::null() if there is no compilation error. | 111 // Returns Error::null() if there is no compilation error. |
| 111 // If 'result_code' is not NULL, then the generated code is returned but | 112 // If 'result_code' is not NULL, then the generated code is returned but |
| 112 // not installed. | 113 // not installed. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 136 static RawObject* EvaluateStaticInitializer(const Field& field); | 137 static RawObject* EvaluateStaticInitializer(const Field& field); |
| 137 | 138 |
| 138 // Generates local var descriptors and sets it in 'code'. Do not call if the | 139 // Generates local var descriptors and sets it in 'code'. Do not call if the |
| 139 // local var descriptor already exists. | 140 // local var descriptor already exists. |
| 140 static void ComputeLocalVarDescriptors(const Code& code); | 141 static void ComputeLocalVarDescriptors(const Code& code); |
| 141 | 142 |
| 142 // Eagerly compiles all functions in a class. | 143 // Eagerly compiles all functions in a class. |
| 143 // | 144 // |
| 144 // Returns Error::null() if there is no compilation error. | 145 // Returns Error::null() if there is no compilation error. |
| 145 static RawError* CompileAllFunctions(const Class& cls); | 146 static RawError* CompileAllFunctions(const Class& cls); |
| 147 static RawError* ParseAllFunctions(const Class& cls); |
| 146 | 148 |
| 147 // Notify the compiler that background (optimized) compilation has failed | 149 // Notify the compiler that background (optimized) compilation has failed |
| 148 // because the mutator thread changed the state (e.g., deoptimization, | 150 // because the mutator thread changed the state (e.g., deoptimization, |
| 149 // deferred loading). The background compilation may retry to compile | 151 // deferred loading). The background compilation may retry to compile |
| 150 // the same function later. | 152 // the same function later. |
| 151 static void AbortBackgroundCompilation(intptr_t deopt_id, const char* msg); | 153 static void AbortBackgroundCompilation(intptr_t deopt_id, const char* msg); |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 | 156 |
| 155 // Class to run optimizing compilation in a background thread. | 157 // Class to run optimizing compilation in a background thread. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 Monitor* done_monitor_; // Notify/wait that the thread is done. | 195 Monitor* done_monitor_; // Notify/wait that the thread is done. |
| 194 | 196 |
| 195 BackgroundCompilationQueue* function_queue_; | 197 BackgroundCompilationQueue* function_queue_; |
| 196 | 198 |
| 197 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); | 199 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 } // namespace dart | 202 } // namespace dart |
| 201 | 203 |
| 202 #endif // VM_COMPILER_H_ | 204 #endif // VM_COMPILER_H_ |
| OLD | NEW |