| 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/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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 565 |
| 566 // Add all the symbols that were cached in the VM isolate to this isolate, | 566 // Add all the symbols that were cached in the VM isolate to this isolate, |
| 567 // we do this when an Isolate is not created from the snapshot so that | 567 // we do this when an Isolate is not created from the snapshot so that |
| 568 // we get a unified symbol table that can be be dumped into the VM isolate | 568 // we get a unified symbol table that can be be dumped into the VM isolate |
| 569 // snapshot. | 569 // snapshot. |
| 570 static void AddPredefinedSymbolsToIsolate(); | 570 static void AddPredefinedSymbolsToIsolate(); |
| 571 | 571 |
| 572 // Initialize and setup a symbol table for the isolate. | 572 // Initialize and setup a symbol table for the isolate. |
| 573 static void SetupSymbolTable(Isolate* isolate); | 573 static void SetupSymbolTable(Isolate* isolate); |
| 574 | 574 |
| 575 // Treat the symbol table as weak and collect garbage. Answer the number of |
| 576 // symbols deleted from the symbol table because they where not referenced |
| 577 // from anywhere else. |
| 578 static intptr_t Compact(Isolate* isolate); |
| 579 |
| 575 // Creates a Symbol given a C string that is assumed to contain | 580 // Creates a Symbol given a C string that is assumed to contain |
| 576 // UTF-8 encoded characters and '\0' is considered a termination character. | 581 // UTF-8 encoded characters and '\0' is considered a termination character. |
| 577 // TODO(7123) - Rename this to FromCString(....). | 582 // TODO(7123) - Rename this to FromCString(....). |
| 578 static RawString* New(const char* cstr) { | 583 static RawString* New(const char* cstr) { |
| 579 return New(cstr, strlen(cstr)); | 584 return New(cstr, strlen(cstr)); |
| 580 } | 585 } |
| 581 static RawString* New(const char* cstr, intptr_t length); | 586 static RawString* New(const char* cstr, intptr_t length); |
| 582 | 587 |
| 583 // Creates a new Symbol from an array of UTF-8 encoded characters. | 588 // Creates a new Symbol from an array of UTF-8 encoded characters. |
| 584 static RawString* FromUTF8(const uint8_t* utf8_array, intptr_t len); | 589 static RawString* FromUTF8(const uint8_t* utf8_array, intptr_t len); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 friend class SnapshotReader; | 662 friend class SnapshotReader; |
| 658 friend class SnapshotWriter; | 663 friend class SnapshotWriter; |
| 659 friend class ApiMessageReader; | 664 friend class ApiMessageReader; |
| 660 | 665 |
| 661 DISALLOW_COPY_AND_ASSIGN(Symbols); | 666 DISALLOW_COPY_AND_ASSIGN(Symbols); |
| 662 }; | 667 }; |
| 663 | 668 |
| 664 } // namespace dart | 669 } // namespace dart |
| 665 | 670 |
| 666 #endif // VM_SYMBOLS_H_ | 671 #endif // VM_SYMBOLS_H_ |
| OLD | NEW |