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

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

Issue 11416129: Inline [] operator on one-byte strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 | Annotate | Revision Log
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/object.h" 8 #include "vm/object.h"
9 #include "vm/snapshot_ids.h" 9 #include "vm/snapshot_ids.h"
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 static RawString* New(const String& str); 183 static RawString* New(const String& str);
184 static RawString* New(const String& str, 184 static RawString* New(const String& str,
185 intptr_t begin_index, 185 intptr_t begin_index,
186 intptr_t length); 186 intptr_t length);
187 187
188 // Returns char* of predefined symbol. 188 // Returns char* of predefined symbol.
189 static const char* Name(SymbolId symbol); 189 static const char* Name(SymbolId symbol);
190 190
191 static RawString* FromCharCode(int32_t char_code); 191 static RawString* FromCharCode(int32_t char_code);
192 192
193 static RawString** PredefinedAddress() {
194 return reinterpret_cast<RawString**>(&predefined_);
195 }
196
193 private: 197 private:
194 enum { 198 enum {
195 kInitialVMIsolateSymtabSize = ((kMaxId + 15) & -16), 199 kInitialVMIsolateSymtabSize = ((kMaxId + 15) & -16),
196 kInitialSymtabSize = 256 200 kInitialSymtabSize = 256
197 }; 201 };
198 202
199 // Add the string into the VM isolate symbol table. 203 // Add the string into the VM isolate symbol table.
200 static void Add(const Array& symbol_table, const String& str); 204 static void Add(const Array& symbol_table, const String& str);
201 205
202 // Insert symbol into symbol table, growing it if necessary. 206 // Insert symbol into symbol table, growing it if necessary.
(...skipping 29 matching lines...) Expand all
232 friend class SnapshotReader; 236 friend class SnapshotReader;
233 friend class SnapshotWriter; 237 friend class SnapshotWriter;
234 friend class ApiMessageReader; 238 friend class ApiMessageReader;
235 239
236 DISALLOW_COPY_AND_ASSIGN(Symbols); 240 DISALLOW_COPY_AND_ASSIGN(Symbols);
237 }; 241 };
238 242
239 } // namespace dart 243 } // namespace dart
240 244
241 #endif // VM_SYMBOLS_H_ 245 #endif // VM_SYMBOLS_H_
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | tests/language/optimized_string_charat_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698