Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
symbols.h
Go to the documentation of this 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
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_SYMBOLS_H_
6#define RUNTIME_VM_SYMBOLS_H_
7
8#include "vm/growable_array.h"
9#include "vm/object.h"
10
11namespace dart {
12
13// Forward declarations.
14class IsolateGroup;
15class ObjectPointerVisitor;
16
17// One-character symbols are added implicitly.
18#define PREDEFINED_SYMBOLS_LIST(V) \
19 V(AbiSpecificInteger, "AbiSpecificInteger") \
20 V(AbstractClassInstantiationError, "AbstractClassInstantiationError") \
21 V(_AddStreamState, "_AddStreamState") \
22 V(AllocateInvocationMirror, "_allocateInvocationMirror") \
23 V(AllocateInvocationMirrorForClosure, "_allocateInvocationMirrorForClosure") \
24 V(AnonymousClosure, "<anonymous closure>") \
25 V(ApiError, "ApiError") \
26 V(ArgDescVar, ":arg_desc") \
27 V(ArgumentError, "ArgumentError") \
28 V(Array, "Array") \
29 V(StateError, "StateError") \
30 V(AssertionError, "_AssertionError") \
31 V(AssignIndexToken, "[]=") \
32 V(Bool, "bool") \
33 V(BooleanExpression, "boolean expression") \
34 V(BoundsCheckForPartialInstantiation, "_boundsCheckForPartialInstantiation") \
35 V(ByteData, "ByteData") \
36 V(Capability, "Capability") \
37 V(CheckLoaded, "_checkLoaded") \
38 V(Class, "Class") \
39 V(ClassID, "ClassID") \
40 V(ClosureData, "ClosureData") \
41 V(ClosureParameter, ":closure") \
42 V(Code, "Code") \
43 V(CodeSourceMap, "CodeSourceMap") \
44 V(ColonMatcher, ":matcher") \
45 V(_Completer, "_Completer") \
46 V(_AsyncCompleter, "_AsyncCompleter") \
47 V(_SyncCompleter, "_SyncCompleter") \
48 V(Compound, "_Compound") \
49 V(CompressedStackMaps, "CompressedStackMaps") \
50 V(Context, "Context") \
51 V(ContextScope, "ContextScope") \
52 V(Current, "current") \
53 V(CurrentContextVar, ":current_context_var") \
54 V(DartAsync, "dart:async") \
55 V(DartCollection, "dart:collection") \
56 V(DartCore, "dart:core") \
57 V(DartDeveloper, "dart:developer") \
58 V(DartDeveloperTimeline, "dart.developer.timeline") \
59 V(DartFfi, "dart:ffi") \
60 V(DartInternal, "dart:_internal") \
61 V(DartIsVM, "dart.isVM") \
62 V(DartIsolate, "dart:isolate") \
63 V(DartLibrary, "dart.library.") \
64 V(DartLibraryFfi, "dart.library.ffi") \
65 V(DartLibraryMirrors, "dart.library.mirrors") \
66 V(DartMirrors, "dart:mirrors") \
67 V(DartNativeWrappers, "dart:nativewrappers") \
68 V(DartNativeWrappersLibName, "nativewrappers") \
69 V(DartScheme, "dart:") \
70 V(DartSchemePrivate, "dart:_") \
71 V(DartTypedData, "dart:typed_data") \
72 V(DartVMProduct, "dart.vm.product") \
73 V(DartVMService, "dart:_vmservice") \
74 V(DebugProcedureName, ":Eval") \
75 V(Default, "Default") \
76 V(DefaultLabel, ":L") \
77 V(DotCreate, "._create") \
78 V(DotFieldADI, ".fieldADI") \
79 V(DotFieldNI, ".fieldNI") \
80 V(DotRange, ".range") \
81 V(DotUnder, "._") \
82 V(DotValue, ".value") \
83 V(DotWithType, "._withType") \
84 V(Double, "double") \
85 V(Dynamic, "dynamic") \
86 V(DynamicCall, "dyn:call") \
87 V(DynamicCallCurrentFunctionVar, ":dyn_call_current_function") \
88 V(DynamicCallCurrentNumProcessedVar, ":dyn_call_current_num_processed") \
89 V(DynamicCallCurrentParamIndexVar, ":dyn_call_current_param_index") \
90 V(DynamicCallCurrentTypeParamVar, ":dyn_call_current_type_param") \
91 V(DynamicCallFunctionTypeArgsVar, ":dyn_call_function_type_args") \
92 V(DynamicPrefix, "dyn:") \
93 V(EntryPointsTemp, ":entry_points_temp") \
94 V(EqualOperator, "==") \
95 V(Error, "Error") \
96 V(EvalSourceUri, "evaluate:source") \
97 V(EvaluateAssertion, "_evaluateAssertion") \
98 V(ExceptionHandlers, "ExceptionHandlers") \
99 V(ExceptionVar, ":exception_var") \
100 V(Expando, "Expando") \
101 V(ExprTemp, ":expr_temp") \
102 V(FfiAbiSpecificMapping, "_FfiAbiSpecificMapping") \
103 V(FfiAsyncCallback, "_FfiAsyncCallback") \
104 V(FfiBool, "Bool") \
105 V(FfiCallback, "_FfiCallback") \
106 V(FfiDouble, "Double") \
107 V(FfiDynamicLibrary, "DynamicLibrary") \
108 V(FfiElementType, "elementType") \
109 V(FfiFieldPacking, "packing") \
110 V(FfiFieldTypes, "fieldTypes") \
111 V(FfiFloat, "Float") \
112 V(FfiHandle, "Handle") \
113 V(FfiInt16, "Int16") \
114 V(FfiInt32, "Int32") \
115 V(FfiInt64, "Int64") \
116 V(FfiInt8, "Int8") \
117 V(FfiIntPtr, "IntPtr") \
118 V(FfiIsolateLocalCallback, "_FfiIsolateLocalCallback") \
119 V(FfiNative, "Native") \
120 V(FfiNativeFunction, "NativeFunction") \
121 V(FfiNativeType, "NativeType") \
122 V(FfiNativeTypes, "nativeTypes") \
123 V(FfiPointer, "Pointer") \
124 V(FfiFromAddress, "_fromAddress") \
125 V(FfiStructLayout, "_FfiStructLayout") \
126 V(FfiStructLayoutArray, "_FfiInlineArray") \
127 V(FfiTrampolineData, "FfiTrampolineData") \
128 V(FfiUint16, "Uint16") \
129 V(FfiUint32, "Uint32") \
130 V(FfiUint64, "Uint64") \
131 V(FfiUint8, "Uint8") \
132 V(FfiVoid, "Void") \
133 V(Field, "Field") \
134 V(Finalizable, "Finalizable") \
135 V(FinalizerBase, "FinalizerBase") \
136 V(FinalizerEntry, "FinalizerEntry") \
137 V(FinallyRetVal, ":finally_ret_val") \
138 V(FirstArg, "x") \
139 V(Float32List, "Float32List") \
140 V(Float32x4, "Float32x4") \
141 V(Float32x4List, "Float32x4List") \
142 V(Float64List, "Float64List") \
143 V(Float64x2, "Float64x2") \
144 V(Float64x2List, "Float64x2List") \
145 V(FormatException, "FormatException") \
146 V(ForwardingCorpse, "ForwardingCorpse") \
147 V(FreeListElement, "FreeListElement") \
148 V(Function, "Function") \
149 V(FunctionResult, "function result") \
150 V(FunctionTypeArgumentsVar, ":function_type_arguments_var") \
151 V(Future, "Future") \
152 V(_Future, "_Future") \
153 V(FutureOr, "FutureOr") \
154 V(FutureValue, "Future.value") \
155 V(GetCall, "get:call") \
156 V(GetLength, "get:length") \
157 V(GetRuntimeType, "get:runtimeType") \
158 V(GetterPrefix, "get:") \
159 V(Get_fieldNames, "get:_fieldNames") \
160 V(GreaterEqualOperator, ">=") \
161 V(HaveSameRuntimeType, "_haveSameRuntimeType") \
162 V(ICData, "ICData") \
163 V(Identical, "identical") \
164 V(InTypeCast, " in type cast") \
165 V(Index, "index") \
166 V(IndexToken, "[]") \
167 V(InitPrefix, "init:") \
168 V(Instructions, "Instructions") \
169 V(InstructionsSection, "InstructionsSection") \
170 V(InstructionsTable, "InstructionsTable") \
171 V(Int, "int") \
172 V(Int16List, "Int16List") \
173 V(Int32List, "Int32List") \
174 V(Int32x4, "Int32x4") \
175 V(Int32x4List, "Int32x4List") \
176 V(Int64List, "Int64List") \
177 V(Int8List, "Int8List") \
178 V(IntegerDivisionByZeroException, "IntegerDivisionByZeroException") \
179 V(Interpolate, "_interpolate") \
180 V(InterpolateSingle, "_interpolateSingle") \
181 V(InvocationMirror, "_InvocationMirror") \
182 V(IsolateSpawnException, "IsolateSpawnException") \
183 V(Iterable, "Iterable") \
184 V(Iterator, "iterator") \
185 V(KernelProgramInfo, "KernelProgramInfo") \
186 V(LanguageError, "LanguageError") \
187 V(LateError, "LateError") \
188 V(LeftShiftOperator, "<<") \
189 V(Length, "length") \
190 V(LessEqualOperator, "<=") \
191 V(LibraryClass, "Library") \
192 V(LibraryPrefix, "LibraryPrefix") \
193 V(List, "List") \
194 V(ListFactory, "List.") \
195 V(ListFilledFactory, "List.filled") \
196 V(LoadLibrary, "_loadLibrary") \
197 V(LoadingUnit, "LoadingUnit") \
198 V(LocalVarDescriptors, "LocalVarDescriptors") \
199 V(Map, "Map") \
200 V(MapLiteralFactory, "Map._fromLiteral") \
201 V(MegamorphicCache, "MegamorphicCache") \
202 V(MonomorphicSmiableCall, "MonomorphicSmiableCall") \
203 V(MoveNext, "moveNext") \
204 V(Namespace, "Namespace") \
205 V(Never, "Never") \
206 V(NoSuchMethod, "noSuchMethod") \
207 V(NoSuchMethodError, "NoSuchMethodError") \
208 V(Null, "Null") \
209 V(Number, "num") \
210 V(Object, "Object") \
211 V(ObjectPool, "ObjectPool") \
212 V(OneByteString, "_OneByteString") \
213 V(OptimizedOut, "<optimized out>") \
214 V(OriginalParam, ":original:") \
215 V(OutOfMemoryError, "OutOfMemoryError") \
216 V(PackageScheme, "package:") \
217 V(Patch, "patch") \
218 V(PatchClass, "PatchClass") \
219 V(PcDescriptors, "PcDescriptors") \
220 V(Pragma, "pragma") \
221 V(PrependTypeArguments, "_prependTypeArguments") \
222 V(QuoteIsNotASubtypeOf, "' is not a subtype of ") \
223 V(RangeError, "RangeError") \
224 V(Record, "Record") \
225 V(RegExp, "RegExp") \
226 V(RightShiftOperator, ">>") \
227 V(SavedTryContextVar, ":saved_try_context_var") \
228 V(Script, "Script") \
229 V(SecondArg, "y") \
230 V(SendPort, "SendPort") \
231 V(Sentinel, "Sentinel") \
232 V(Set, "Set") \
233 V(SetterPrefix, "set:") \
234 V(SingleTargetCache, "SingleTargetCache") \
235 V(SpaceIsFromSpace, " is from ") \
236 V(SpaceOfSpace, " of ") \
237 V(SpaceWhereNewLine, " where\n") \
238 V(StackOverflowError, "StackOverflowError") \
239 V(Stream, "Stream") \
240 V(StringBase, "_StringBase") \
241 V(Struct, "Struct") \
242 V(SubtypeTestCache, "SubtypeTestCache") \
243 V(SuspendStateVar, ":suspend_state_var") \
244 V(SwitchExpr, ":switch_expr") \
245 V(Symbol, "Symbol") \
246 V(ThrowNew, "_throwNew") \
247 V(ThrowNewSource, "_throwNewSource") \
248 V(ThrowNewInvocation, "_throwNewInvocation") \
249 V(TopLevel, "::") \
250 V(TransferableTypedData, "TransferableTypedData") \
251 V(TruncDivOperator, "~/") \
252 V(TryFinallyReturnValue, ":try_finally_return_value") \
253 V(TwoByteString, "_TwoByteString") \
254 V(TwoSpaces, " ") \
255 V(Type, "Type") \
256 V(TypeArguments, "TypeArguments") \
257 V(TypeArgumentsParameter, ":type_arguments") \
258 V(TypedData, "TypedData") \
259 V(TypeError, "_TypeError") \
260 V(TypeParameters, "TypeParameters") \
261 V(TypeQuote, "type '") \
262 V(Uint16List, "Uint16List") \
263 V(Uint32List, "Uint32List") \
264 V(Uint64List, "Uint64List") \
265 V(Uint8ClampedList, "Uint8ClampedList") \
266 V(Uint8List, "Uint8List") \
267 V(UnaryMinus, "unary-") \
268 V(UnhandledException, "UnhandledException") \
269 V(Union, "Union") \
270 V(UnlinkedCall, "UnlinkedCall") \
271 V(UnsafeCast, "unsafeCast") \
272 V(UnsignedRightShiftOperator, ">>>") \
273 V(UnsupportedError, "UnsupportedError") \
274 V(UnwindError, "UnwindError") \
275 V(Value, "value") \
276 V(Values, "values") \
277 V(VarArgs, "VarArgs") \
278 V(WeakArray, "WeakArray") \
279 V(WeakSerializationReference, "WeakSerializationReference") \
280 V(_AsyncStarStreamController, "_AsyncStarStreamController") \
281 V(_BufferingStreamSubscription, "_BufferingStreamSubscription") \
282 V(_ByteBuffer, "_ByteBuffer") \
283 V(_ByteBufferDot_New, "_ByteBuffer._New") \
284 V(_ByteDataView, "_ByteDataView") \
285 V(_Capability, "_Capability") \
286 V(_ClassMirror, "_ClassMirror") \
287 V(_Closure, "_Closure") \
288 V(_ClosureCall, "_Closure.call") \
289 V(_CombinatorMirror, "_CombinatorMirror") \
290 V(_CompileTimeError, "_CompileTimeError") \
291 V(_ConstMap, "_ConstMap") \
292 V(_ConstSet, "_ConstSet") \
293 V(_ControllerSubscription, "_ControllerSubscription") \
294 V(_CyclicInitializationError, "_CyclicInitializationError") \
295 V(_DeletedEnumPrefix, "Deleted enum value from ") \
296 V(_DeletedEnumSentinel, "_deleted_enum_sentinel") \
297 V(_Double, "_Double") \
298 V(_Enum, "_Enum") \
299 V(_ExternalFloat32Array, "_ExternalFloat32Array") \
300 V(_ExternalFloat32x4Array, "_ExternalFloat32x4Array") \
301 V(_ExternalFloat64Array, "_ExternalFloat64Array") \
302 V(_ExternalFloat64x2Array, "_ExternalFloat64x2Array") \
303 V(_ExternalInt16Array, "_ExternalInt16Array") \
304 V(_ExternalInt32Array, "_ExternalInt32Array") \
305 V(_ExternalInt32x4Array, "_ExternalInt32x4Array") \
306 V(_ExternalInt64Array, "_ExternalInt64Array") \
307 V(_ExternalInt8Array, "_ExternalInt8Array") \
308 V(_ExternalUint16Array, "_ExternalUint16Array") \
309 V(_ExternalUint32Array, "_ExternalUint32Array") \
310 V(_ExternalUint64Array, "_ExternalUint64Array") \
311 V(_ExternalUint8Array, "_ExternalUint8Array") \
312 V(_ExternalUint8ClampedArray, "_ExternalUint8ClampedArray") \
313 V(_FinalizerImpl, "_FinalizerImpl") \
314 V(_Float32ArrayFactory, "Float32List.") \
315 V(_Float32ArrayView, "_Float32ArrayView") \
316 V(_Float32List, "_Float32List") \
317 V(_Float32x4, "_Float32x4") \
318 V(_Float32x4ArrayFactory, "Float32x4List.") \
319 V(_Float32x4ArrayView, "_Float32x4ArrayView") \
320 V(_Float32x4List, "_Float32x4List") \
321 V(_Float64ArrayFactory, "Float64List.") \
322 V(_Float64ArrayView, "_Float64ArrayView") \
323 V(_Float64List, "_Float64List") \
324 V(_Float64x2, "_Float64x2") \
325 V(_Float64x2ArrayFactory, "Float64x2List.") \
326 V(_Float64x2ArrayView, "_Float64x2ArrayView") \
327 V(_Float64x2List, "_Float64x2List") \
328 V(_FunctionType, "_FunctionType") \
329 V(_FunctionTypeMirror, "_FunctionTypeMirror") \
330 V(_FutureListener, "_FutureListener") \
331 V(_GrowableList, "_GrowableList") \
332 V(_GrowableListFactory, "_GrowableList.") \
333 V(_GrowableListFilledFactory, "_GrowableList.filled") \
334 V(_GrowableListGenerateFactory, "_GrowableList.generate") \
335 V(_GrowableListLiteralFactory, "_GrowableList._literal") \
336 V(_GrowableListWithData, "_GrowableList._withData") \
337 V(_ImmutableList, "_ImmutableList") \
338 V(_Int16ArrayFactory, "Int16List.") \
339 V(_Int16ArrayView, "_Int16ArrayView") \
340 V(_Int16List, "_Int16List") \
341 V(_Int32ArrayFactory, "Int32List.") \
342 V(_Int32ArrayView, "_Int32ArrayView") \
343 V(_Int32List, "_Int32List") \
344 V(_Int32x4, "_Int32x4") \
345 V(_Int32x4ArrayFactory, "Int32x4List.") \
346 V(_Int32x4ArrayView, "_Int32x4ArrayView") \
347 V(_Int32x4List, "_Int32x4List") \
348 V(_Int64ArrayFactory, "Int64List.") \
349 V(_Int64ArrayView, "_Int64ArrayView") \
350 V(_Int64List, "_Int64List") \
351 V(_Int8ArrayFactory, "Int8List.") \
352 V(_Int8ArrayView, "_Int8ArrayView") \
353 V(_Int8List, "_Int8List") \
354 V(_IntegerImplementation, "_IntegerImplementation") \
355 V(_IsolateMirror, "_IsolateMirror") \
356 V(_LibraryDependencyMirror, "_LibraryDependencyMirror") \
357 V(_LibraryMirror, "_LibraryMirror") \
358 V(_LibraryPrefix, "_LibraryPrefix") \
359 V(_List, "_List") \
360 V(_ListFactory, "_List.") \
361 V(_ListFilledFactory, "_List.filled") \
362 V(_ListGenerateFactory, "_List.generate") \
363 V(_Map, "_Map") \
364 V(_MethodMirror, "_MethodMirror") \
365 V(_Mint, "_Mint") \
366 V(_MirrorReference, "_MirrorReference") \
367 V(_NativeFinalizer, "_NativeFinalizer") \
368 V(_ParameterMirror, "_ParameterMirror") \
369 V(_Random, "_Random") \
370 V(_RawReceivePort, "_RawReceivePort") \
371 V(_Record, "_Record") \
372 V(_RecordType, "_RecordType") \
373 V(_RegExp, "_RegExp") \
374 V(_SendPort, "_SendPort") \
375 V(_Set, "_Set") \
376 V(_Smi, "_Smi") \
377 V(_SourceLocation, "_SourceLocation") \
378 V(_SpecialTypeMirror, "_SpecialTypeMirror") \
379 V(_StackTrace, "_StackTrace") \
380 V(_StreamController, "_StreamController") \
381 V(_StreamControllerAddStreamState, "_StreamControllerAddStreamState") \
382 V(_StreamIterator, "_StreamIterator") \
383 V(_String, "String") \
384 V(_SuspendState, "_SuspendState") \
385 V(_SyncStarIterator, "_SyncStarIterator") \
386 V(_SyncStreamController, "_SyncStreamController") \
387 V(_TransferableTypedDataImpl, "_TransferableTypedDataImpl") \
388 V(_Type, "_Type") \
389 V(_TypeParameter, "_TypeParameter") \
390 V(_TypeVariableMirror, "_TypeVariableMirror") \
391 V(_TypedList, "_TypedList") \
392 V(_TypedListBase, "_TypedListBase") \
393 V(_Uint16ArrayFactory, "Uint16List.") \
394 V(_Uint16ArrayView, "_Uint16ArrayView") \
395 V(_Uint16List, "_Uint16List") \
396 V(_Uint32ArrayFactory, "Uint32List.") \
397 V(_Uint32ArrayView, "_Uint32ArrayView") \
398 V(_Uint32List, "_Uint32List") \
399 V(_Uint64ArrayFactory, "Uint64List.") \
400 V(_Uint64ArrayView, "_Uint64ArrayView") \
401 V(_Uint64List, "_Uint64List") \
402 V(_Uint8ArrayFactory, "Uint8List.") \
403 V(_Uint8ArrayView, "_Uint8ArrayView") \
404 V(_Uint8ClampedArrayFactory, "Uint8ClampedList.") \
405 V(_Uint8ClampedArrayView, "_Uint8ClampedArrayView") \
406 V(_Uint8ClampedList, "_Uint8ClampedList") \
407 V(_Uint8List, "_Uint8List") \
408 V(_UnmodifiableByteDataView, "_UnmodifiableByteDataView") \
409 V(_UnmodifiableFloat32ArrayView, "_UnmodifiableFloat32ArrayView") \
410 V(_UnmodifiableFloat32x4ArrayView, "_UnmodifiableFloat32x4ArrayView") \
411 V(_UnmodifiableFloat64ArrayView, "_UnmodifiableFloat64ArrayView") \
412 V(_UnmodifiableFloat64x2ArrayView, "_UnmodifiableFloat64x2ArrayView") \
413 V(_UnmodifiableInt16ArrayView, "_UnmodifiableInt16ArrayView") \
414 V(_UnmodifiableInt32ArrayView, "_UnmodifiableInt32ArrayView") \
415 V(_UnmodifiableInt32x4ArrayView, "_UnmodifiableInt32x4ArrayView") \
416 V(_UnmodifiableInt64ArrayView, "_UnmodifiableInt64ArrayView") \
417 V(_UnmodifiableInt8ArrayView, "_UnmodifiableInt8ArrayView") \
418 V(_UnmodifiableUint16ArrayView, "_UnmodifiableUint16ArrayView") \
419 V(_UnmodifiableUint32ArrayView, "_UnmodifiableUint32ArrayView") \
420 V(_UnmodifiableUint64ArrayView, "_UnmodifiableUint64ArrayView") \
421 V(_UnmodifiableUint8ArrayView, "_UnmodifiableUint8ArrayView") \
422 V(_UnmodifiableUint8ClampedArrayView, "_UnmodifiableUint8ClampedArrayView") \
423 V(_UserTag, "_UserTag") \
424 V(_Utf8Decoder, "_Utf8Decoder") \
425 V(_VariableMirror, "_VariableMirror") \
426 V(_WeakProperty, "_WeakProperty") \
427 V(_WeakReference, "_WeakReference") \
428 V(_await, "_await") \
429 V(_awaitWithTypeCheck, "_awaitWithTypeCheck") \
430 V(_backtrackingStack, "_backtrackingStack") \
431 V(_checkSetRangeArguments, "_checkSetRangeArguments") \
432 V(_current, "_current") \
433 V(_ensureScheduleImmediate, "_ensureScheduleImmediate") \
434 V(_ffi_resolver_function, "_ffi_resolver_function") \
435 V(future, "future") \
436 V(_future, "_future") \
437 V(_getRegisters, "_getRegisters") \
438 V(_growBacktrackingStack, "_growBacktrackingStack") \
439 V(_handleException, "_handleException") \
440 V(_handleFinalizerMessage, "_handleFinalizerMessage") \
441 V(_handleMessage, "_handleMessage") \
442 V(_handleNativeFinalizerMessage, "_handleNativeFinalizerMessage") \
443 V(_hasValue, "_hasValue") \
444 V(_initAsync, "_initAsync") \
445 V(_initAsyncStar, "_initAsyncStar") \
446 V(_initSyncStar, "_initSyncStar") \
447 V(_instanceOf, "_instanceOf") \
448 V(_listGetAt, "_listGetAt") \
449 V(_listLength, "_listLength") \
450 V(_listSetAt, "_listSetAt") \
451 V(_lookupHandler, "_lookupHandler") \
452 V(_lookupOpenPorts, "_lookupOpenPorts") \
453 V(_mapContainsKey, "_mapContainsKey") \
454 V(_mapGet, "_mapGet") \
455 V(_mapKeys, "_mapKeys") \
456 V(_name, "_name") \
457 V(_nextListener, "_nextListener") \
458 V(_nativeGetFloat32, "_nativeGetFloat32") \
459 V(_nativeSetFloat32, "_nativeSetFloat32") \
460 V(_nativeGetFloat64, "_nativeGetFloat64") \
461 V(_nativeSetFloat64, "_nativeSetFloat64") \
462 V(_nativeGetFloat32x4, "_nativeGetFloat32x4") \
463 V(_nativeSetFloat32x4, "_nativeSetFloat32x4") \
464 V(_nativeGetInt32x4, "_nativeGetInt32x4") \
465 V(_nativeSetInt32x4, "_nativeSetInt32x4") \
466 V(_nativeGetFloat64x2, "_nativeGetFloat64x2") \
467 V(_nativeSetFloat64x2, "_nativeSetFloat64x2") \
468 V(_nativeSetRange, "_nativeSetRange") \
469 V(_objectEquals, "_objectEquals") \
470 V(_objectHashCode, "_objectHashCode") \
471 V(_objectNoSuchMethod, "_objectNoSuchMethod") \
472 V(_objectToString, "_objectToString") \
473 V(_offsetInBytes, "_offsetInBytes") \
474 V(_onData, "_onData") \
475 V(_onDone, "_onDone") \
476 V(_onError, "_onError") \
477 V(_rehashObjects, "_rehashObjects") \
478 V(_resultOrListeners, "_resultOrListeners") \
479 V(_returnAsync, "_returnAsync") \
480 V(_returnAsyncNotFuture, "_returnAsyncNotFuture") \
481 V(_returnAsyncStar, "_returnAsyncStar") \
482 V(_runExtension, "_runExtension") \
483 V(_runPendingImmediateCallback, "_runPendingImmediateCallback") \
484 V(_scanFlags, "_scanFlags") \
485 V(_simpleInstanceOf, "_simpleInstanceOf") \
486 V(_simpleInstanceOfFalse, "_simpleInstanceOfFalse") \
487 V(_simpleInstanceOfTrue, "_simpleInstanceOfTrue") \
488 V(_stackTrace, "_stackTrace") \
489 V(_state, "_state") \
490 V(_stateData, "_stateData") \
491 V(_suspendSyncStarAtStart, "_suspendSyncStarAtStart") \
492 V(_toString, "_toString") \
493 V(_typedDataBase, "_typedDataBase") \
494 V(_varData, "_varData") \
495 V(_wordCharacterMap, "_wordCharacterMap") \
496 V(_yieldAsyncStar, "_yieldAsyncStar") \
497 V(_yieldStarIterable, "_yieldStarIterable") \
498 V(_yieldSyncStar, "_yieldSyncStar") \
499 V(absolute, "absolute") \
500 V(add, "add") \
501 V(addStream, "addStream") \
502 V(addStreamFuture, "addStreamFuture") \
503 V(asyncStarBody, "asyncStarBody") \
504 V(byteOffset, "byteOffset") \
505 V(c_result, ":result") \
506 V(call, "call") \
507 V(callback, "callback") \
508 V(capture_length, ":capture_length") \
509 V(capture_start_index, ":capture_start_index") \
510 V(char_in_capture, ":char_in_capture") \
511 V(char_in_match, ":char_in_match") \
512 V(controller, "controller") \
513 V(current_character, ":current_character") \
514 V(current_position, ":current_position") \
515 V(dynamic_assert_assignable_stc_check, \
516 ":dynamic_assert_assignable_stc_check") \
517 V(end, "end") \
518 V(executable, "executable") \
519 V(from, "from") \
520 V(get, "get") \
521 V(index_temp, ":index_temp") \
522 V(isLeaf, "isLeaf") \
523 V(isPaused, "isPaused") \
524 V(match_end_index, ":match_end_index") \
525 V(match_start_index, ":match_start_index") \
526 V(name, "name") \
527 V(native_assets, "native-assets") \
528 V(null, "null") \
529 V(options, "options") \
530 V(position_registers, ":position_registers") \
531 V(print, "print") \
532 V(process, "process") \
533 V(relative, "relative") \
534 V(result, "result") \
535 V(set, "set") \
536 V(skip_count, "skipCount") \
537 V(stack, ":stack") \
538 V(stack_pointer, ":stack_pointer") \
539 V(start, "start") \
540 V(start_index_param, ":start_index_param") \
541 V(state, "state") \
542 V(string_param, ":string_param") \
543 V(string_param_length, ":string_param_length") \
544 V(system, "system") \
545 V(vm_always_consider_inlining, "vm:always-consider-inlining") \
546 V(vm_awaiter_link, "vm:awaiter-link") \
547 V(vm_entry_point, "vm:entry-point") \
548 V(vm_exact_result_type, "vm:exact-result-type") \
549 V(vm_external_name, "vm:external-name") \
550 V(vm_ffi_abi_specific_mapping, "vm:ffi:abi-specific-mapping") \
551 V(vm_ffi_call_closure, "vm:ffi:call-closure") \
552 V(vm_ffi_native, "vm:ffi:native") \
553 V(vm_ffi_native_assets, "vm:ffi:native-assets") \
554 V(vm_ffi_struct_fields, "vm:ffi:struct-fields") \
555 V(vm_force_optimize, "vm:force-optimize") \
556 V(vm_idempotent, "vm:idempotent") \
557 V(vm_invisible, "vm:invisible") \
558 V(vm_isolate_unsendable, "vm:isolate-unsendable") \
559 V(vm_cachable_idempotent, "vm:cachable-idempotent") \
560 V(vm_never_inline, "vm:never-inline") \
561 V(vm_non_nullable_result_type, "vm:non-nullable-result-type") \
562 V(vm_notify_debugger_on_exception, "vm:notify-debugger-on-exception") \
563 V(vm_prefer_inline, "vm:prefer-inline") \
564 V(vm_recognized, "vm:recognized") \
565 V(vm_testing_print_flow_graph, "vm:testing:print-flow-graph") \
566 V(vm_trace_entrypoints, "vm:testing.unsafe.trace-entrypoints-fn") \
567 V(vm_unsafe_no_interrupts, "vm:unsafe:no-interrupts") \
568 V(vm_align_loops, "vm:align-loops") \
569 V(vm_unsafe_no_bounds_checks, "vm:unsafe:no-bounds-checks")
570
571// Contains a list of frequently used strings in a canonicalized form. This
572// list is kept in the vm_isolate in order to share the copy across isolates
573// without having to maintain copies in each isolate.
574class Symbols : public AllStatic {
575 public:
576 enum { kMaxOneCharCodeSymbol = 0xFF };
577
578 // List of strings that are pre created in the vm isolate.
579 enum SymbolId {
580 // clang-format off
582
583#define DEFINE_SYMBOL_INDEX(symbol, literal) k##symbol##Id,
585#undef DEFINE_SYMBOL_INDEX
586
587 kTokenTableStart, // First token at kTokenTableStart + 1.
588
589#define DEFINE_TOKEN_SYMBOL_INDEX(t, s, p, a) t##Id,
592#undef DEFINE_TOKEN_SYMBOL_INDEX
593
594 kNullCharId, // One char code symbol starts here and takes up 256 entries.
596 // clang-format on
597 };
598
599 // Number of one character symbols being predefined in the predefined_ array.
600 static constexpr int kNumberOfOneCharCodeSymbols =
601 (kMaxPredefinedId - kNullCharId);
602
603 // Offset of Null character which is the predefined character symbol.
604 static constexpr int kNullCharCodeSymbolOffset = 0;
605
606 static const String& Symbol(intptr_t index) {
607 ASSERT((index > kIllegal) && (index < kMaxPredefinedId));
608 return *(symbol_handles_[index]);
609 }
610
611 // Access methods for one byte character symbols stored in the vm isolate.
612 static const String& Dot() { return *(symbol_handles_[kNullCharId + '.']); }
613 static const String& Equals() {
614 return *(symbol_handles_[kNullCharId + '=']);
615 }
616 static const String& Plus() { return *(symbol_handles_[kNullCharId + '+']); }
617 static const String& Minus() { return *(symbol_handles_[kNullCharId + '-']); }
618 static const String& BitOr() { return *(symbol_handles_[kNullCharId + '|']); }
619 static const String& BitAnd() {
620 return *(symbol_handles_[kNullCharId + '&']);
621 }
622 static const String& LAngleBracket() {
623 return *(symbol_handles_[kNullCharId + '<']);
624 }
625 static const String& RAngleBracket() {
626 return *(symbol_handles_[kNullCharId + '>']);
627 }
628 static const String& LParen() {
629 return *(symbol_handles_[kNullCharId + '(']);
630 }
631 static const String& RParen() {
632 return *(symbol_handles_[kNullCharId + ')']);
633 }
634 static const String& LBracket() {
635 return *(symbol_handles_[kNullCharId + '[']);
636 }
637 static const String& RBracket() {
638 return *(symbol_handles_[kNullCharId + ']']);
639 }
640 static const String& LBrace() {
641 return *(symbol_handles_[kNullCharId + '{']);
642 }
643 static const String& RBrace() {
644 return *(symbol_handles_[kNullCharId + '}']);
645 }
646 static const String& Blank() { return *(symbol_handles_[kNullCharId + ' ']); }
647 static const String& Dollar() {
648 return *(symbol_handles_[kNullCharId + '$']);
649 }
650 static const String& NewLine() {
651 return *(symbol_handles_[kNullCharId + '\n']);
652 }
653 static const String& DoubleQuote() {
654 return *(symbol_handles_[kNullCharId + '"']);
655 }
656 static const String& SingleQuote() {
657 return *(symbol_handles_[kNullCharId + '\'']);
658 }
659 static const String& LowercaseR() {
660 return *(symbol_handles_[kNullCharId + 'r']);
661 }
662 static const String& Dash() { return *(symbol_handles_[kNullCharId + '-']); }
663 static const String& Ampersand() {
664 return *(symbol_handles_[kNullCharId + '&']);
665 }
666 static const String& Backtick() {
667 return *(symbol_handles_[kNullCharId + '`']);
668 }
669 static const String& Slash() { return *(symbol_handles_[kNullCharId + '/']); }
670 static const String& At() { return *(symbol_handles_[kNullCharId + '@']); }
671 static const String& HashMark() {
672 return *(symbol_handles_[kNullCharId + '#']);
673 }
674 static const String& Semicolon() {
675 return *(symbol_handles_[kNullCharId + ';']);
676 }
677 static const String& Star() { return *(symbol_handles_[kNullCharId + '*']); }
678 static const String& Percent() {
679 return *(symbol_handles_[kNullCharId + '%']);
680 }
681 static const String& QuestionMark() {
682 return *(symbol_handles_[kNullCharId + '?']);
683 }
684 static const String& Caret() { return *(symbol_handles_[kNullCharId + '^']); }
685 static const String& Tilde() { return *(symbol_handles_[kNullCharId + '~']); }
686
687 static const String& Empty() { return *(symbol_handles_[kTokenTableStart]); }
688 static const String& False() { return *(symbol_handles_[kFALSEId]); }
689 static const String& Library() { return *(symbol_handles_[kLIBRARYId]); }
690 static const String& Super() { return *(symbol_handles_[kSUPERId]); }
691 static const String& This() { return *(symbol_handles_[kTHISId]); }
692 static const String& True() { return *(symbol_handles_[kTRUEId]); }
693 static const String& Void() { return *(symbol_handles_[kVOIDId]); }
694
695// Access methods for symbol handles stored in the vm isolate for predefined
696// symbols.
697#define DEFINE_SYMBOL_HANDLE_ACCESSOR(symbol, literal) \
698 static const String& symbol() { return *(symbol_handles_[k##symbol##Id]); }
700#undef DEFINE_SYMBOL_HANDLE_ACCESSOR
701
702// Access methods for symbol handles stored in the vm isolate for keywords.
703#define DEFINE_SYMBOL_HANDLE_ACCESSOR(t, s, p, a) \
704 static const String& t() { return *(symbol_handles_[t##Id]); }
707#undef DEFINE_SYMBOL_HANDLE_ACCESSOR
708
709 // Get symbol for scanner token.
710 static const String& Token(Token::Kind token);
711
712 // Initialize frequently used symbols in the vm isolate.
713 static void Init(IsolateGroup* isolate_group);
714 static void InitFromSnapshot(IsolateGroup* isolate_group);
715
716 // Initialize and setup a symbol table for the isolate.
717 static void SetupSymbolTable(IsolateGroup* isolate_group);
718
719 // Creates a Symbol given a C string that is assumed to contain
720 // UTF-8 encoded characters and '\0' is considered a termination character.
721 // TODO(7123) - Rename this to FromCString(....).
722 static StringPtr New(Thread* thread, const char* cstr) {
723 return New(thread, cstr, strlen(cstr));
724 }
725 static StringPtr New(Thread* thread, const char* cstr, intptr_t length);
726
727 // Creates a new Symbol from an array of UTF-8 encoded characters.
728 static StringPtr FromUTF8(Thread* thread,
729 const uint8_t* utf8_array,
730 intptr_t len);
731
732 // Creates a new Symbol from an array of Latin-1 encoded characters.
733 static StringPtr FromLatin1(Thread* thread,
734 const uint8_t* latin1_array,
735 intptr_t len);
736
737 // Creates a new Symbol from an array of UTF-16 encoded characters.
738 static StringPtr FromUTF16(Thread* thread,
739 const uint16_t* utf16_array,
740 intptr_t len);
741
742 static StringPtr New(Thread* thread, const String& str);
743 static StringPtr New(Thread* thread,
744 const String& str,
745 intptr_t begin_index,
746 intptr_t length);
747
748 static StringPtr NewFormatted(Thread* thread, const char* format, ...)
749 PRINTF_ATTRIBUTE(2, 3);
750 static StringPtr NewFormattedV(Thread* thread,
751 const char* format,
752 va_list args);
753
754 static StringPtr FromConcat(Thread* thread,
755 const String& str1,
756 const String& str2);
757
758 static StringPtr FromConcatAll(
759 Thread* thread,
760 const GrowableHandlePtrArray<const String>& strs);
761
762 static StringPtr FromGet(Thread* thread, const String& str);
763 static StringPtr FromSet(Thread* thread, const String& str);
764 static StringPtr FromDot(Thread* thread, const String& str);
765
766 // Returns char* of predefined symbol.
767 static const char* Name(SymbolId symbol);
768
769 static StringPtr FromCharCode(Thread* thread, uint16_t char_code);
770
771 static StringPtr* PredefinedAddress() {
772 return reinterpret_cast<StringPtr*>(&predefined_);
773 }
774
775 static void DumpStats(IsolateGroup* isolate_group);
776 static void DumpTable(IsolateGroup* isolate_group);
777
778 // Returns Symbol::Null if no symbol is found.
779 template <typename StringType>
780 static StringPtr Lookup(Thread* thread, const StringType& str);
781
782 // Returns Symbol::Null if no symbol is found.
783 static StringPtr LookupFromConcat(Thread* thread,
784 const String& str1,
785 const String& str2);
786
787 static StringPtr LookupFromGet(Thread* thread, const String& str);
788 static StringPtr LookupFromSet(Thread* thread, const String& str);
789 static StringPtr LookupFromDot(Thread* thread, const String& str);
790
791 static void GetStats(IsolateGroup* isolate_group,
792 intptr_t* size,
793 intptr_t* capacity);
794
795 private:
796 enum { kInitialVMIsolateSymtabSize = 1024, kInitialSymtabSize = 2048 };
797
798 template <typename StringType>
799 static StringPtr NewSymbol(Thread* thread, const StringType& str);
800
801 // List of Latin1 characters stored in the vm isolate as symbols
802 // in order to make Symbols::FromCharCode fast. This structure is
803 // used in generated dart code for direct access to these objects.
804 static StringPtr predefined_[kNumberOfOneCharCodeSymbols];
805
806 // List of handles for predefined symbols.
807 static String* symbol_handles_[kMaxPredefinedId];
808
809 friend class Dart;
810 friend class String;
811 friend class Serializer;
812 friend class Deserializer;
813
815};
816
817} // namespace dart
818
819#endif // RUNTIME_VM_SYMBOLS_H_
static void GetStats(IsolateGroup *isolate_group, intptr_t *size, intptr_t *capacity)
Definition symbols.cc:180
static const String & Percent()
Definition symbols.h:678
static void InitFromSnapshot(IsolateGroup *isolate_group)
Definition symbols.cc:127
static const String & Symbol(intptr_t index)
Definition symbols.h:606
static const String & HashMark()
Definition symbols.h:671
static const String & True()
Definition symbols.h:692
static const String & DoubleQuote()
Definition symbols.h:653
static const String & Super()
Definition symbols.h:690
static const String & Plus()
Definition symbols.h:616
static StringPtr Lookup(Thread *thread, const StringType &str)
Definition symbols.cc:375
static const char * Name(SymbolId symbol)
Definition symbols.cc:66
static const String & LowercaseR()
Definition symbols.h:659
static StringPtr LookupFromDot(Thread *thread, const String &str)
Definition symbols.cc:432
static StringPtr static StringPtr NewFormattedV(Thread *thread, const char *format, va_list args)
Definition symbols.cc:459
static const String & RParen()
Definition symbols.h:631
static const String & NewLine()
Definition symbols.h:650
static StringPtr LookupFromGet(Thread *thread, const String &str)
Definition symbols.cc:424
static const String & LAngleBracket()
Definition symbols.h:622
static StringPtr FromConcat(Thread *thread, const String &str1, const String &str2)
Definition symbols.cc:235
static const String & BitOr()
Definition symbols.h:618
static const String & Dollar()
Definition symbols.h:647
static const String & Caret()
Definition symbols.h:684
@ kMaxOneCharCodeSymbol
Definition symbols.h:576
static StringPtr LookupFromSet(Thread *thread, const String &str)
Definition symbols.cc:428
static StringPtr FromUTF16(Thread *thread, const uint16_t *utf16_array, intptr_t len)
Definition symbols.cc:229
static const String & Library()
Definition symbols.h:689
static constexpr int kNumberOfOneCharCodeSymbols
Definition symbols.h:600
static StringPtr FromGet(Thread *thread, const String &str)
Definition symbols.cc:247
static StringPtr FromSet(Thread *thread, const String &str)
Definition symbols.cc:251
static const String & Tilde()
Definition symbols.h:685
static StringPtr FromDot(Thread *thread, const String &str)
Definition symbols.cc:255
static StringPtr FromCharCode(Thread *thread, uint16_t char_code)
Definition symbols.cc:474
static const String & RAngleBracket()
Definition symbols.h:625
static const String & False()
Definition symbols.h:688
static void SetupSymbolTable(IsolateGroup *isolate_group)
Definition symbols.cc:168
friend class String
Definition symbols.h:810
static StringPtr FromConcatAll(Thread *thread, const GrowableHandlePtrArray< const String > &strs)
Definition symbols.cc:262
static const String & Void()
Definition symbols.h:693
static const String & Dash()
Definition symbols.h:662
static constexpr int kNullCharCodeSymbolOffset
Definition symbols.h:604
static const String & This()
Definition symbols.h:691
static const String & Ampersand()
Definition symbols.h:663
static const String & Empty()
Definition symbols.h:687
static const String & Backtick()
Definition symbols.h:666
static const String & Star()
Definition symbols.h:677
static const String & QuestionMark()
Definition symbols.h:681
static const String & SingleQuote()
Definition symbols.h:656
static const String & LBrace()
Definition symbols.h:640
static const String & BitAnd()
Definition symbols.h:619
static StringPtr * PredefinedAddress()
Definition symbols.h:771
static StringPtr FromUTF8(Thread *thread, const uint8_t *utf8_array, intptr_t len)
Definition symbols.cc:196
static const String & Semicolon()
Definition symbols.h:674
static const String & LBracket()
Definition symbols.h:634
static StringPtr New(Thread *thread, const char *cstr)
Definition symbols.h:722
static void DumpStats(IsolateGroup *isolate_group)
Definition symbols.cc:481
static const String & Dot()
Definition symbols.h:612
static StringPtr LookupFromConcat(Thread *thread, const String &str1, const String &str2)
Definition symbols.cc:412
static const String & Blank()
Definition symbols.h:646
static const String & RBracket()
Definition symbols.h:637
static const String & LParen()
Definition symbols.h:628
static const String & Slash()
Definition symbols.h:669
static StringPtr NewFormatted(Thread *thread, const char *format,...) PRINTF_ATTRIBUTE(2
Definition symbols.cc:450
static const String & Minus()
Definition symbols.h:617
static void DumpTable(IsolateGroup *isolate_group)
Definition symbols.cc:496
static const String & At()
Definition symbols.h:670
static StringPtr FromLatin1(Thread *thread, const uint8_t *latin1_array, intptr_t len)
Definition symbols.cc:223
static const String & Equals()
Definition symbols.h:613
static const String & RBrace()
Definition symbols.h:643
#define ASSERT(E)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
void Init()
size_t length
#define PRINTF_ATTRIBUTE(string_index, first_to_check)
Definition globals.h:697
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition globals.h:581
#define DEFINE_TOKEN_SYMBOL_INDEX(t, s, p, a)
#define PREDEFINED_SYMBOLS_LIST(V)
Definition symbols.h:18
#define DEFINE_SYMBOL_HANDLE_ACCESSOR(symbol, literal)
Definition symbols.h:697
#define DEFINE_SYMBOL_INDEX(symbol, literal)
Definition symbols.h:583
#define DART_KEYWORD_LIST(KW)
Definition token.h:159