| 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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 // Forward declarations. | 13 // Forward declarations. |
| 14 class Isolate; | 14 class Isolate; |
| 15 class ObjectPointerVisitor; | 15 class ObjectPointerVisitor; |
| 16 | 16 |
| 17 #define PREDEFINED_SYMBOLS_LIST(V) \ | 17 #define PREDEFINED_SYMBOLS_LIST(V) \ |
| 18 V(Empty, "") \ | 18 V(Empty, "") \ |
| 19 V(Dot, ".") \ | |
| 20 V(Equals, "=") \ | |
| 21 V(EqualOperator, "==") \ | 19 V(EqualOperator, "==") \ |
| 22 V(Identical, "identical") \ | 20 V(Identical, "identical") \ |
| 23 V(Length, "length") \ | 21 V(Length, "length") \ |
| 24 V(IndexToken, "[]") \ | 22 V(IndexToken, "[]") \ |
| 25 V(AssignIndexToken, "[]=") \ | 23 V(AssignIndexToken, "[]=") \ |
| 26 V(TopLevel, "::") \ | 24 V(TopLevel, "::") \ |
| 27 V(DefaultLabel, ":L") \ | 25 V(DefaultLabel, ":L") \ |
| 28 V(This, "this") \ | 26 V(This, "this") \ |
| 29 V(Super, "super") \ | 27 V(Super, "super") \ |
| 30 V(Call, "call") \ | 28 V(Call, "call") \ |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 kMaxPredefinedId, | 168 kMaxPredefinedId, |
| 171 kNullCharId = kMaxPredefinedId, | 169 kNullCharId = kMaxPredefinedId, |
| 172 kMaxId = kNullCharId + kMaxOneCharCodeSymbol + 1, | 170 kMaxId = kNullCharId + kMaxOneCharCodeSymbol + 1, |
| 173 }; | 171 }; |
| 174 | 172 |
| 175 // Access methods for symbols stored in the vm isolate. | 173 // Access methods for symbols stored in the vm isolate. |
| 176 #define DEFINE_SYMBOL_ACCESSOR(symbol, literal) \ | 174 #define DEFINE_SYMBOL_ACCESSOR(symbol, literal) \ |
| 177 static RawString* symbol() { return predefined_[k##symbol]; } | 175 static RawString* symbol() { return predefined_[k##symbol]; } |
| 178 PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_ACCESSOR) | 176 PREDEFINED_SYMBOLS_LIST(DEFINE_SYMBOL_ACCESSOR) |
| 179 #undef DEFINE_SYMBOL_ACCESSOR | 177 #undef DEFINE_SYMBOL_ACCESSOR |
| 178 static RawString* Dot() { return predefined_[kNullCharId + '.']; } |
| 179 static RawString* Equals() { return predefined_[kNullCharId + '=']; } |
| 180 | 180 |
| 181 // Access methods for symbol handles stored in the vm isolate. | 181 // Access methods for symbol handles stored in the vm isolate. |
| 182 #define DEFINE_SYMBOL_HANDLE_ACCESSOR(symbol) \ | 182 #define DEFINE_SYMBOL_HANDLE_ACCESSOR(symbol) \ |
| 183 static const String& symbol##Handle() { return *symbol##_handle_; } | 183 static const String& symbol##Handle() { return *symbol##_handle_; } |
| 184 PREDEFINED_SYMBOL_HANDLES_LIST(DEFINE_SYMBOL_HANDLE_ACCESSOR) | 184 PREDEFINED_SYMBOL_HANDLES_LIST(DEFINE_SYMBOL_HANDLE_ACCESSOR) |
| 185 #undef DEFINE_SYMBOL_HANDLE_ACCESSOR | 185 #undef DEFINE_SYMBOL_HANDLE_ACCESSOR |
| 186 | 186 |
| 187 // Initialize frequently used symbols in the vm isolate. | 187 // Initialize frequently used symbols in the vm isolate. |
| 188 static void InitOnce(Isolate* isolate); | 188 static void InitOnce(Isolate* isolate); |
| 189 | 189 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 friend class SnapshotReader; | 308 friend class SnapshotReader; |
| 309 friend class SnapshotWriter; | 309 friend class SnapshotWriter; |
| 310 friend class ApiMessageReader; | 310 friend class ApiMessageReader; |
| 311 | 311 |
| 312 DISALLOW_COPY_AND_ASSIGN(Symbols); | 312 DISALLOW_COPY_AND_ASSIGN(Symbols); |
| 313 }; | 313 }; |
| 314 | 314 |
| 315 } // namespace dart | 315 } // namespace dart |
| 316 | 316 |
| 317 #endif // VM_SYMBOLS_H_ | 317 #endif // VM_SYMBOLS_H_ |
| OLD | NEW |