| 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 RUNTIME_VM_SYMBOLS_H_ | 5 #ifndef RUNTIME_VM_SYMBOLS_H_ |
| 6 #define RUNTIME_VM_SYMBOLS_H_ | 6 #define RUNTIME_VM_SYMBOLS_H_ |
| 7 | 7 |
| 8 #include "vm/growable_array.h" | 8 #include "vm/growable_array.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/snapshot_ids.h" | 10 #include "vm/snapshot_ids.h" |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 | 564 |
| 565 // Initialize frequently used symbols in the vm isolate. | 565 // Initialize frequently used symbols in the vm isolate. |
| 566 static void InitOnce(Isolate* isolate); | 566 static void InitOnce(Isolate* isolate); |
| 567 static void InitOnceFromSnapshot(Isolate* isolate); | 567 static void InitOnceFromSnapshot(Isolate* isolate); |
| 568 | 568 |
| 569 // Initialize and setup a symbol table for the isolate. | 569 // Initialize and setup a symbol table for the isolate. |
| 570 static void SetupSymbolTable(Isolate* isolate); | 570 static void SetupSymbolTable(Isolate* isolate); |
| 571 | 571 |
| 572 static RawArray* UnifiedSymbolTable(); | 572 static RawArray* UnifiedSymbolTable(); |
| 573 | 573 |
| 574 #if defined(DART_PRECOMPILER) | |
| 575 // Treat the symbol table as weak and collect garbage. | 574 // Treat the symbol table as weak and collect garbage. |
| 576 static void Compact(Isolate* isolate); | 575 static void Compact(Isolate* isolate); |
| 577 #endif | |
| 578 | 576 |
| 579 // Creates a Symbol given a C string that is assumed to contain | 577 // Creates a Symbol given a C string that is assumed to contain |
| 580 // UTF-8 encoded characters and '\0' is considered a termination character. | 578 // UTF-8 encoded characters and '\0' is considered a termination character. |
| 581 // TODO(7123) - Rename this to FromCString(....). | 579 // TODO(7123) - Rename this to FromCString(....). |
| 582 static RawString* New(Thread* thread, const char* cstr) { | 580 static RawString* New(Thread* thread, const char* cstr) { |
| 583 return New(thread, cstr, strlen(cstr)); | 581 return New(thread, cstr, strlen(cstr)); |
| 584 } | 582 } |
| 585 static RawString* New(Thread* thread, const char* cstr, intptr_t length); | 583 static RawString* New(Thread* thread, const char* cstr, intptr_t length); |
| 586 | 584 |
| 587 // Creates a new Symbol from an array of UTF-8 encoded characters. | 585 // Creates a new Symbol from an array of UTF-8 encoded characters. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 | 628 |
| 631 // Returns char* of predefined symbol. | 629 // Returns char* of predefined symbol. |
| 632 static const char* Name(SymbolId symbol); | 630 static const char* Name(SymbolId symbol); |
| 633 | 631 |
| 634 static RawString* FromCharCode(Thread* thread, int32_t char_code); | 632 static RawString* FromCharCode(Thread* thread, int32_t char_code); |
| 635 | 633 |
| 636 static RawString** PredefinedAddress() { | 634 static RawString** PredefinedAddress() { |
| 637 return reinterpret_cast<RawString**>(&predefined_); | 635 return reinterpret_cast<RawString**>(&predefined_); |
| 638 } | 636 } |
| 639 | 637 |
| 640 static void DumpStats(); | 638 static void DumpStats(Isolate* isolate); |
| 641 | 639 |
| 642 // Returns Symbol::Null if no symbol is found. | 640 // Returns Symbol::Null if no symbol is found. |
| 643 template <typename StringType> | 641 template <typename StringType> |
| 644 static RawString* Lookup(Thread* thread, const StringType& str); | 642 static RawString* Lookup(Thread* thread, const StringType& str); |
| 645 | 643 |
| 646 // Returns Symbol::Null if no symbol is found. | 644 // Returns Symbol::Null if no symbol is found. |
| 647 static RawString* LookupFromConcat(Thread* thread, | 645 static RawString* LookupFromConcat(Thread* thread, |
| 648 const String& str1, | 646 const String& str1, |
| 649 const String& str2); | 647 const String& str2); |
| 650 | 648 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 friend class Serializer; | 680 friend class Serializer; |
| 683 friend class Deserializer; | 681 friend class Deserializer; |
| 684 friend class ApiMessageReader; | 682 friend class ApiMessageReader; |
| 685 | 683 |
| 686 DISALLOW_COPY_AND_ASSIGN(Symbols); | 684 DISALLOW_COPY_AND_ASSIGN(Symbols); |
| 687 }; | 685 }; |
| 688 | 686 |
| 689 } // namespace dart | 687 } // namespace dart |
| 690 | 688 |
| 691 #endif // RUNTIME_VM_SYMBOLS_H_ | 689 #endif // RUNTIME_VM_SYMBOLS_H_ |
| OLD | NEW |