| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Generates local var descriptors and sets it in 'code'. Do not call if the | 87 // Generates local var descriptors and sets it in 'code'. Do not call if the |
| 88 // local var descriptor already exists. | 88 // local var descriptor already exists. |
| 89 static void ComputeLocalVarDescriptors(const Code& code); | 89 static void ComputeLocalVarDescriptors(const Code& code); |
| 90 | 90 |
| 91 // Eagerly compiles all functions in a class. | 91 // Eagerly compiles all functions in a class. |
| 92 // | 92 // |
| 93 // Returns Error::null() if there is no compilation error. | 93 // Returns Error::null() if there is no compilation error. |
| 94 static RawError* CompileAllFunctions(const Class& cls); | 94 static RawError* CompileAllFunctions(const Class& cls); |
| 95 | 95 |
| 96 static bool always_optimize(); | 96 static bool always_optimize(); |
| 97 |
| 98 // Notify the compiler that background (optimized) compilation has failed |
| 99 // because the mutator thread changed the state (e.g., deoptimization, |
| 100 // deferred loading). The background compilation may retry to compile |
| 101 // the same function later. |
| 102 static void AbortBackgroundCompilation(intptr_t deopt_id); |
| 97 }; | 103 }; |
| 98 | 104 |
| 99 | 105 |
| 100 // Class to run optimizing compilation in a background thread. | 106 // Class to run optimizing compilation in a background thread. |
| 101 // Current implementation: one task per isolate, it dies with the owning | 107 // Current implementation: one task per isolate, it dies with the owning |
| 102 // isolate. | 108 // isolate. |
| 103 // No OSR compilation in the background compiler. | 109 // No OSR compilation in the background compiler. |
| 104 class BackgroundCompiler : public ThreadPool::Task { | 110 class BackgroundCompiler : public ThreadPool::Task { |
| 105 public: | 111 public: |
| 106 static void EnsureInit(Thread* thread); | 112 static void EnsureInit(Thread* thread); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 127 Monitor* done_monitor_; // Notify/wait that the thread is done. | 133 Monitor* done_monitor_; // Notify/wait that the thread is done. |
| 128 | 134 |
| 129 BackgroundCompilationQueue* function_queue_; | 135 BackgroundCompilationQueue* function_queue_; |
| 130 | 136 |
| 131 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); | 137 DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler); |
| 132 }; | 138 }; |
| 133 | 139 |
| 134 } // namespace dart | 140 } // namespace dart |
| 135 | 141 |
| 136 #endif // VM_COMPILER_H_ | 142 #endif // VM_COMPILER_H_ |
| OLD | NEW |