Chromium Code Reviews| 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 // freed symbols. | |
|
siva
2016/01/27 21:21:10
Maybe
"Returns the number of symbols that have be
rmacnak
2016/01/27 23:06:20
Done.
| |
| 577 static intptr_t Compact(Isolate* isolate); | |
| 578 | |
| 575 // Creates a Symbol given a C string that is assumed to contain | 579 // Creates a Symbol given a C string that is assumed to contain |
| 576 // UTF-8 encoded characters and '\0' is considered a termination character. | 580 // UTF-8 encoded characters and '\0' is considered a termination character. |
| 577 // TODO(7123) - Rename this to FromCString(....). | 581 // TODO(7123) - Rename this to FromCString(....). |
| 578 static RawString* New(const char* cstr) { | 582 static RawString* New(const char* cstr) { |
| 579 return New(cstr, strlen(cstr)); | 583 return New(cstr, strlen(cstr)); |
| 580 } | 584 } |
| 581 static RawString* New(const char* cstr, intptr_t length); | 585 static RawString* New(const char* cstr, intptr_t length); |
| 582 | 586 |
| 583 // Creates a new Symbol from an array of UTF-8 encoded characters. | 587 // Creates a new Symbol from an array of UTF-8 encoded characters. |
| 584 static RawString* FromUTF8(const uint8_t* utf8_array, intptr_t len); | 588 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; | 661 friend class SnapshotReader; |
| 658 friend class SnapshotWriter; | 662 friend class SnapshotWriter; |
| 659 friend class ApiMessageReader; | 663 friend class ApiMessageReader; |
| 660 | 664 |
| 661 DISALLOW_COPY_AND_ASSIGN(Symbols); | 665 DISALLOW_COPY_AND_ASSIGN(Symbols); |
| 662 }; | 666 }; |
| 663 | 667 |
| 664 } // namespace dart | 668 } // namespace dart |
| 665 | 669 |
| 666 #endif // VM_SYMBOLS_H_ | 670 #endif // VM_SYMBOLS_H_ |
| OLD | NEW |