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 // One-character symbols are added implicitly. | 17 // One-character symbols are added implicitly. |
18 #define PREDEFINED_SYMBOLS_LIST(V) \ | 18 #define PREDEFINED_SYMBOLS_LIST(V) \ |
19 V(Empty, "") \ | 19 V(Empty, "") \ |
20 V(EqualOperator, "==") \ | 20 V(EqualOperator, "==") \ |
| 21 V(GreaterEqualOperator, ">=") \ |
| 22 V(LessEqualOperator, "<=") \ |
| 23 V(UnaryMinus, "unary-") \ |
21 V(Identical, "identical") \ | 24 V(Identical, "identical") \ |
22 V(Length, "length") \ | 25 V(Length, "length") \ |
23 V(IndexToken, "[]") \ | 26 V(IndexToken, "[]") \ |
24 V(AssignIndexToken, "[]=") \ | 27 V(AssignIndexToken, "[]=") \ |
25 V(TopLevel, "::") \ | 28 V(TopLevel, "::") \ |
26 V(DefaultLabel, ":L") \ | 29 V(DefaultLabel, ":L") \ |
27 V(This, "this") \ | 30 V(This, "this") \ |
28 V(Other, "other") \ | 31 V(Other, "other") \ |
29 V(Super, "super") \ | 32 V(Super, "super") \ |
30 V(Call, "call") \ | 33 V(Call, "call") \ |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 V(_leftShiftWithMask32, "_leftShiftWithMask32") \ | 321 V(_leftShiftWithMask32, "_leftShiftWithMask32") \ |
319 V(OptimizedOut, "<optimized out>") \ | 322 V(OptimizedOut, "<optimized out>") \ |
320 V(NotInitialized, "<not initialized>") \ | 323 V(NotInitialized, "<not initialized>") \ |
321 V(AllocationStubFor, "Allocation stub for ") \ | 324 V(AllocationStubFor, "Allocation stub for ") \ |
322 V(TempParam, ":temp_param") \ | 325 V(TempParam, ":temp_param") \ |
323 V(_UserTag, "_UserTag") \ | 326 V(_UserTag, "_UserTag") \ |
324 V(Default, "Default") \ | 327 V(Default, "Default") \ |
325 V(StubPrefix, "[Stub] ") \ | 328 V(StubPrefix, "[Stub] ") \ |
326 V(ClassID, "ClassID") \ | 329 V(ClassID, "ClassID") \ |
327 V(DartIsVM, "dart.isVM") \ | 330 V(DartIsVM, "dart.isVM") \ |
| 331 V(stack_, "stack_") \ |
| 332 V(current_character_, "current_character_") \ |
| 333 V(current_position_, "current_position_") \ |
| 334 V(string_param_length_, "string_param_length_") \ |
| 335 V(capture_length_, "capture_length_") \ |
| 336 V(word_character_map_, "word_character_map_") \ |
| 337 V(match_start_index_, "match_start_index_") \ |
| 338 V(capture_start_index_, "capture_start_index_") \ |
| 339 V(match_end_index_, "match_end_index_") \ |
| 340 V(char_in_capture_, "char_in_capture_") \ |
| 341 V(char_in_match_, "char_in_match_") \ |
| 342 V(result_, "result_") \ |
| 343 V(position_registers_, "position_registers_") \ |
| 344 V(string_param_, "string_param_") \ |
| 345 V(start_index_param_, "start_index_param_") \ |
| 346 V(clear, "clear") \ |
| 347 V(_wordCharacterMap, "_wordCharacterMap") \ |
| 348 V(print, "print") \ |
| 349 V(last, "last") \ |
| 350 V(removeLast, "removeLast") \ |
| 351 V(add, "add") \ |
| 352 V(_oneCodeUnitAt, "_oneCodeUnitAt") \ |
| 353 V(_twoCodeUnitsAt, "_twoCodeUnitsAt") \ |
| 354 V(_fourCodeUnitsAt, "_fourCodeUnitsAt") \ |
328 | 355 |
329 | 356 |
330 // Contains a list of frequently used strings in a canonicalized form. This | 357 // Contains a list of frequently used strings in a canonicalized form. This |
331 // list is kept in the vm_isolate in order to share the copy across isolates | 358 // list is kept in the vm_isolate in order to share the copy across isolates |
332 // without having to maintain copies in each isolate. | 359 // without having to maintain copies in each isolate. |
333 class Symbols : public AllStatic { | 360 class Symbols : public AllStatic { |
334 public: | 361 public: |
335 enum { kMaxOneCharCodeSymbol = 0xFF }; | 362 enum { kMaxOneCharCodeSymbol = 0xFF }; |
336 | 363 |
337 // List of strings that are pre created in the vm isolate. | 364 // List of strings that are pre created in the vm isolate. |
(...skipping 23 matching lines...) Expand all Loading... |
361 // Offset of Null character which is the predefined character symbol. | 388 // Offset of Null character which is the predefined character symbol. |
362 static const int kNullCharCodeSymbolOffset = 0; | 389 static const int kNullCharCodeSymbolOffset = 0; |
363 | 390 |
364 // Access methods for one byte character symbols stored in the vm isolate. | 391 // Access methods for one byte character symbols stored in the vm isolate. |
365 static const String& Dot() { | 392 static const String& Dot() { |
366 return *(symbol_handles_[kNullCharId + '.']); | 393 return *(symbol_handles_[kNullCharId + '.']); |
367 } | 394 } |
368 static const String& Equals() { | 395 static const String& Equals() { |
369 return *(symbol_handles_[kNullCharId + '=']); | 396 return *(symbol_handles_[kNullCharId + '=']); |
370 } | 397 } |
| 398 static const String& Plus() { |
| 399 return *(symbol_handles_[kNullCharId + '+']); |
| 400 } |
| 401 static const String& Minus() { |
| 402 return *(symbol_handles_[kNullCharId + '-']); |
| 403 } |
| 404 static const String& BitOr() { |
| 405 return *(symbol_handles_[kNullCharId + '|']); |
| 406 } |
| 407 static const String& BitAnd() { |
| 408 return *(symbol_handles_[kNullCharId + '&']); |
| 409 } |
371 static const String& LAngleBracket() { | 410 static const String& LAngleBracket() { |
372 return *(symbol_handles_[kNullCharId + '<']); | 411 return *(symbol_handles_[kNullCharId + '<']); |
373 } | 412 } |
374 static const String& RAngleBracket() { | 413 static const String& RAngleBracket() { |
375 return *(symbol_handles_[kNullCharId + '>']); | 414 return *(symbol_handles_[kNullCharId + '>']); |
376 } | 415 } |
377 static const String& LParen() { | 416 static const String& LParen() { |
378 return *(symbol_handles_[kNullCharId + '(']); | 417 return *(symbol_handles_[kNullCharId + '(']); |
379 } | 418 } |
380 static const String& RParen() { | 419 static const String& RParen() { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 friend class SnapshotReader; | 553 friend class SnapshotReader; |
515 friend class SnapshotWriter; | 554 friend class SnapshotWriter; |
516 friend class ApiMessageReader; | 555 friend class ApiMessageReader; |
517 | 556 |
518 DISALLOW_COPY_AND_ASSIGN(Symbols); | 557 DISALLOW_COPY_AND_ASSIGN(Symbols); |
519 }; | 558 }; |
520 | 559 |
521 } // namespace dart | 560 } // namespace dart |
522 | 561 |
523 #endif // VM_SYMBOLS_H_ | 562 #endif // VM_SYMBOLS_H_ |
OLD | NEW |