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