| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // Eagerly compiles all functions in a class. | 142 // Eagerly compiles all functions in a class. |
| 143 // | 143 // |
| 144 // Returns Error::null() if there is no compilation error. | 144 // Returns Error::null() if there is no compilation error. |
| 145 static RawError* CompileAllFunctions(const Class& cls); | 145 static RawError* CompileAllFunctions(const Class& cls); |
| 146 | 146 |
| 147 // Notify the compiler that background (optimized) compilation has failed | 147 // Notify the compiler that background (optimized) compilation has failed |
| 148 // because the mutator thread changed the state (e.g., deoptimization, | 148 // because the mutator thread changed the state (e.g., deoptimization, |
| 149 // deferred loading). The background compilation may retry to compile | 149 // deferred loading). The background compilation may retry to compile |
| 150 // the same function later. | 150 // the same function later. |
| 151 static void AbortBackgroundCompilation(intptr_t deopt_id, | 151 static void AbortBackgroundCompilation(intptr_t deopt_id, const char* msg); |
| 152 const char* msg = ""); | |
| 153 }; | 152 }; |
| 154 | 153 |
| 155 | 154 |
| 156 // Class to run optimizing compilation in a background thread. | 155 // Class to run optimizing compilation in a background thread. |
| 157 // Current implementation: one task per isolate, it dies with the owning | 156 // Current implementation: one task per isolate, it dies with the owning |
| 158 // isolate. | 157 // isolate. |
| 159 // No OSR compilation in the background compiler. | 158 // No OSR compilation in the background compiler. |
| 160 class BackgroundCompiler : public ThreadPool::Task { | 159 class BackgroundCompiler : public ThreadPool::Task { |
| 161 public: | 160 public: |
| 162 virtual ~BackgroundCompiler(); | 161 virtual ~BackgroundCompiler(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 187 Monitor* done_monitor_; // Notify/wait that the thread is done. | 186 Monitor* done_monitor_; // Notify/wait that the thread is done. |
| 188 | 187 |
| 189 BackgroundCompilationQueue* function_queue_; | 188 BackgroundCompilationQueue* function_queue_; |
| 190 | 189 |
| 191 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); | 190 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); |
| 192 }; | 191 }; |
| 193 | 192 |
| 194 } // namespace dart | 193 } // namespace dart |
| 195 | 194 |
| 196 #endif // VM_COMPILER_H_ | 195 #endif // VM_COMPILER_H_ |
| OLD | NEW |