| Index: src/compilation-cache.h
|
| ===================================================================
|
| --- src/compilation-cache.h (revision 12582)
|
| +++ src/compilation-cache.h (working copy)
|
| @@ -44,7 +44,7 @@
|
| tables_ = NewArray<Object*>(generations);
|
| }
|
|
|
| - ~CompilationSubCache() { DeleteArray(tables_); }
|
| + virtual ~CompilationSubCache() { DeleteArray(tables_); }
|
|
|
| // Index for the first generation in the cache.
|
| static const int kFirstGeneration = 0;
|
| @@ -66,14 +66,17 @@
|
| void Age();
|
|
|
| // GC support.
|
| - void Iterate(ObjectVisitor* v);
|
| - void IterateFunctions(ObjectVisitor* v);
|
| + virtual void Iterate(ObjectVisitor* v);
|
| + virtual void IterateFunctions(ObjectVisitor* v);
|
|
|
| // Clear this sub-cache evicting all its content.
|
| - void Clear();
|
| + virtual void Clear();
|
| + // Clear out any short term elements. Returns true if the cache is
|
| + // already cleared.
|
| + virtual bool ClearShortTerm() { return true; }
|
|
|
| // Remove given shared function info from sub-cache.
|
| - void Remove(Handle<SharedFunctionInfo> function_info);
|
| + virtual void Remove(Handle<SharedFunctionInfo> function_info);
|
|
|
| // Number of generations in this sub-cache.
|
| inline int generations() { return generations_; }
|
| @@ -144,7 +147,8 @@
|
| class CompilationCacheEval: public CompilationSubCache {
|
| public:
|
| CompilationCacheEval(Isolate* isolate, int generations)
|
| - : CompilationSubCache(isolate, generations) { }
|
| + : CompilationSubCache(isolate, generations),
|
| + json_table_(NULL) { }
|
|
|
| Handle<SharedFunctionInfo> Lookup(Handle<String> source,
|
| Handle<Context> context,
|
| @@ -156,6 +160,17 @@
|
| Handle<SharedFunctionInfo> function_info,
|
| int scope_position);
|
|
|
| + virtual void Iterate(ObjectVisitor* v);
|
| + virtual void IterateFunctions(ObjectVisitor* v);
|
| + virtual void Clear();
|
| + virtual bool ClearShortTerm();
|
| + virtual void Remove(Handle<SharedFunctionInfo> function_info);
|
| +
|
| + void GetShortTermStatistics(int* entry_count,
|
| + int* max_entries,
|
| + int* total_size,
|
| + int* max_total_size);
|
| +
|
| private:
|
| MUST_USE_RESULT MaybeObject* TryTablePut(
|
| Handle<String> source,
|
| @@ -164,12 +179,14 @@
|
| int scope_position);
|
|
|
| // Note: Returns a new hash table if operation results in expansion.
|
| - Handle<CompilationCacheTable> TablePut(
|
| + void TablePut(
|
| Handle<String> source,
|
| Handle<Context> context,
|
| Handle<SharedFunctionInfo> function_info,
|
| int scope_position);
|
|
|
| + Object* json_table_;
|
| +
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheEval);
|
| };
|
|
|
| @@ -249,7 +266,9 @@
|
| Handle<FixedArray> data);
|
|
|
| // Clear the cache - also used to initialize the cache at startup.
|
| - void Clear();
|
| + virtual void Clear();
|
| + // Clear any short term elements. Returns true if the cache is already clear.
|
| + virtual bool ClearShortTerm();
|
|
|
| // Remove given shared function info from all caches.
|
| void Remove(Handle<SharedFunctionInfo> function_info);
|
| @@ -268,9 +287,14 @@
|
| void Enable();
|
| void Disable();
|
|
|
| + void GetShortTermEvalStatistics(int* entry_count,
|
| + int* max_entries,
|
| + int* total_size,
|
| + int* max_total_size);
|
| +
|
| private:
|
| explicit CompilationCache(Isolate* isolate);
|
| - ~CompilationCache();
|
| + virtual ~CompilationCache();
|
|
|
| HashMap* EagerOptimizingSet();
|
|
|
|
|