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

Unified Diff: src/compilation-cache.h

Issue 140056: Add generations to the compilation cache for eval and regexp (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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 | « no previous file | src/compilation-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-cache.h
===================================================================
--- src/compilation-cache.h (revision 2231)
+++ src/compilation-cache.h (working copy)
@@ -34,20 +34,9 @@
// The compilation cache keeps function boilerplates for compiled
// scripts and evals. The boilerplates are looked up using the source
-// string as the key.
+// string as the key. For regular expressions the compilation data is cached.
class CompilationCache {
public:
- // The same source code string has different compiled code for
- // scripts and evals. Internally, we use separate caches to avoid
- // getting the wrong kind of entry when looking up.
- enum Entry {
- EVAL_GLOBAL,
- EVAL_CONTEXTUAL,
- REGEXP,
- SCRIPT,
- LAST_ENTRY = SCRIPT
- };
-
// Finds the script function boilerplate for a source
// string. Returns an empty handle if the cache doesn't contain a
// script for the given source string with the right origin.
@@ -61,7 +50,7 @@
// contain a script for the given source string.
static Handle<JSFunction> LookupEval(Handle<String> source,
Handle<Context> context,
- Entry entry);
+ bool is_global);
// Returns the regexp data associated with the given regexp if it
// is in cache, otherwise an empty handle.
@@ -77,7 +66,7 @@
// with the boilerplate. This may overwrite an existing mapping.
static void PutEval(Handle<String> source,
Handle<Context> context,
- Entry entry,
+ bool is_global,
Handle<JSFunction> boilerplate);
// Associate the (source, flags) pair to the given regexp data.
« no previous file with comments | « no previous file | src/compilation-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698