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

Unified Diff: src/heap.cc

Issue 1933: Generalized the EvalCache into a CompilationCache and enabled... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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
« src/compilation-cache.h ('K') | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« src/compilation-cache.h ('K') | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698