Lines Matching refs:o
13 macro IsAccessorInfo(o: HeapObject): bool {
14 return Is<AccessorInfo>(o);
18 macro IsAccessorPair(o: HeapObject): bool {
19 return Is<AccessorPair>(o);
23 macro IsAllocationSite(o: HeapObject): bool {
24 return Is<AllocationSite>(o);
28 macro IsCell(o: HeapObject): bool {
29 return Is<Cell>(o);
33 macro IsCode(o: HeapObject): bool {
34 return Is<Code>(o);
38 macro IsCodeDataContainer(o: HeapObject): bool {
39 return Is<CodeDataContainer>(o);
43 macro IsContext(o: HeapObject): bool {
44 return Is<Context>(o);
48 macro IsCoverageInfo(o: HeapObject): bool {
49 return Is<CoverageInfo>(o);
53 macro IsDebugInfo(o: HeapObject): bool {
54 return Is<DebugInfo>(o);
58 macro IsFixedDoubleArray(o: HeapObject): bool {
59 return Is<FixedDoubleArray>(o);
63 macro IsFeedbackCell(o: HeapObject): bool {
64 return Is<FeedbackCell>(o);
68 macro IsFeedbackVector(o: HeapObject): bool {
69 return Is<FeedbackVector>(o);
73 macro IsHeapNumber(o: HeapObject): bool {
74 return Is<HeapNumber>(o);
78 macro IsNativeContext(o: HeapObject): bool {
79 return Is<NativeContext>(o);
83 macro IsNumber(o: Object): bool {
84 return Is<Number>(o);
88 macro IsPrivateSymbol(o: HeapObject): bool {
89 return Is<PrivateSymbol>(o);
93 macro IsPromiseCapability(o: HeapObject): bool {
94 return Is<PromiseCapability>(o);
98 macro IsPromiseFulfillReactionJobTask(o: HeapObject): bool {
99 return Is<PromiseFulfillReactionJobTask>(o);
103 macro IsPromiseReaction(o: HeapObject): bool {
104 return Is<PromiseReaction>(o);
108 macro IsPromiseRejectReactionJobTask(o: HeapObject): bool {
109 return Is<PromiseRejectReactionJobTask>(o);
113 macro IsSharedFunctionInfo(o: HeapObject): bool {
114 return Is<SharedFunctionInfo>(o);
118 macro IsSymbol(o: HeapObject): bool {
119 return Is<Symbol>(o);
138 macro Cast<A : type extends WeakHeapObject>(o: A|Object): A labels CastError {
139 if (!IsWeakOrCleared(o)) goto CastError;
140 return %RawDownCast<A>(o);
143 macro Cast<A : type extends Object>(implicit context: Context)(o: MaybeObject):
145 typeswitch (o) {
149 case (o: Object): {
150 return Cast<A>(o) otherwise CastError;
155 Cast<Undefined>(o: MaybeObject): Undefined labels CastError {
156 if (TaggedNotEqual(o, Undefined)) goto CastError;
157 return %RawDownCast<Undefined>(o);
160 macro Cast<A : type extends Object>(implicit context: Context)(o: Object): A
162 return Cast<A>(TaggedToHeapObject(o) otherwise CastError)
167 Cast<Smi>(o: Object): Smi
169 return TaggedToSmi(o) otherwise CastError;
172 Cast<PositiveSmi>(o: Object): PositiveSmi
174 return TaggedToPositiveSmi(o) otherwise CastError;
177 Cast<Zero>(o: Object): Zero labels CastError {
178 if (TaggedEqual(o, SmiConstant(0))) return %RawDownCast<Zero>(o);
182 Cast<Number>(o: Object): Number
184 typeswitch (o) {
197 Cast<Undefined>(o: Object): Undefined
199 const o: MaybeObject = o;
200 return Cast<Undefined>(o) otherwise CastError;
203 Cast<Numeric>(o: Object): Numeric labels CastError {
204 typeswitch (o) {
205 case (o: Number): {
206 return o;
208 case (o: BigInt): {
209 return o;
217 Cast<TheHole>(o: Object): TheHole labels CastError {
218 if (o == TheHole) return %RawDownCast<TheHole>(o);
222 Cast<TheHole>(o: HeapObject): TheHole labels CastError {
223 const o: Object = o;
224 return Cast<TheHole>(o) otherwise CastError;
227 Cast<True>(o: Object): True labels CastError {
228 if (o == True) return %RawDownCast<True>(o);
232 Cast<True>(o: HeapObject): True labels CastError {
233 const o: Object = o;
234 return Cast<True>(o) otherwise CastError;
237 Cast<False>(o: Object): False labels CastError {
238 if (o == False) return %RawDownCast<False>(o);
242 Cast<False>(o: HeapObject): False labels CastError {
243 const o: Object = o;
244 return Cast<False>(o) otherwise CastError;
247 Cast<Boolean>(o: Object): Boolean labels CastError {
248 typeswitch (o) {
249 case (o: True): {
250 return o;
252 case (o: False): {
253 return o;
261 Cast<Boolean>(o: HeapObject): Boolean labels CastError {
262 const o: Object = o;
263 return Cast<Boolean>(o) otherwise CastError;
269 Cast<JSPrimitive>(o: Object): JSPrimitive labels CastError {
270 typeswitch (o) {
271 case (o: Numeric): {
272 return o;
274 case (o: String): {
275 return o;
277 case (o: Symbol): {
278 return o;
280 case (o: Boolean): {
281 return o;
283 case (o: Undefined): {
284 return o;
286 case (o: Null): {
287 return o;
295 Cast<JSAny>(o: Object): JSAny labels CastError {
296 typeswitch (o) {
297 case (o: JSPrimitive): {
298 return o;
300 case (o: JSReceiver): {
301 return o;
309 Cast<JSAny|TheHole>(o: Object): JSAny|TheHole labels CastError {
310 typeswitch (o) {
311 case (o: JSAny): {
312 return o;
314 case (o: TheHole): {
315 return o;
323 Cast<Number|TheHole>(o: Object): Number|TheHole labels CastError {
324 typeswitch (o) {
325 case (o: Number): {
326 return o;
328 case (o: TheHole): {
329 return o;
337 Cast<Context|Zero|Undefined>(o: Object): Context|Zero|Undefined
339 typeswitch (o) {
340 case (o: Context): {
341 return o;
343 case (o: Zero): {
344 return o;
346 case (o: Undefined): {
347 return o;
355 macro Cast<A : type extends HeapObject>(o: HeapObject): A
358 Cast<HeapObject>(o: HeapObject): HeapObject
360 return o;
363 Cast<Null>(o: HeapObject): Null
365 if (o != Null) goto CastError;
366 return %RawDownCast<Null>(o);
369 Cast<Undefined>(o: HeapObject): Undefined
371 const o: MaybeObject = o;
372 return Cast<Undefined>(o) otherwise CastError;
375 Cast<EmptyFixedArray>(o: Object): EmptyFixedArray
377 if (o != kEmptyFixedArray) goto CastError;
378 return %RawDownCast<EmptyFixedArray>(o);
380 Cast<EmptyFixedArray>(o: HeapObject): EmptyFixedArray
382 const o: Object = o;
383 return Cast<EmptyFixedArray>(o) otherwise CastError;
386 Cast<(FixedDoubleArray | EmptyFixedArray)>(o: HeapObject): FixedDoubleArray|
388 typeswitch (o) {
389 case (o: EmptyFixedArray): {
390 return o;
392 case (o: FixedDoubleArray): {
393 return o;
401 Cast<Callable>(o: HeapObject): Callable
403 return HeapObjectToCallable(o) otherwise CastError;
406 Cast<Undefined|Callable>(o: HeapObject): Undefined|Callable
408 if (o == Undefined) return Undefined;
409 return HeapObjectToCallable(o) otherwise CastError;
412 Cast<Undefined|JSFunction>(o: HeapObject): Undefined|JSFunction
414 if (o == Undefined) return Undefined;
415 return Cast<JSFunction>(o) otherwise CastError;
418 macro Cast<T : type extends Symbol>(o: Symbol): T labels CastError;
427 Cast<PublicSymbol>(o: HeapObject): PublicSymbol labels CastError {
428 const s = Cast<Symbol>(o) otherwise CastError;
431 Cast<PrivateSymbol>(o: HeapObject): PrivateSymbol labels CastError {
432 const s = Cast<Symbol>(o) otherwise CastError;
436 Cast<DirectString>(o: String): DirectString
438 return TaggedToDirectString(o) otherwise CastError;
441 Cast<Constructor>(o: HeapObject): Constructor
443 return HeapObjectToConstructor(o) otherwise CastError;
446 Cast<JSFunctionWithPrototypeSlot>(o: HeapObject): JSFunctionWithPrototypeSlot
448 return HeapObjectToJSFunctionWithPrototypeSlot(o) otherwise CastError;
451 Cast<BigInt>(o: HeapObject): BigInt labels CastError {
452 if (IsBigInt(o)) return %RawDownCast<BigInt>(o);
456 Cast<JSRegExpResult>(implicit context: Context)(o: HeapObject): JSRegExpResult
458 if (regexp::IsRegExpResult(o)) return %RawDownCast<JSRegExpResult>(o);
462 Cast<JSSloppyArgumentsObject>(implicit context: Context)(o: HeapObject):
465 const map: Map = o.map;
468 return %RawDownCast<JSSloppyArgumentsObject>(o);
473 Cast<JSStrictArgumentsObject>(implicit context: Context)(o: HeapObject):
476 const map: Map = o.map;
478 return %RawDownCast<JSStrictArgumentsObject>(o);
481 Cast<JSArgumentsObjectWithLength>(implicit context: Context)(o: HeapObject):
484 typeswitch (o) {
485 case (o: JSStrictArgumentsObject): {
486 return o;
488 case (o: JSSloppyArgumentsObject): {
489 return o;
497 Cast<FastJSRegExp>(implicit context: Context)(o: HeapObject): FastJSRegExp
503 if (regexp::IsFastRegExpStrict(o)) {
504 return %RawDownCast<FastJSRegExp>(o);
509 Cast<FastJSArray>(implicit context: Context)(o: HeapObject): FastJSArray
513 if (!Is<JSArray>(o)) goto CastError;
516 const map: Map = o.map;
524 return %RawDownCast<FastJSArray>(o);
527 Cast<FastJSArrayForRead>(implicit context: Context)(o: HeapObject):
530 if (!Is<JSArray>(o)) goto CastError;
533 const map: Map = o.map;
543 return %RawDownCast<FastJSArrayForRead>(o);
546 Cast<FastJSArrayForCopy>(implicit context: Context)(o: HeapObject):
551 const a = Cast<FastJSArray>(o) otherwise CastError;
555 Cast<FastJSArrayForConcat>(implicit context: Context)(o: HeapObject):
559 const a = Cast<FastJSArrayForCopy>(o) otherwise CastError;
564 o: HeapObject): FastJSArrayWithNoCustomIteration
567 const a = Cast<FastJSArray>(o) otherwise CastError;
572 o: HeapObject): FastJSArrayForReadWithNoCustomIteration
575 const a = Cast<FastJSArrayForRead>(o) otherwise CastError;
579 macro Cast<T: type>(o: String): T labels CastError;
581 Cast<SeqOneByteString>(o: HeapObject): SeqOneByteString labels CastError {
582 return Cast<SeqOneByteString>(Cast<String>(o) otherwise CastError)
586 Cast<SeqOneByteString>(o: String): SeqOneByteString labels CastError {
587 const instanceType = o.StringInstanceType();
593 return %RawDownCast<SeqOneByteString>(o);
596 Cast<SeqTwoByteString>(o: HeapObject): SeqTwoByteString labels CastError {
597 return Cast<SeqTwoByteString>(Cast<String>(o) otherwise CastError)
601 Cast<SeqTwoByteString>(o: String): SeqTwoByteString labels CastError {
602 const instanceType = o.StringInstanceType();
608 return %RawDownCast<SeqTwoByteString>(o);
611 Cast<ThinString>(o: HeapObject): ThinString labels CastError {
612 return Cast<ThinString>(Cast<String>(o) otherwise CastError)
616 Cast<ThinString>(o: String): ThinString labels CastError {
617 const instanceType = o.StringInstanceType();
621 return %RawDownCast<ThinString>(o);
624 Cast<ConsString>(o: HeapObject): ConsString labels CastError {
625 return Cast<ConsString>(Cast<String>(o) otherwise CastError)
629 Cast<ConsString>(o: String): ConsString labels CastError {
630 const instanceType = o.StringInstanceType();
634 return %RawDownCast<ConsString>(o);
637 Cast<SlicedString>(o: HeapObject): SlicedString labels CastError {
638 return Cast<SlicedString>(Cast<String>(o) otherwise CastError)
642 Cast<SlicedString>(o: String): SlicedString labels CastError {
643 const instanceType = o.StringInstanceType();
648 return %RawDownCast<SlicedString>(o);
651 Cast<ExternalOneByteString>(o: HeapObject):
653 return Cast<ExternalOneByteString>(Cast<String>(o) otherwise CastError)
657 Cast<ExternalOneByteString>(o: String): ExternalOneByteString labels CastError {
658 const instanceType = o.StringInstanceType();
665 return %RawDownCast<ExternalOneByteString>(o);
668 Cast<ExternalTwoByteString>(o: HeapObject):
670 return Cast<ExternalTwoByteString>(Cast<String>(o) otherwise CastError)
674 Cast<ExternalTwoByteString>(o: String): ExternalTwoByteString labels CastError {
675 const instanceType = o.StringInstanceType();
682 return %RawDownCast<ExternalTwoByteString>(o);
685 Cast<JSReceiver|Null>(o: HeapObject): JSReceiver|Null
687 typeswitch (o) {
688 case (o: Null): {
689 return o;
691 case (o: JSReceiver): {
692 return o;
700 Cast<Smi|PromiseReaction>(o: Object): Smi|PromiseReaction labels CastError {
701 typeswitch (o) {
702 case (o: Smi): {
703 return o;
705 case (o: PromiseReaction): {
706 return o;
714 Cast<String|Callable>(implicit context: Context)(o: Object): String|
716 typeswitch (o) {
717 case (o: String): {
718 return o;
720 case (o: Callable): {
721 return o;
729 Cast<Zero|PromiseReaction>(implicit context: Context)(o: Object): Zero|
731 typeswitch (o) {
732 case (o: Zero): {
733 return o;
735 case (o: PromiseReaction): {
736 return o;
745 o: Object): JSFunction|JSBoundFunction|JSWrappedFunction labels CastError {
746 typeswitch (o) {
747 case (o: JSFunction): {
748 return o;
750 case (o: JSBoundFunction): {
751 return o;
753 case (o: JSWrappedFunction): {
754 return o;
762 Cast<FixedArray|Undefined>(o: HeapObject): FixedArray|
764 typeswitch (o) {
765 case (o: Undefined): {
766 return o;
768 case (o: FixedArray): {
769 return o;
777 Cast<JSProxy|Null>(o: HeapObject): JSProxy|Null labels CastError {
778 typeswitch (o) {
779 case (o: Null): {
780 return o;
782 case (o: JSProxy): {
783 return o;
792 implicit context: Context)(o: B): bool {
793 Cast<A>(o) otherwise return false;
797 macro UnsafeCast<A : type extends Object>(implicit context: Context)(o: Object):
799 dcheck(Is<A>(o));
800 return %RawDownCast<A>(o);
807 UnsafeCast<RegExpMatchInfo>(implicit context: Context)(o: Object):
809 dcheck(Is<FixedArray>(o));
810 return %RawDownCast<RegExpMatchInfo>(o);
813 macro UnsafeCast<A : type extends WeakHeapObject>(o: A|Object): A {
814 dcheck(IsWeakOrCleared(o));
815 return %RawDownCast<A>(o);
825 Cast<Object>(o: Object): Object
827 return o;