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

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

Issue 1313363005: Use zone allocated C-strings instead of String heap objects to construct signature symbols (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 3 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/object.cc ('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/object.h" 9 #include "vm/object.h"
9 #include "vm/snapshot_ids.h" 10 #include "vm/snapshot_ids.h"
10 11
11 namespace dart { 12 namespace dart {
12 13
13 // Forward declarations. 14 // Forward declarations.
14 class Isolate; 15 class Isolate;
15 class ObjectPointerVisitor; 16 class ObjectPointerVisitor;
16 17
17 // One-character symbols are added implicitly. 18 // One-character symbols are added implicitly.
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // Creates a new Symbol from an array of UTF-32 encoded characters. 588 // Creates a new Symbol from an array of UTF-32 encoded characters.
588 static RawString* FromUTF32(const int32_t* utf32_array, intptr_t len); 589 static RawString* FromUTF32(const int32_t* utf32_array, intptr_t len);
589 590
590 static RawString* New(const String& str); 591 static RawString* New(const String& str);
591 static RawString* New(const String& str, 592 static RawString* New(const String& str,
592 intptr_t begin_index, 593 intptr_t begin_index,
593 intptr_t length); 594 intptr_t length);
594 595
595 static RawString* FromConcat(const String& str1, const String& str2); 596 static RawString* FromConcat(const String& str1, const String& str2);
596 597
598 static RawString* FromConcatAll(const GrowableArray<const String*>& strs);
599
597 // Returns char* of predefined symbol. 600 // Returns char* of predefined symbol.
598 static const char* Name(SymbolId symbol); 601 static const char* Name(SymbolId symbol);
599 602
600 static RawString* FromCharCode(int32_t char_code); 603 static RawString* FromCharCode(int32_t char_code);
601 604
602 static RawString** PredefinedAddress() { 605 static RawString** PredefinedAddress() {
603 return reinterpret_cast<RawString**>(&predefined_); 606 return reinterpret_cast<RawString**>(&predefined_);
604 } 607 }
605 608
606 static void DumpStats(); 609 static void DumpStats();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 friend class SnapshotReader; 641 friend class SnapshotReader;
639 friend class SnapshotWriter; 642 friend class SnapshotWriter;
640 friend class ApiMessageReader; 643 friend class ApiMessageReader;
641 644
642 DISALLOW_COPY_AND_ASSIGN(Symbols); 645 DISALLOW_COPY_AND_ASSIGN(Symbols);
643 }; 646 };
644 647
645 } // namespace dart 648 } // namespace dart
646 649
647 #endif // VM_SYMBOLS_H_ 650 #endif // VM_SYMBOLS_H_
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698