Index: src/regexp/jsregexp.h |
diff --git a/src/regexp/jsregexp.h b/src/regexp/jsregexp.h |
index 39e702149d2294882adb4cf4c6a6e3d97c00dcc7..760d37862b3db3d6ecf366afe829c5873781071d 100644 |
--- a/src/regexp/jsregexp.h |
+++ b/src/regexp/jsregexp.h |
@@ -1659,6 +1659,30 @@ class RegExpEngine: public AllStatic { |
}; |
-} } // namespace v8::internal |
+class RegExpResultsCache : public AllStatic { |
+ public: |
+ enum ResultsCacheType { REGEXP_MULTIPLE_INDICES, STRING_SPLIT_SUBSTRINGS }; |
+ |
+ // Attempt to retrieve a cached result. On failure, 0 is returned as a Smi. |
+ // On success, the returned result is guaranteed to be a COW-array. |
+ static Object* Lookup(Heap* heap, String* key_string, Object* key_pattern, |
+ ResultsCacheType type); |
+ // Attempt to add value_array to the cache specified by type. On success, |
+ // value_array is turned into a COW-array. |
+ static void Enter(Isolate* isolate, Handle<String> key_string, |
+ Handle<Object> key_pattern, Handle<FixedArray> value_array, |
+ ResultsCacheType type); |
+ static void Clear(FixedArray* cache); |
+ static const int kRegExpResultsCacheSize = 0x100; |
+ |
+ private: |
+ static const int kArrayEntriesPerCacheEntry = 4; |
+ static const int kStringOffset = 0; |
+ static const int kPatternOffset = 1; |
+ static const int kArrayOffset = 2; |
+}; |
+ |
+} // namespace internal |
+} // namespace v8 |
#endif // V8_REGEXP_JSREGEXP_H_ |