Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: src/compilation-cache.h

Issue 10990076: Short term JSON eval cache Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | src/compilation-cache.cc » ('j') | src/v8.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « AUTHORS ('k') | src/compilation-cache.cc » ('j') | src/v8.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698