| 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" | |
| 10 #include "src/objects.h" | 9 #include "src/objects.h" |
| 11 | 10 |
| 12 namespace v8 { | 11 namespace v8 { |
| 13 namespace internal { | 12 namespace internal { |
| 14 | 13 |
| 14 template <typename T> |
| 15 class Handle; |
| 16 |
| 15 // The compilation cache consists of several generational sub-caches which uses | 17 // The compilation cache consists of several generational sub-caches which uses |
| 16 // this class as a base class. A sub-cache contains a compilation cache tables | 18 // this class as a base class. A sub-cache contains a compilation cache tables |
| 17 // for each generation of the sub-cache. Since the same source code string has | 19 // for each generation of the sub-cache. Since the same source code string has |
| 18 // different compiled code for scripts and evals, we use separate sub-caches | 20 // different compiled code for scripts and evals, we use separate sub-caches |
| 19 // for different compilation modes, to avoid retrieving the wrong result. | 21 // for different compilation modes, to avoid retrieving the wrong result. |
| 20 class CompilationSubCache { | 22 class CompilationSubCache { |
| 21 public: | 23 public: |
| 22 CompilationSubCache(Isolate* isolate, int generations) | 24 CompilationSubCache(Isolate* isolate, int generations) |
| 23 : isolate_(isolate), | 25 : isolate_(isolate), |
| 24 generations_(generations) { | 26 generations_(generations) { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 friend class Isolate; | 235 friend class Isolate; |
| 234 | 236 |
| 235 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 237 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
| 236 }; | 238 }; |
| 237 | 239 |
| 238 | 240 |
| 239 } // namespace internal | 241 } // namespace internal |
| 240 } // namespace v8 | 242 } // namespace v8 |
| 241 | 243 |
| 242 #endif // V8_COMPILATION_CACHE_H_ | 244 #endif // V8_COMPILATION_CACHE_H_ |
| OLD | NEW |