| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILATION_CACHE_H_ | 5 #ifndef V8_COMPILATION_CACHE_H_ |
| 6 #define V8_COMPILATION_CACHE_H_ | 6 #define V8_COMPILATION_CACHE_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 // Enable/disable compilation cache. Used by debugger to disable compilation | 204 // Enable/disable compilation cache. Used by debugger to disable compilation |
| 205 // cache during debugging to make sure new scripts are always compiled. | 205 // cache during debugging to make sure new scripts are always compiled. |
| 206 void Enable(); | 206 void Enable(); |
| 207 void Disable(); | 207 void Disable(); |
| 208 | 208 |
| 209 private: | 209 private: |
| 210 explicit CompilationCache(Isolate* isolate); | 210 explicit CompilationCache(Isolate* isolate); |
| 211 ~CompilationCache(); | 211 ~CompilationCache(); |
| 212 | 212 |
| 213 HashMap* EagerOptimizingSet(); | 213 base::HashMap* EagerOptimizingSet(); |
| 214 | 214 |
| 215 // The number of sub caches covering the different types to cache. | 215 // The number of sub caches covering the different types to cache. |
| 216 static const int kSubCacheCount = 4; | 216 static const int kSubCacheCount = 4; |
| 217 | 217 |
| 218 bool IsEnabled() { return FLAG_compilation_cache && enabled_; } | 218 bool IsEnabled() { return FLAG_compilation_cache && enabled_; } |
| 219 | 219 |
| 220 Isolate* isolate() { return isolate_; } | 220 Isolate* isolate() { return isolate_; } |
| 221 | 221 |
| 222 Isolate* isolate_; | 222 Isolate* isolate_; |
| 223 | 223 |
| 224 CompilationCacheScript script_; | 224 CompilationCacheScript script_; |
| 225 CompilationCacheEval eval_global_; | 225 CompilationCacheEval eval_global_; |
| 226 CompilationCacheEval eval_contextual_; | 226 CompilationCacheEval eval_contextual_; |
| 227 CompilationCacheRegExp reg_exp_; | 227 CompilationCacheRegExp reg_exp_; |
| 228 CompilationSubCache* subcaches_[kSubCacheCount]; | 228 CompilationSubCache* subcaches_[kSubCacheCount]; |
| 229 | 229 |
| 230 // Current enable state of the compilation cache. | 230 // Current enable state of the compilation cache. |
| 231 bool enabled_; | 231 bool enabled_; |
| 232 | 232 |
| 233 friend class Isolate; | 233 friend class Isolate; |
| 234 | 234 |
| 235 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 235 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 | 238 |
| 239 } // namespace internal | 239 } // namespace internal |
| 240 } // namespace v8 | 240 } // namespace v8 |
| 241 | 241 |
| 242 #endif // V8_COMPILATION_CACHE_H_ | 242 #endif // V8_COMPILATION_CACHE_H_ |
| OLD | NEW |