Chromium Code Reviews| Index: src/compilation-cache.cc |
| diff --git a/src/compilation-cache.cc b/src/compilation-cache.cc |
| index 5bd8bf31c84695c2d38c4a59274588af8ac5af33..28e833a4933e1457a5f08ac8132338aef82c7938 100644 |
| --- a/src/compilation-cache.cc |
| +++ b/src/compilation-cache.cc |
| @@ -52,8 +52,7 @@ CompilationCache::CompilationCache(Isolate* isolate) |
| eval_global_(isolate, kEvalGlobalGenerations), |
| eval_contextual_(isolate, kEvalContextualGenerations), |
| reg_exp_(isolate, kRegExpGenerations), |
| - enabled_(true), |
| - eager_optimizing_set_(NULL) { |
| + enabled_(true) { |
| CompilationSubCache* subcaches[kSubCacheCount] = |
| {&script_, &eval_global_, &eval_contextual_, ®_exp_}; |
| for (int i = 0; i < kSubCacheCount; ++i) { |
| @@ -62,10 +61,7 @@ CompilationCache::CompilationCache(Isolate* isolate) |
| } |
| -CompilationCache::~CompilationCache() { |
| - delete eager_optimizing_set_; |
| - eager_optimizing_set_ = NULL; |
| -} |
| +CompilationCache::~CompilationCache() {} |
| static Handle<CompilationCacheTable> AllocateTable(Isolate* isolate, int size) { |
| @@ -457,47 +453,6 @@ void CompilationCache::PutRegExp(Handle<String> source, |
| } |
| -static bool SourceHashCompare(void* key1, void* key2) { |
| - return key1 == key2; |
| -} |
| - |
| - |
| -HashMap* CompilationCache::EagerOptimizingSet() { |
| - if (eager_optimizing_set_ == NULL) { |
| - eager_optimizing_set_ = new HashMap(&SourceHashCompare); |
| - } |
| - return eager_optimizing_set_; |
| -} |
| - |
| - |
| -bool CompilationCache::ShouldOptimizeEagerly(Handle<JSFunction> function) { |
| - if (FLAG_opt_eagerly) return true; |
| - uint32_t hash = function->SourceHash(); |
| - void* key = reinterpret_cast<void*>(hash); |
| - return EagerOptimizingSet()->Lookup(key, hash, false) != NULL; |
| -} |
| - |
| - |
| -void CompilationCache::MarkForEagerOptimizing(Handle<JSFunction> function) { |
| - uint32_t hash = function->SourceHash(); |
|
Kasper Lund
2011/06/28 13:49:45
It would be nice if you could get rid of JSFunctio
Vitaly Repeshko
2011/06/29 15:10:33
Removed.
|
| - void* key = reinterpret_cast<void*>(hash); |
| - EagerOptimizingSet()->Lookup(key, hash, true); |
| -} |
| - |
| - |
| -void CompilationCache::MarkForLazyOptimizing(Handle<JSFunction> function) { |
| - uint32_t hash = function->SourceHash(); |
| - void* key = reinterpret_cast<void*>(hash); |
| - EagerOptimizingSet()->Remove(key, hash); |
| -} |
| - |
| - |
| -void CompilationCache::ResetEagerOptimizingData() { |
| - HashMap* set = EagerOptimizingSet(); |
| - if (set->occupancy() > 0) set->Clear(); |
| -} |
| - |
| - |
| void CompilationCache::Clear() { |
| for (int i = 0; i < kSubCacheCount; i++) { |
| subcaches_[i]->Clear(); |