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

Unified Diff: src/compilation-cache.cc

Issue 8104: Regexp caching (Closed)
Patch Set: Created 12 years, 2 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
Index: src/compilation-cache.cc
diff --git a/src/compilation-cache.cc b/src/compilation-cache.cc
index 48b2870223208ea80e8d602d620b9136891c400c..3e1beb34c4ed637f19ea1cb43343d588e56d944c 100644
--- a/src/compilation-cache.cc
+++ b/src/compilation-cache.cc
@@ -32,7 +32,7 @@
namespace v8 { namespace internal {
enum {
- NUMBER_OF_ENTRY_KINDS = CompilationCache::EVAL_CONTEXTUAL + 1
+ NUMBER_OF_ENTRY_KINDS = CompilationCache::_LAST_ENTRY
Kasper Lund 2008/10/24 06:42:50 LAST_ENTRY + 1
};
@@ -142,6 +142,22 @@ void CompilationCache::Associate(Handle<String> source,
}
+Handle<Object> CompilationCache::LookupRegExp(Handle<String> source,
+ int flags) {
+ Handle<CompilationCacheTable> table = GetTable(REGEXP);
Kasper Lund 2008/10/24 06:42:50 Shouldn't this be tracking compilation cache misse
Kasper Lund 2008/10/24 06:42:50 Be careful not to leak the table handle into the s
+ return Handle<Object>(table->LookupRegExp(*source, flags));
Kasper Lund 2008/10/24 06:42:50 The return value is different from the other looku
+}
+
+
+void CompilationCache::PutRegExp(Handle<String> source,
+ int flags,
+ Handle<FixedArray> data) {
+ HandleScope scope;
+ Handle<CompilationCacheTable> table = GetTable(REGEXP);
+ CALL_HEAP_FUNCTION_VOID(table->PutRegExp(*source, flags, *data));
+}
+
+
void CompilationCache::Clear() {
for (int i = 0; i < NUMBER_OF_ENTRY_KINDS; i++) {
tables[i] = Heap::undefined_value();

Powered by Google App Engine
This is Rietveld 408576698