| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_SYMBOLS_H_ | 5 #ifndef VM_SYMBOLS_H_ |
| 6 #define VM_SYMBOLS_H_ | 6 #define VM_SYMBOLS_H_ |
| 7 | 7 |
| 8 #include "vm/object.h" | 8 #include "vm/object.h" |
| 9 #include "vm/snapshot_ids.h" | 9 #include "vm/snapshot_ids.h" |
| 10 | 10 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 436 |
| 437 // Initialize and setup a symbol table for the isolate. | 437 // Initialize and setup a symbol table for the isolate. |
| 438 static void SetupSymbolTable(Isolate* isolate); | 438 static void SetupSymbolTable(Isolate* isolate); |
| 439 | 439 |
| 440 // Get number of symbols in an isolate's symbol table. | 440 // Get number of symbols in an isolate's symbol table. |
| 441 static intptr_t Size(Isolate* isolate); | 441 static intptr_t Size(Isolate* isolate); |
| 442 | 442 |
| 443 // Creates a Symbol given a C string that is assumed to contain | 443 // Creates a Symbol given a C string that is assumed to contain |
| 444 // UTF-8 encoded characters and '\0' is considered a termination character. | 444 // UTF-8 encoded characters and '\0' is considered a termination character. |
| 445 // TODO(7123) - Rename this to FromCString(....). | 445 // TODO(7123) - Rename this to FromCString(....). |
| 446 static RawString* New(const char* cstr); | 446 static RawString* New(const char* cstr) { |
| 447 return New(cstr, strlen(cstr)); |
| 448 } |
| 449 static RawString* New(const char* cstr, intptr_t length); |
| 447 | 450 |
| 448 // Creates a new Symbol from an array of UTF-8 encoded characters. | 451 // Creates a new Symbol from an array of UTF-8 encoded characters. |
| 449 static RawString* FromUTF8(const uint8_t* utf8_array, intptr_t len); | 452 static RawString* FromUTF8(const uint8_t* utf8_array, intptr_t len); |
| 450 | 453 |
| 451 // Creates a new Symbol from an array of Latin-1 encoded characters. | 454 // Creates a new Symbol from an array of Latin-1 encoded characters. |
| 452 static RawString* FromLatin1(const uint8_t* latin1_array, intptr_t len); | 455 static RawString* FromLatin1(const uint8_t* latin1_array, intptr_t len); |
| 453 | 456 |
| 454 // Creates a new Symbol from an array of UTF-16 encoded characters. | 457 // Creates a new Symbol from an array of UTF-16 encoded characters. |
| 455 static RawString* FromUTF16(const uint16_t* utf16_array, intptr_t len); | 458 static RawString* FromUTF16(const uint16_t* utf16_array, intptr_t len); |
| 456 | 459 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 friend class SnapshotReader; | 535 friend class SnapshotReader; |
| 533 friend class SnapshotWriter; | 536 friend class SnapshotWriter; |
| 534 friend class ApiMessageReader; | 537 friend class ApiMessageReader; |
| 535 | 538 |
| 536 DISALLOW_COPY_AND_ASSIGN(Symbols); | 539 DISALLOW_COPY_AND_ASSIGN(Symbols); |
| 537 }; | 540 }; |
| 538 | 541 |
| 539 } // namespace dart | 542 } // namespace dart |
| 540 | 543 |
| 541 #endif // VM_SYMBOLS_H_ | 544 #endif // VM_SYMBOLS_H_ |
| OLD | NEW |