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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 V(_String, "String") \ | 156 V(_String, "String") \ |
154 V(OneByteString, "_OneByteString") \ | 157 V(OneByteString, "_OneByteString") \ |
155 V(TwoByteString, "_TwoByteString") \ | 158 V(TwoByteString, "_TwoByteString") \ |
156 V(ExternalOneByteString, "_ExternalOneByteString") \ | 159 V(ExternalOneByteString, "_ExternalOneByteString") \ |
157 V(ExternalTwoByteString, "_ExternalTwoByteString") \ | 160 V(ExternalTwoByteString, "_ExternalTwoByteString") \ |
158 V(_CapabilityImpl, "_CapabilityImpl") \ | 161 V(_CapabilityImpl, "_CapabilityImpl") \ |
159 V(_RawReceivePortImpl, "_RawReceivePortImpl") \ | 162 V(_RawReceivePortImpl, "_RawReceivePortImpl") \ |
160 V(_SendPortImpl, "_SendPortImpl") \ | 163 V(_SendPortImpl, "_SendPortImpl") \ |
161 V(StackTrace, "StackTrace") \ | 164 V(StackTrace, "StackTrace") \ |
162 V(JSSyntaxRegExp, "_JSSyntaxRegExp") \ | 165 V(JSSyntaxRegExp, "_JSSyntaxRegExp") \ |
| 166 V(RegExp, "RegExp") \ |
| 167 V(IrregExp, ":irregexp") \ |
163 V(Object, "Object") \ | 168 V(Object, "Object") \ |
164 V(Int, "int") \ | 169 V(Int, "int") \ |
165 V(Double, "double") \ | 170 V(Double, "double") \ |
166 V(_Float32x4, "_Float32x4") \ | 171 V(_Float32x4, "_Float32x4") \ |
167 V(_Float64x2, "_Float64x2") \ | 172 V(_Float64x2, "_Float64x2") \ |
168 V(_Int32x4, "_Int32x4") \ | 173 V(_Int32x4, "_Int32x4") \ |
169 V(Float32x4, "Float32x4") \ | 174 V(Float32x4, "Float32x4") \ |
170 V(Float64x2, "Float64x2") \ | 175 V(Float64x2, "Float64x2") \ |
171 V(Int32x4, "Int32x4") \ | 176 V(Int32x4, "Int32x4") \ |
172 V(Int8List, "Int8List") \ | 177 V(Int8List, "Int8List") \ |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 V(_leftShiftWithMask32, "_leftShiftWithMask32") \ | 325 V(_leftShiftWithMask32, "_leftShiftWithMask32") \ |
321 V(OptimizedOut, "<optimized out>") \ | 326 V(OptimizedOut, "<optimized out>") \ |
322 V(NotInitialized, "<not initialized>") \ | 327 V(NotInitialized, "<not initialized>") \ |
323 V(AllocationStubFor, "Allocation stub for ") \ | 328 V(AllocationStubFor, "Allocation stub for ") \ |
324 V(TempParam, ":temp_param") \ | 329 V(TempParam, ":temp_param") \ |
325 V(_UserTag, "_UserTag") \ | 330 V(_UserTag, "_UserTag") \ |
326 V(Default, "Default") \ | 331 V(Default, "Default") \ |
327 V(StubPrefix, "[Stub] ") \ | 332 V(StubPrefix, "[Stub] ") \ |
328 V(ClassID, "ClassID") \ | 333 V(ClassID, "ClassID") \ |
329 V(DartIsVM, "dart.isVM") \ | 334 V(DartIsVM, "dart.isVM") \ |
| 335 V(stack, ":stack") \ |
| 336 V(current_character, ":current_character") \ |
| 337 V(current_position, ":current_position") \ |
| 338 V(string_param_length, ":string_param_length") \ |
| 339 V(capture_length, ":capture_length") \ |
| 340 V(word_character_map, ":word_character_map") \ |
| 341 V(match_start_index, ":match_start_index") \ |
| 342 V(capture_start_index, ":capture_start_index") \ |
| 343 V(match_end_index, ":match_end_index") \ |
| 344 V(char_in_capture, ":char_in_capture") \ |
| 345 V(char_in_match, ":char_in_match") \ |
| 346 V(result, ":result") \ |
| 347 V(position_registers, ":position_registers") \ |
| 348 V(string_param, ":string_param") \ |
| 349 V(start_index_param, ":start_index_param") \ |
| 350 V(clear, "clear") \ |
| 351 V(_wordCharacterMap, "_wordCharacterMap") \ |
| 352 V(print, "print") \ |
| 353 V(last, "last") \ |
| 354 V(removeLast, "removeLast") \ |
| 355 V(add, "add") \ |
330 | 356 |
331 | 357 |
332 // Contains a list of frequently used strings in a canonicalized form. This | 358 // 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 | 359 // list is kept in the vm_isolate in order to share the copy across isolates |
334 // without having to maintain copies in each isolate. | 360 // without having to maintain copies in each isolate. |
335 class Symbols : public AllStatic { | 361 class Symbols : public AllStatic { |
336 public: | 362 public: |
337 enum { kMaxOneCharCodeSymbol = 0xFF }; | 363 enum { kMaxOneCharCodeSymbol = 0xFF }; |
338 | 364 |
339 // List of strings that are pre created in the vm isolate. | 365 // 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. | 389 // Offset of Null character which is the predefined character symbol. |
364 static const int kNullCharCodeSymbolOffset = 0; | 390 static const int kNullCharCodeSymbolOffset = 0; |
365 | 391 |
366 // Access methods for one byte character symbols stored in the vm isolate. | 392 // Access methods for one byte character symbols stored in the vm isolate. |
367 static const String& Dot() { | 393 static const String& Dot() { |
368 return *(symbol_handles_[kNullCharId + '.']); | 394 return *(symbol_handles_[kNullCharId + '.']); |
369 } | 395 } |
370 static const String& Equals() { | 396 static const String& Equals() { |
371 return *(symbol_handles_[kNullCharId + '=']); | 397 return *(symbol_handles_[kNullCharId + '=']); |
372 } | 398 } |
| 399 static const String& Plus() { |
| 400 return *(symbol_handles_[kNullCharId + '+']); |
| 401 } |
| 402 static const String& Minus() { |
| 403 return *(symbol_handles_[kNullCharId + '-']); |
| 404 } |
| 405 static const String& BitOr() { |
| 406 return *(symbol_handles_[kNullCharId + '|']); |
| 407 } |
| 408 static const String& BitAnd() { |
| 409 return *(symbol_handles_[kNullCharId + '&']); |
| 410 } |
373 static const String& LAngleBracket() { | 411 static const String& LAngleBracket() { |
374 return *(symbol_handles_[kNullCharId + '<']); | 412 return *(symbol_handles_[kNullCharId + '<']); |
375 } | 413 } |
376 static const String& RAngleBracket() { | 414 static const String& RAngleBracket() { |
377 return *(symbol_handles_[kNullCharId + '>']); | 415 return *(symbol_handles_[kNullCharId + '>']); |
378 } | 416 } |
379 static const String& LParen() { | 417 static const String& LParen() { |
380 return *(symbol_handles_[kNullCharId + '(']); | 418 return *(symbol_handles_[kNullCharId + '(']); |
381 } | 419 } |
382 static const String& RParen() { | 420 static const String& RParen() { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 friend class SnapshotReader; | 554 friend class SnapshotReader; |
517 friend class SnapshotWriter; | 555 friend class SnapshotWriter; |
518 friend class ApiMessageReader; | 556 friend class ApiMessageReader; |
519 | 557 |
520 DISALLOW_COPY_AND_ASSIGN(Symbols); | 558 DISALLOW_COPY_AND_ASSIGN(Symbols); |
521 }; | 559 }; |
522 | 560 |
523 } // namespace dart | 561 } // namespace dart |
524 | 562 |
525 #endif // VM_SYMBOLS_H_ | 563 #endif // VM_SYMBOLS_H_ |
OLD | NEW |