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

Side by Side Diff: runtime/vm/symbols.h

Issue 1638143002: Precompilation: compact the symbol table. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/symbols.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698