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

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

Issue 1320673012: Lookup getter/setter symbols before alllocating them, thus eliminating extra String allocations in … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Formatting 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/parser.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/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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 static const char* Name(SymbolId symbol); 604 static const char* Name(SymbolId symbol);
605 605
606 static RawString* FromCharCode(int32_t char_code); 606 static RawString* FromCharCode(int32_t char_code);
607 607
608 static RawString** PredefinedAddress() { 608 static RawString** PredefinedAddress() {
609 return reinterpret_cast<RawString**>(&predefined_); 609 return reinterpret_cast<RawString**>(&predefined_);
610 } 610 }
611 611
612 static void DumpStats(); 612 static void DumpStats();
613 613
614 // Returns Symbol::Null if no symbol is found.
615 template<typename StringType>
616 static RawString* Lookup(const StringType& str);
617
618 // Returns Symbol::Null if no symbol is found.
619 static RawString* LookupFromConcat(const String& str1, const String& str2);
620
614 private: 621 private:
615 enum { 622 enum {
616 kInitialVMIsolateSymtabSize = 1024, 623 kInitialVMIsolateSymtabSize = 1024,
617 kInitialSymtabSize = 2048 624 kInitialSymtabSize = 2048
618 }; 625 };
619 626
620 static void GetStats(Isolate* isolate, 627 static void GetStats(Isolate* isolate,
621 intptr_t* size, 628 intptr_t* size,
622 intptr_t* capacity); 629 intptr_t* capacity);
623 630
(...skipping 20 matching lines...) Expand all
644 friend class SnapshotReader; 651 friend class SnapshotReader;
645 friend class SnapshotWriter; 652 friend class SnapshotWriter;
646 friend class ApiMessageReader; 653 friend class ApiMessageReader;
647 654
648 DISALLOW_COPY_AND_ASSIGN(Symbols); 655 DISALLOW_COPY_AND_ASSIGN(Symbols);
649 }; 656 };
650 657
651 } // namespace dart 658 } // namespace dart
652 659
653 #endif // VM_SYMBOLS_H_ 660 #endif // VM_SYMBOLS_H_
OLDNEW
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/symbols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698