| 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 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #define DEFINE_SYMBOL_INDEX(symbol, literal) \ | 63 #define DEFINE_SYMBOL_INDEX(symbol, literal) \ |
| 64 k##symbol, | 64 k##symbol, |
| 65 PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_INDEX) | 65 PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_INDEX) |
| 66 #undef DEFINE_SYMBOL_INDEX | 66 #undef DEFINE_SYMBOL_INDEX |
| 67 | 67 |
| 68 kMaxPredefined, | 68 kMaxPredefined, |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 // Access methods for symbols stored in the vm isolate. | 71 // Access methods for symbols stored in the vm isolate. |
| 72 #define DEFINE_SYMBOL_ACCESSOR(symbol, literal) \ | 72 #define DEFINE_SYMBOL_ACCESSOR(symbol, literal) \ |
| 73 static RawString* symbol() { return predefined_[k##symbol]; } | 73 static RawString* symbol() { return Symbols::New(literal); } |
| 74 PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_ACCESSOR) | 74 PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_ACCESSOR) |
| 75 #undef DEFINE_SYMBOL_ACCESSOR | 75 #undef DEFINE_SYMBOL_ACCESSOR |
| 76 | 76 |
| 77 // Initialize frequently used symbols in the vm isolate. | 77 // Initialize frequently used symbols in the vm isolate. |
| 78 static void InitOnce(Isolate* isolate); | 78 static void InitOnce(Isolate* isolate); |
| 79 | 79 |
| 80 // Initialize and setup a symbol table for the isolate. | 80 // Initialize and setup a symbol table for the isolate. |
| 81 static void SetupSymbolTable(Isolate* isolate); | 81 static void SetupSymbolTable(Isolate* isolate); |
| 82 | 82 |
| 83 // Get number of symbols in an isolate's symbol table. | 83 // Get number of symbols in an isolate's symbol table. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 static RawString* predefined_[kMaxPredefined]; | 127 static RawString* predefined_[kMaxPredefined]; |
| 128 | 128 |
| 129 friend class SnapshotReader; | 129 friend class SnapshotReader; |
| 130 | 130 |
| 131 DISALLOW_COPY_AND_ASSIGN(Symbols); | 131 DISALLOW_COPY_AND_ASSIGN(Symbols); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 } // namespace dart | 134 } // namespace dart |
| 135 | 135 |
| 136 #endif // VM_SYMBOLS_H_ | 136 #endif // VM_SYMBOLS_H_ |
| OLD | NEW |