Chromium Code Reviews| Index: runtime/vm/symbols.h |
| =================================================================== |
| --- runtime/vm/symbols.h (revision 14902) |
| +++ runtime/vm/symbols.h (working copy) |
| @@ -146,16 +146,18 @@ |
| // without having to maintain copies in each isolate. |
| class Symbols : public AllStatic { |
| public: |
| + static const uint32_t kMaxOneByteCharCode = 0x7F; |
|
Ivan Posva
2012/11/15 09:07:10
There is no reason to limit this to the maximum on
Florian Schneider
2012/11/15 21:54:42
For now I only want to deal with OneByteStrings in
|
| + |
| // List of strings that are pre created in the vm isolate. |
| - enum { |
| + enum SymbolId { |
| kIllegal = 0, |
| #define DEFINE_SYMBOL_INDEX(symbol, literal) \ |
| k##symbol, |
| PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_INDEX) |
| #undef DEFINE_SYMBOL_INDEX |
| - |
| - kMaxId, |
| + kMaxPredefinedId, |
|
Ivan Posva
2012/11/15 09:07:10
This causes us to have a hole in the used strings.
Florian Schneider
2012/11/15 21:54:42
Done. kNullCharId is an alias for kMaxPredefinedId
|
| + kMaxId = kMaxPredefinedId + kMaxOneByteCharCode + 1, |
| }; |
| // Access methods for symbols stored in the vm isolate. |
| @@ -183,8 +185,10 @@ |
| intptr_t length); |
| // Returns char* of predefined symbol. |
| - static const char* Name(intptr_t symbol); |
| + static const char* Name(SymbolId symbol); |
| + static RawString* FromCharCode(uint32_t char_code); |
| + |
| private: |
| enum { |
| kInitialVMIsolateSymtabSize = ((Symbols::kMaxId + 15) & -16), |