| Index: src/heap.cc
|
| ===================================================================
|
| --- src/heap.cc (revision 268)
|
| +++ src/heap.cc (working copy)
|
| @@ -31,6 +31,7 @@
|
| #include "api.h"
|
| #include "bootstrapper.h"
|
| #include "codegen-inl.h"
|
| +#include "compilation-cache.h"
|
| #include "debug.h"
|
| #include "global-handles.h"
|
| #include "jsregexp.h"
|
| @@ -447,10 +448,7 @@
|
|
|
|
|
| void Heap::MarkCompactPrologue() {
|
| - // Empty eval caches
|
| - Heap::eval_cache_global_ = Heap::null_value();
|
| - Heap::eval_cache_non_global_ = Heap::null_value();
|
| -
|
| + CompilationCache::MarkCompactPrologue();
|
| RegExpImpl::OldSpaceCollectionPrologue();
|
| Top::MarkCompactPrologue();
|
| ThreadManager::MarkCompactPrologue();
|
| @@ -1208,9 +1206,8 @@
|
| if (obj->IsFailure()) return false;
|
| natives_source_cache_ = FixedArray::cast(obj);
|
|
|
| - // Initialized eval cache to null value.
|
| - eval_cache_global_ = null_value();
|
| - eval_cache_non_global_ = null_value();
|
| + // Initialize compilation cache.
|
| + CompilationCache::Clear();
|
|
|
| return true;
|
| }
|
| @@ -2279,34 +2276,6 @@
|
| }
|
|
|
|
|
| -Object* Heap::LookupEvalCache(bool is_global_context, String* src) {
|
| - Object* cache = is_global_context ?
|
| - eval_cache_global_ : eval_cache_non_global_;
|
| - return cache == null_value() ?
|
| - null_value() : EvalCache::cast(cache)->Lookup(src);
|
| -}
|
| -
|
| -
|
| -Object* Heap::PutInEvalCache(bool is_global_context, String* src,
|
| - JSFunction* value) {
|
| - Object** cache_ptr = is_global_context ?
|
| - &eval_cache_global_ : &eval_cache_non_global_;
|
| -
|
| - if (*cache_ptr == null_value()) {
|
| - Object* obj = EvalCache::Allocate(kInitialEvalCacheSize);
|
| - if (obj->IsFailure()) return false;
|
| - *cache_ptr = obj;
|
| - }
|
| -
|
| - Object* new_cache =
|
| - EvalCache::cast(*cache_ptr)->Put(src, value);
|
| - if (new_cache->IsFailure()) return new_cache;
|
| - *cache_ptr = new_cache;
|
| -
|
| - return value;
|
| -}
|
| -
|
| -
|
| #ifdef DEBUG
|
| void Heap::ZapFromSpace() {
|
| ASSERT(HAS_HEAP_OBJECT_TAG(kFromSpaceZapValue));
|
| @@ -2417,6 +2386,8 @@
|
| SYNCHRONIZE_TAG("top");
|
| Debug::Iterate(v);
|
| SYNCHRONIZE_TAG("debug");
|
| + CompilationCache::Iterate(v);
|
| + SYNCHRONIZE_TAG("compilationcache");
|
|
|
| // Iterate over local handles in handle scopes.
|
| HandleScopeImplementer::Iterate(v);
|
|
|