Chromium Code Reviews| Index: src/ast/ast-value-factory.h |
| diff --git a/src/ast/ast-value-factory.h b/src/ast/ast-value-factory.h |
| index 4ce480fe570b94b6fda45492592985afaeb137cb..5909b1a06ca1ea9d5e2fe9eeec2fc89c5f469906 100644 |
| --- a/src/ast/ast-value-factory.h |
| +++ b/src/ast/ast-value-factory.h |
| @@ -332,7 +332,6 @@ class AstValueFactory { |
| AstValueFactory(Zone* zone, uint32_t hash_seed) |
| : string_table_(AstRawStringCompare), |
| values_(nullptr), |
| - smis_(), |
| strings_(nullptr), |
| strings_end_(&strings_), |
| zone_(zone), |
| @@ -344,6 +343,9 @@ class AstValueFactory { |
| OTHER_CONSTANTS(F) |
| #undef F |
| std::fill(smis_, smis_ + arraysize(smis_), nullptr); |
| + std::fill(one_character_strings_, |
| + one_character_strings_ + arraysize(one_character_strings_), |
| + nullptr); |
| } |
| Zone* zone() const { return zone_; } |
| @@ -423,11 +425,16 @@ class AstValueFactory { |
| // they can be internalized later). |
| AstValue* values_; |
| - AstValue* smis_[kMaxCachedSmi + 1]; |
| // We need to keep track of strings_ in order since cons strings require their |
| // members to be internalized first. |
| AstString* strings_; |
| AstString** strings_end_; |
| + |
| + // Caches for faster access: small numbers, one character lowercase strings |
| + // (for minified code). |
| + AstValue* smis_[kMaxCachedSmi + 1]; |
| + AstRawString* one_character_strings_[26]; |
|
Toon Verwaest
2016/12/05 15:30:40
constants ... :) I guess the alphabet won't change
|
| + |
| Zone* zone_; |
| uint32_t hash_seed_; |