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

Unified Diff: runtime/vm/symbols.h

Issue 11369259: Add one-char string table for faster String.charAt to the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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: 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),
« no previous file with comments | « runtime/vm/snapshot_test.cc ('k') | runtime/vm/symbols.cc » ('j') | runtime/vm/symbols.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698