summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/string-table.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/string-table.h')
-rw-r--r--deps/v8/src/objects/string-table.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/deps/v8/src/objects/string-table.h b/deps/v8/src/objects/string-table.h
index 382fe06bf4..2e5be87b21 100644
--- a/deps/v8/src/objects/string-table.h
+++ b/deps/v8/src/objects/string-table.h
@@ -61,12 +61,17 @@ class StringTable : public HashTable<StringTable, StringTableShape> {
V8_EXPORT_PRIVATE static Handle<String> LookupString(Isolate* isolate,
Handle<String> key);
static Handle<String> LookupKey(Isolate* isolate, StringTableKey* key);
+ static Handle<String> AddKeyNoResize(Isolate* isolate, StringTableKey* key);
static String* ForwardStringIfExists(Isolate* isolate, StringTableKey* key,
String* string);
+ // Shink the StringTable if it's very empty (kMaxEmptyFactor) to avoid the
+ // performance overhead of re-allocating the StringTable over and over again.
+ static Handle<StringTable> CautiousShrink(Handle<StringTable> table);
+
// Looks up a string that is equal to the given string and returns
// string handle if it is found, or an empty handle otherwise.
- MUST_USE_RESULT static MaybeHandle<String> LookupTwoCharsStringIfExists(
+ V8_WARN_UNUSED_RESULT static MaybeHandle<String> LookupTwoCharsStringIfExists(
Isolate* isolate, uint16_t c1, uint16_t c2);
static Object* LookupStringIfExists_NoAllocate(String* string);
@@ -74,6 +79,10 @@ class StringTable : public HashTable<StringTable, StringTableShape> {
DECL_CAST(StringTable)
+ static const int kMaxEmptyFactor = 8;
+ static const int kMinCapacity = 2048;
+ static const int kMinShrinkCapacity = kMinCapacity;
+
private:
template <bool seq_one_byte>
friend class JsonParser;