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/object.h" | 8 #include "vm/object.h" |
9 #include "vm/snapshot_ids.h" | 9 #include "vm/snapshot_ids.h" |
10 | 10 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 kMaxPredefinedId = kNullCharId + kMaxOneCharCodeSymbol + 1, | 410 kMaxPredefinedId = kNullCharId + kMaxOneCharCodeSymbol + 1, |
411 }; | 411 }; |
412 | 412 |
413 // Number of one character symbols being predefined in the predefined_ array. | 413 // Number of one character symbols being predefined in the predefined_ array. |
414 static const int kNumberOfOneCharCodeSymbols = | 414 static const int kNumberOfOneCharCodeSymbols = |
415 (kMaxPredefinedId - kNullCharId); | 415 (kMaxPredefinedId - kNullCharId); |
416 | 416 |
417 // Offset of Null character which is the predefined character symbol. | 417 // Offset of Null character which is the predefined character symbol. |
418 static const int kNullCharCodeSymbolOffset = 0; | 418 static const int kNullCharCodeSymbolOffset = 0; |
419 | 419 |
| 420 static const String& Symbol(intptr_t index) { |
| 421 ASSERT((index > kIllegal) && (index < kMaxPredefinedId)); |
| 422 return *(symbol_handles_[index]); |
| 423 } |
| 424 |
420 // Access methods for one byte character symbols stored in the vm isolate. | 425 // Access methods for one byte character symbols stored in the vm isolate. |
421 static const String& Dot() { | 426 static const String& Dot() { |
422 return *(symbol_handles_[kNullCharId + '.']); | 427 return *(symbol_handles_[kNullCharId + '.']); |
423 } | 428 } |
424 static const String& Equals() { | 429 static const String& Equals() { |
425 return *(symbol_handles_[kNullCharId + '=']); | 430 return *(symbol_handles_[kNullCharId + '=']); |
426 } | 431 } |
427 static const String& Plus() { | 432 static const String& Plus() { |
428 return *(symbol_handles_[kNullCharId + '+']); | 433 return *(symbol_handles_[kNullCharId + '+']); |
429 } | 434 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 friend class SnapshotReader; | 614 friend class SnapshotReader; |
610 friend class SnapshotWriter; | 615 friend class SnapshotWriter; |
611 friend class ApiMessageReader; | 616 friend class ApiMessageReader; |
612 | 617 |
613 DISALLOW_COPY_AND_ASSIGN(Symbols); | 618 DISALLOW_COPY_AND_ASSIGN(Symbols); |
614 }; | 619 }; |
615 | 620 |
616 } // namespace dart | 621 } // namespace dart |
617 | 622 |
618 #endif // VM_SYMBOLS_H_ | 623 #endif // VM_SYMBOLS_H_ |
OLD | NEW |