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

Unified Diff: vm/symbols.h

Issue 11411341: Fix for issue 7089 (Symbols::New was not quite working correctly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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
« no previous file with comments | « vm/object_test.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/symbols.h
===================================================================
--- vm/symbols.h (revision 15670)
+++ vm/symbols.h (working copy)
@@ -177,10 +177,22 @@
// Get number of symbols in an isolate's symbol table.
static intptr_t Size(Isolate* isolate);
- // Helper functions to create a symbol given a string or set of characters.
- static RawString* New(const char* str);
- template<typename T>
- static RawString* New(const T* characters, intptr_t len);
+ // Creates a Symbol given a C string that is assumed to contain
+ // UTF-8 encoded characters and '\0' is considered a termination character.
cshapiro 2012/12/04 01:00:46 Same TODO here as well?
siva 2012/12/04 02:36:16 Done.
+ static RawString* New(const char* cstr);
+
+ // Creates a new Symbol from an array of UTF-8 encoded characters.
+ static RawString* NewFromUTF8(const uint8_t* utf8_array, intptr_t len);
cshapiro 2012/12/04 01:00:46 Maybe s/NewFromUTF8/FromUTF8/ ?
siva 2012/12/04 02:36:16 Renamed this to FromUTF8 and all the subsequent on
+
+ // Creates a new Symbol from an array of Latin-1 encoded characters.
+ static RawString* New(const uint8_t* latin1_array, intptr_t len);
+
+ // Creates a new Symbol from an array of UTF-16 encoded characters.
+ static RawString* New(const uint16_t* utf16_array, intptr_t len);
+
+ // Creates a new Symbol from an array of UTF-32 encoded characters.
+ static RawString* New(const int32_t* utf32_array, intptr_t len);
+
static RawString* New(const String& str);
static RawString* New(const String& str,
intptr_t begin_index,
@@ -201,6 +213,10 @@
kInitialSymtabSize = 256
};
+ // Helper functions to create a symbol given a string or set of characters.
+ template<typename T>
+ static RawString* NewSymbol(const T* characters, intptr_t len);
+
// Add the string into the VM isolate symbol table.
static void Add(const Array& symbol_table, const String& str);
« no previous file with comments | « vm/object_test.cc ('k') | vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698