forked from Dadido3/Julia-PureBasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjulia.pbi
2194 lines (1930 loc) · 115 KB
/
julia.pbi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; #### Translated to PB by David Vogel (Dadido3)
; #### Updated: 15.01.2017
; #### http://github.com/Dadido3
; #### http://D3nexus.de
DeclareModule Julia
; #### Information about the data types:
; #### On x64 Windows LLP64 is used. on x64 Linux and MacOS X LP64 is used. The x86 version of Windows, Linux and MacOS use ILP32. Therefore:
; ╔══════╤══════════╤═════════════════╗
; ║ │ Windows │ Linux, MacOS ║
; ║ │ ├────────┬────────╢
; ║ │ x86, x64 │ x86 │ x64 ║
; ╟──────┼──────────┼────────┼────────╢
; ║ int │ 32 bit │ 32 bit │ 32 bit ║
; ╟──────┼──────────┼────────┼────────╢
; ║ long │ 32 bit │ 32 bit │ 64 bit ║
; ╚══════╧══════════╧════════╧════════╝
; #### uInt is defined as "unsigned int" and uLong as "unsigned long".
CompilerIf #PB_Compiler_OS = #PB_OS_Linux Or #PB_Compiler_OS = #PB_OS_MacOS
Macro C_long : i : EndMacro
Macro C_uLong : i : EndMacro
CompilerElse
Macro C_long : l : EndMacro
Macro C_uLong : l : EndMacro
CompilerEndIf
; #### Configuration options that affect the Julia ABI
; If this is not defined, only individual dimension sizes are
; stored and not total length, to save space.
#STORE_ARRAY_LEN = 1
; #### End Configuration options
;- core Data types ------------------------------------------------------------
; the common fields are hidden before the pointer, but the following Macro is
; used To indicate which types below are subtypes of jl_value_t
Macro JL_DATA_TYPE : : EndMacro
Structure jl_value_t
EndStructure
; #### Pointer on jl_value_t
Structure jl_value_t_p
*_.jl_value_t
EndStructure
Structure _jl_taggedvalue_bits
*gc
EndStructure
Structure jl_taggedvalue_t
StructureUnion
*header
*Next.jl_taggedvalue_t
*type.jl_value_t ; 16-byte aligned
bits._jl_taggedvalue_bits
EndStructureUnion
EndStructure
Declare.i jl_astaggedvalue(*v)
Declare.i jl_valueof(*v)
Declare.i jl_typeof(*v)
Declare jl_set_typeof(*v, *t)
Macro jl_typeis(v,t) : Bool(jl_typeof(v) = (t)) : EndMacro
; Symbols are interned strings (hash-consed) stored As an invasive binary tree.
; The string Data is nul-terminated And hangs off the End of the struct.
Structure jl_sym_t
JL_DATA_TYPE
*left.jl_sym_t
*right.jl_sym_t
hash.i ; precomputed hash value
; JL_ATTRIBUTE_ALIGN_PTRSIZE(char name[]);
EndStructure
; #### Pointer on jl_sym_t
Structure jl_sym_t_p
*_.jl_sym_t
EndStructure
; A numbered SSA value, For optimized code analysis And generation
; the `id` is a unique, small number
Structure jl_ssavalue_t
EndStructure
; A SimpleVector is an immutable pointer Array
; Data is stored at the End of this variable-length struct.
Structure jl_svec_t
EndStructure
; #### Pointer on jl_svec_t
Structure jl_svec_t_p
*_.jl_svec_t
EndStructure
Structure jl_array_flags_t
; how - allocation style
; 0 = Data is inlined, Or a foreign pointer we don't manage
; 1 = julia-allocated buffer that needs To be marked
; 2 = malloc-allocated pointer this Array object manages
; 3 = has a pointer To the Array that owns the Data
EndStructure
Structure jl_array_t
*_data
CompilerIf Defined(STORE_ARRAY_LEN, #PB_Constant)
length.i
CompilerEndIf
flags.jl_array_flags_t
elsize.u
offset.l ; for 1-d only. does not need to get big.
nrows.i
StructureUnion
; 1d
maxsize.i
; Nd
ncols.i
EndStructureUnion
; other dim sizes go here for ndims > 2
; followed by alignment padding and inline data, or owner pointer
EndStructure
; compute # of extra words needed To store dimensions
Declare jl_array_ndimwords(ndims.l)
Structure jl_tupletype_t : EndStructure
Structure _jl_method_instance_t : EndStructure
; TypeMap is an implicitly defined type
; that can consist of any of the following nodes:
; typedef TypeMap Union{TypeMapLevel, TypeMapEntry, Void}
; it forms a roughly tree-shaped Structure, consisting of nodes of TypeMapLevels
; which split the tree when possible, For example based on the key into the tuple type at `offs`
; when key is a leaftype, (but only when the tree has enough entries For this To be
; more efficient than storing them sorted linearly)
; otherwise the leaf entries are stored sorted, linearly
Structure jl_typemap_t
StructureUnion
*node._jl_typemap_level_t
*leaf._jl_typemap_entry_t
*unknown._jl_value_t ; nothing
EndStructureUnion
EndStructure
; "jlcall" calling convention signatures.
; This defines the Default ABI used by compiled julia functions.
;typedef jl_value_t *(*jl_fptr_t)(jl_value_t*, jl_value_t**, uint32_t);
;typedef jl_value_t *(*jl_fptr_sparam_t)(jl_svec_t*, jl_value_t*, jl_value_t**, uint32_t);
;typedef jl_value_t *(*jl_fptr_linfo_t)(struct _jl_method_instance_t*, jl_value_t**, uint32_t, jl_svec_t*);
; TODO: Add jl_fptr_t structure
; Structure jl_generic_fptr_t
; StructureUnion
; fptr.jl_fptr_t
; fptr1.jl_fptr_t
; ; constant fptr2;
; fptr3.jl_fptr_sparam_t
; fptr4.jl_fptr_linfo_t
; EndStructureUnion
; jlcall_api.a
; EndStructure
Structure jl_llvm_functions_t
EndStructure
; This type describes a single function body
Structure jl_code_info_t
EndStructure
; This type describes a single method definition, And stores Data
; Shared by the specializations of a function.
Structure jl_method_t
EndStructure
; This type caches the Data For a specType signature specialization of a Method
Structure jl_method_instance_t
EndStructure
; all values are callable As Functions
Structure jl_function_t
jl_value_t.jl_value_t
EndStructure
; a TypeConstructor (typealias)
; For example, Vector{T}:
; body is the Vector{T} <: Type
; parameters is the set {T}, the bound TypeVars in body
Structure jl_typector_t
EndStructure
; represents the "name" part of a DataType, describing the syntactic Structure
; of a type And storing all Data common To different instantiations of the type,
; including a cache For hash-consed allocation of DataType objects.
Structure jl_typename_t
EndStructure
; #### Pointer on jl_typename_t
Structure jl_typename_t_p
*_.jl_typename_t
EndStructure
Structure jl_uniontype_t
EndStructure
; in little-endian, isptr is always the first bit, avoiding the need For a branch in computing isptr
Structure jl_fielddesc8_t
EndStructure
Structure jl_fielddesc16_t
EndStructure
Structure jl_fielddesc32_t
EndStructure
Structure jl_datatype_layout_t
EndStructure
Structure jl_datatype_t
JL_DATA_TYPE
*name.jl_typename_t
*super._jl_datatype_t
*parameters.jl_svec_t
*types.jl_svec_t
*instance.jl_value_t ; for singletons
*layout.jl_datatype_layout_t
size.l ; TODO: move to _jl_datatype_layout_t
ninitialized.l
uid.l
abstract.a
mutabl.a
; memoized properties
*struct_decl ; llvm::Type*
*ditype ; llvm::MDNode* to be used as llvm::DIType(ditype)
depth.l
hastypevars.b ; bound
haswildcard.b ; unbound
isleaftype.b
EndStructure
; #### Pointer on jl_datatype_t
Structure jl_datatype_t_p
*_.jl_datatype_t
EndStructure
Structure jl_tvar_t
EndStructure
; #### Pointer on jl_tvar_t
Structure jl_tvar_t_p
*_.jl_tvar_t
EndStructure
Structure jl_weakref_t
EndStructure
Structure jl_binding_t
EndStructure
Structure jl_module_t
EndStructure
; #### Pointer on jl_module_t
Structure jl_module_t_p
*_.jl_module_t
EndStructure
; one Type-To-Value entry
Structure jl_typemap_entry_t
EndStructure
; one level in a TypeMap tree
; indexed by key If it is a sublevel in an Array
Structure jl_ordereddict_t
EndStructure
Structure jl_typemap_level_t
EndStructure
; contains the TypeMap For one Type
Structure jl_methtable_t
EndStructure
Structure jl_expr_t
EndStructure
;- constants And type objects -------------------------------------------------
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
_JL_Library_ID = OpenLibrary(#PB_Any, "libjulia.dll")
; CompilerCase #PB_OS_Linux
; _JL_Library_ID = OpenLibrary(#PB_Any, "libjulia.so") ; TODO: Test julia on linux
CompilerDefault
CompilerError "Julia module: OS not supported."
CompilerEndSelect
If _JL_Library_ID
Global *jl_any_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_any_type")
Global *jl_type_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_type_type")
Global *jl_typetype_tvar.jl_tvar_t_p = GetFunction(_JL_Library_ID, "jl_typetype_tvar")
Global *jl_typetype_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typetype_type")
Global *jl_ANY_flag.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_ANY_flag")
Global *jl_typename_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typename_type")
Global *jl_typector_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typector_type")
Global *jl_sym_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_sym_type")
Global *jl_symbol_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_symbol_type")
Global *jl_ssavalue_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_ssavalue_type")
Global *jl_abstractslot_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_abstractslot_type")
Global *jl_slotnumber_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_slotnumber_type")
Global *jl_typedslot_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typedslot_type")
Global *jl_simplevector_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_simplevector_type")
Global *jl_tuple_typename.jl_typename_t_p = GetFunction(_JL_Library_ID, "jl_tuple_typename")
Global *jl_vecelement_typename.jl_typename_t_p = GetFunction(_JL_Library_ID, "jl_vecelement_typename")
Global *jl_anytuple_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_anytuple_type")
Macro jl_tuple_type : jl_anytuple_type : EndMacro
Global *jl_anytuple_type_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_anytuple_type_type")
Global *jl_vararg_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_vararg_type")
Global *jl_tvar_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_tvar_type")
Global *jl_task_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_task_type")
Global *jl_function_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_function_type")
Global *jl_builtin_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_builtin_type")
Global *jl_uniontype_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_uniontype_type")
Global *jl_datatype_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_datatype_type")
Global *jl_bottom_type.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_bottom_type")
Global *jl_lambda_info_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_lambda_info_type")
Global *jl_method_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_method_type")
Global *jl_module_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_module_type")
Global *jl_abstractarray_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_abstractarray_type")
Global *jl_densearray_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_densearray_type")
Global *jl_array_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_array_type")
Global *jl_array_typename.jl_typename_t_p = GetFunction(_JL_Library_ID, "jl_array_typename")
Global *jl_weakref_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_weakref_type")
Global *jl_string_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_string_type")
Global *jl_errorexception_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_errorexception_type")
Global *jl_argumenterror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_argumenterror_type")
Global *jl_loaderror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_loaderror_type")
Global *jl_initerror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_initerror_type")
Global *jl_typeerror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typeerror_type")
Global *jl_methoderror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_methoderror_type")
Global *jl_undefvarerror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_undefvarerror_type")
Global *jl_stackovf_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_stackovf_exception")
Global *jl_memory_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_memory_exception")
Global *jl_readonlymemory_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_readonlymemory_exception")
Global *jl_diverror_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_diverror_exception")
Global *jl_domain_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_domain_exception")
Global *jl_overflow_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_overflow_exception")
Global *jl_inexact_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_inexact_exception")
Global *jl_undefref_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_undefref_exception")
Global *jl_interrupt_exception.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_interrupt_exception")
Global *jl_boundserror_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_boundserror_type")
Global *jl_an_empty_vec_any.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_an_empty_vec_any")
Global *jl_bool_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_bool_type")
Global *jl_char_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_char_type")
Global *jl_int8_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_int8_type")
Global *jl_uint8_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_uint8_type")
Global *jl_int16_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_int16_type")
Global *jl_uint16_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_uint16_type")
Global *jl_int32_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_int32_type")
Global *jl_uint32_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_uint32_type")
Global *jl_int64_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_int64_type")
Global *jl_uint64_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_uint64_type")
Global *jl_float16_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_float16_type")
Global *jl_float32_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_float32_type")
Global *jl_float64_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_float64_type")
Global *jl_floatingpoint_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_floatingpoint_type")
Global *jl_number_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_number_type")
Global *jl_void_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_void_type")
Global *jl_complex_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_complex_type")
Global *jl_signed_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_signed_type")
Global *jl_voidpointer_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_voidpointer_type")
Global *jl_pointer_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_pointer_type")
Global *jl_ref_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_ref_type")
Global *jl_array_uint8_type.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_array_uint8_type")
Global *jl_array_any_type.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_array_any_type")
Global *jl_array_symbol_type.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_array_symbol_type")
Global *jl_expr_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_expr_type")
Global *jl_globalref_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_globalref_type")
Global *jl_linenumbernode_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_linenumbernode_type")
Global *jl_labelnode_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_labelnode_type")
Global *jl_gotonode_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_gotonode_type")
Global *jl_quotenode_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_quotenode_type")
Global *jl_newvarnode_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_newvarnode_type")
Global *jl_intrinsic_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_intrinsic_type")
Global *jl_methtable_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_methtable_type")
Global *jl_typemap_level_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typemap_level_type")
Global *jl_typemap_entry_type.jl_datatype_t_p = GetFunction(_JL_Library_ID, "jl_typemap_entry_type")
Global *jl_emptysvec.jl_svec_t_p = GetFunction(_JL_Library_ID, "jl_emptysvec")
Global *jl_emptytuple.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_emptytuple")
Global *jl_true.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_true")
Global *jl_false.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_false")
Global *jl_nothing.jl_value_t_p = GetFunction(_JL_Library_ID, "jl_nothing")
; some important symbols
Global *call_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "call_sym")
Global *invoke_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "invoke_sym")
Global *empty_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "empty_sym")
Global *body_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "body_sym")
Global *dots_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "dots_sym")
Global *vararg_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "vararg_sym")
Global *quote_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "quote_sym")
Global *newvar_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "newvar_sym")
Global *top_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "top_sym")
Global *dot_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "dot_sym")
Global *line_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "line_sym")
Global *toplevel_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "toplevel_sym")
Global *core_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "core_sym")
Global *globalref_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "globalref_sym")
Global *jl_incomplete_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "jl_incomplete_sym")
Global *error_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "error_sym")
Global *amp_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "amp_sym")
Global *module_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "module_sym")
Global *colons_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "colons_sym")
Global *export_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "export_sym")
Global *import_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "import_sym")
Global *importall_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "importall_sym")
Global *using_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "using_sym")
Global *goto_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "goto_sym")
Global *goto_ifnot_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "goto_ifnot_sym")
Global *label_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "label_sym")
Global *return_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "return_sym")
Global *lambda_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "lambda_sym")
Global *assign_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "assign_sym")
Global *method_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "method_sym")
Global *slot_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "slot_sym")
Global *enter_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "enter_sym")
Global *leave_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "leave_sym")
Global *exc_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "exc_sym")
Global *new_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "new_sym")
Global *compiler_temp_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "compiler_temp_sym")
Global *const_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "const_sym")
Global *thunk_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "thunk_sym")
Global *anonymous_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "anonymous_sym")
Global *underscore_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "underscore_sym")
Global *abstracttype_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "abstracttype_sym")
Global *bitstype_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "bitstype_sym")
Global *compositetype_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "compositetype_sym")
Global *global_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "global_sym")
Global *unused_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "unused_sym")
Global *boundscheck_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "boundscheck_sym")
Global *inbounds_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "inbounds_sym")
Global *copyast_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "copyast_sym")
Global *fastmath_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "fastmath_sym")
Global *pure_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "pure_sym")
Global *simdloop_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "simdloop_sym")
Global *meta_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "meta_sym")
Global *list_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "list_sym")
Global *inert_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "inert_sym")
Global *static_parameter_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "static_parameter_sym")
Global *polly_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "polly_sym")
Global *inline_sym.jl_sym_t_p = GetFunction(_JL_Library_ID, "inline_sym")
EndIf
;- threading ------------------------------------------------------------------
; This includes all the thread local states we care about for a thread.
#JL_MAX_BT_SIZE = 80000
; Whether it is safe to execute GC at the same time.
#JL_GC_STATE_WAITING = 1 ; gc_state = 1 means the thread is doing GC or is waiting For the GC to finish.
#JL_GC_STATE_SAFE = 2 ; gc_state = 2 means the thread is running unmanaged code that can be execute at the same time with the GC.
Structure jl_tls_states_t
*pgcstack.jl_gcframe_t
*exception_in_transit.jl_value_t
*safepoint.Integer
gc_state.b ; Whether it is safe to execute GC at the same time.
in_finalizer.b
disable_gc.b
defer_signal.i
*current_module.jl_module_t
*current_task.jl_task_t
*root_task.jl_task_t
*task_arg_in_transit.jl_value_t
*stackbase
*stack_lo
*stack_hi
*jmp_target.jl_jmp_buf
*base_ctx.jl_jmp_buf ; base context of stack
*safe_restore.jl_jmp_buf
tid.w
bt_size.i
; JL_MAX_BT_SIZE + 1 elements long
*bt_data.Integer
; Atomically set by the sender, reset by the handler.
signal_request.i
; Allow the sigint To be raised asynchronously
; this is limited To the few places we do synchronous IO
; we can make this more general (similar To defer_signal) If necessary
io_wait.i
; heap.jl_thread_heap_t ; TODO: Add structure jl_thread_heap_t
; CompilerIf Not #PB_Compiler_OS = #PB_OS_Windows
; ; These are only used on unix now
; system_id.i
; *signal_stack
; CompilerEndIf
; ; execution of certain certain impure
; ; statements is prohibited from certain
; ; callbacks (such As generated functions)
; ; As it may make compilation undecidable
; in_pure_callback.l
; ; Counter To disable finalizer **on the current thread**
; finalizers_inhibited.l
; finalizersarraylist_t
EndStructure
Macro jl_ptls_t : jl_tls_states_t : EndMacro
PrototypeC.i jl_get_ptls_states() ; Returns *jl_ptls_t.jl_ptls_t
If _JL_Library_ID
Global jl_get_ptls_states.jl_get_ptls_states = GetFunction(_JL_Library_ID, "jl_get_ptls_states")
EndIf
;- gc -------------------------------------------------------------------------
Structure jl_gcframe_t
nroots.i
*prev._jl_gcframe_t
; actual roots go here
EndStructure
; NOTE: it is the caller's responsibility to make sure arguments are
; rooted such that the gc can see them on the stack.
; `foo(f(), g())` is not safe,
; since the result of `f()` is not rooted during the call to `g()`,
; and the arguments to foo are not gc-protected during the call to foo.
; foo can't do anything about it, so the caller must do:
; jl_value_t *x=NULL, *y=NULL; JL_GC_PUSH2(&x, &y);
; x = f(); y = g(); foo(x, y)
Declare.i jl_pgcstack()
Declare JL_GC_PUSH1(arg1)
Declare JL_GC_PUSH2(arg1, arg2)
Declare JL_GC_PUSH3(arg1, arg2, arg3)
Declare JL_GC_PUSH4(arg1, arg2, arg3, arg4)
Declare JL_GC_PUSH5(arg1, arg2, arg3, arg4, arg5)
Declare JL_GC_POP()
; #define JL_GC_PUSHARGS(rts_var,n) \
; rts_var = ((jl_value_t**)alloca(((n)+2)*SizeOf(jl_value_t*)))+2; \
; ((void**)rts_var)[-2] = (void*)(((size_t)(n))<<1); \
; ((void**)rts_var)[-1] = jl_pgcstack; \
; memset((void*)rts_var, 0, (n)*SizeOf(jl_value_t*)); \
; jl_pgcstack = (jl_gcframe_t*)&(((void**)rts_var)[-2])
PrototypeC.l jl_gc_enable(on.l)
PrototypeC.l jl_gc_is_enabled()
PrototypeC.q jl_gc_total_bytes()
PrototypeC.q jl_gc_total_hrtime()
PrototypeC.q jl_gc_diff_total_bytes()
PrototypeC jl_gc_collect(int.l)
PrototypeC jl_gc_add_finalizer(*v.jl_value_t, *f.jl_function_t)
PrototypeC jl_finalize(*o.jl_value_t)
PrototypeC.i jl_gc_new_weakref(*value.jl_value_t) ; Returns *jl_weakref_t.jl_weakref_t
PrototypeC.i jl_gc_alloc_0w() ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_gc_alloc_1w() ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_gc_alloc_2w() ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_gc_alloc_3w() ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_gc_allocobj(sz.i) ; Returns *jl_value_t.jl_value_t
PrototypeC jl_clear_malloc_data()
; GC write barriers
PrototypeC jl_gc_queue_root(*root.jl_value_t) ; root is a jl_value_t*
; ; Do NOT put a safepoint here
; STATIC_INLINE void jl_gc_wb(void *parent, void *ptr)
; {
; ; parent and ptr isa jl_value_t*
; If (__unlikely(jl_astaggedvalue(parent)->bits.gc == 3 &&
; (jl_astaggedvalue(ptr)->bits.gc & 1) == 0))
; jl_gc_queue_root((jl_value_t*)parent);
; }
;
; STATIC_INLINE void jl_gc_wb_back(void *ptr) ; ptr isa jl_value_t*
; {
; ; if ptr is old
; If (__unlikely(jl_astaggedvalue(ptr)->bits.gc == 3)) {
; jl_gc_queue_root((jl_value_t*)ptr);
; }
; }
PrototypeC.i jl_gc_managed_malloc(sz.i)
PrototypeC.i jl_gc_managed_realloc(*d, sz.i, oldsz.i, isaligned.l, *owner.jl_value_t)
If _JL_Library_ID
Global jl_gc_enable.jl_gc_enable = GetFunction(_JL_Library_ID, "jl_gc_enable")
Global jl_gc_is_enabled.jl_gc_is_enabled = GetFunction(_JL_Library_ID, "jl_gc_is_enabled")
Global jl_gc_total_bytes.jl_gc_total_bytes = GetFunction(_JL_Library_ID, "jl_gc_total_bytes")
Global jl_gc_total_hrtime.jl_gc_total_hrtime = GetFunction(_JL_Library_ID, "jl_gc_total_hrtime")
Global jl_gc_diff_total_bytes.jl_gc_diff_total_bytes = GetFunction(_JL_Library_ID, "jl_gc_diff_total_bytes")
Global jl_gc_collect.jl_gc_collect = GetFunction(_JL_Library_ID, "jl_gc_collect")
Global jl_gc_add_finalizer.jl_gc_add_finalizer = GetFunction(_JL_Library_ID, "jl_gc_add_finalizer")
Global jl_finalize.jl_finalize = GetFunction(_JL_Library_ID, "jl_finalize")
Global jl_gc_new_weakref.jl_gc_new_weakref = GetFunction(_JL_Library_ID, "jl_gc_new_weakref")
Global jl_gc_alloc_0w.jl_gc_alloc_0w = GetFunction(_JL_Library_ID, "jl_gc_alloc_0w")
Global jl_gc_alloc_1w.jl_gc_alloc_1w = GetFunction(_JL_Library_ID, "jl_gc_alloc_1w")
Global jl_gc_alloc_2w.jl_gc_alloc_2w = GetFunction(_JL_Library_ID, "jl_gc_alloc_2w")
Global jl_gc_alloc_3w.jl_gc_alloc_3w = GetFunction(_JL_Library_ID, "jl_gc_alloc_3w")
Global jl_gc_allocobj.jl_gc_allocobj = GetFunction(_JL_Library_ID, "jl_gc_allocobj")
Global jl_clear_malloc_data.jl_clear_malloc_data = GetFunction(_JL_Library_ID, "jl_clear_malloc_data")
Global jl_gc_queue_root.jl_gc_queue_root = GetFunction(_JL_Library_ID, "jl_gc_queue_root")
Global jl_gc_managed_malloc.jl_gc_managed_malloc = GetFunction(_JL_Library_ID, "jl_gc_managed_malloc")
Global jl_gc_managed_realloc.jl_gc_managed_realloc = GetFunction(_JL_Library_ID, "jl_gc_managed_realloc")
EndIf
;- object accessors -----------------------------------------------------------
; #define jl_svec_len(t) (((jl_svec_t*)(t))->length)
; #define jl_svec_set_len_unsafe(t,n) (((jl_svec_t*)(t))->length=(n))
; #define jl_svec_data(t) ((jl_value_t**)((char*)(t) + SizeOf(jl_svec_t)))
;
; STATIC_INLINE jl_value_t *jl_svecref(void *t, size_t i)
; {
; assert(jl_typeis(t,jl_simplevector_type));
; assert(i < jl_svec_len(t));
; Return jl_svec_data(t)[i];
; }
; STATIC_INLINE jl_value_t *jl_svecset(void *t, size_t i, void *x)
; {
; assert(jl_typeis(t,jl_simplevector_type));
; assert(i < jl_svec_len(t));
; jl_svec_data(t)[i] = (jl_value_t*)x;
; If (x) jl_gc_wb(t, x);
; Return (jl_value_t*)x;
; }
;
CompilerIf Defined(STORE_ARRAY_LEN, #PB_Constant)
Declare.i jl_array_len(*a.jl_array_t)
CompilerElse
PrototypeC.i jl_array_len_(*a.jl_array_t)
Declare.i jl_array_len(*a.jl_array_t)
CompilerEndIf
Declare.i jl_array_data(*a.jl_array_t)
; #define jl_array_dim(a,i) ((&((jl_array_t*)(a))->nrows)[i])
; #define jl_array_dim0(a) (((jl_array_t*)(a))->nrows)
; #define jl_array_nrows(a) (((jl_array_t*)(a))->nrows)
; #define jl_array_ndims(a) ((int32_t)(((jl_array_t*)a)->flags.ndims))
; #define jl_array_data_owner_offset(ndims) (OffsetOf(jl_array_t,ncols) + SizeOf(size_t)*(1+jl_array_ndimwords(ndims))) ; in bytes
; #define jl_array_data_owner(a) (*((jl_value_t**)((char*)a + jl_array_data_owner_offset(jl_array_ndims(a)))))
;
; STATIC_INLINE jl_value_t *jl_array_ptr_ref(void *a, size_t i)
; {
; assert(i < jl_array_len(a));
; Return ((jl_value_t**)(jl_array_data(a)))[i];
; }
; STATIC_INLINE jl_value_t *jl_array_ptr_set(void *a, size_t i, void *x)
; {
; assert(i < jl_array_len(a));
; ((jl_value_t**)(jl_array_data(a)))[i] = (jl_value_t*)x;
; If (x) {
; If (((jl_array_t*)a)->flags.how == 3) {
; a = jl_array_data_owner(a);
; }
; jl_gc_wb(a, x);
; }
; Return (jl_value_t*)x;
; }
;
; STATIC_INLINE uint8_t jl_array_uint8_ref(void *a, size_t i)
; {
; assert(i < jl_array_len(a));
; assert(jl_typeis(a, jl_array_uint8_type));
; Return ((uint8_t*)(jl_array_data(a)))[i];
; }
; STATIC_INLINE void jl_array_uint8_set(void *a, size_t i, uint8_t x)
; {
; assert(i < jl_array_len(a));
; assert(jl_typeis(a, jl_array_uint8_type));
; ((uint8_t*)(jl_array_data(a)))[i] = x;
; }
;
; #define jl_exprarg(e,n) (((jl_value_t**)jl_array_data(((jl_expr_t*)(e))->args))[n])
; #define jl_exprargset(e, n, v) jl_array_ptr_set(((jl_expr_t*)(e))->args, n, v)
; #define jl_expr_nargs(e) jl_array_len(((jl_expr_t*)(e))->args)
;
; #define jl_fieldref(s,i) jl_get_nth_field(((jl_value_t*)s),i)
; #define jl_nfields(v) jl_datatype_nfields(jl_typeof(v))
;
; ; Not using jl_fieldref to avoid allocations
; #define jl_linenode_line(x) (((intptr_t*)x)[0])
; #define jl_labelnode_label(x) (((intptr_t*)x)[0])
; #define jl_slot_number(x) (((intptr_t*)x)[0])
; #define jl_typedslot_get_type(x) (((jl_value_t**)x)[1])
; #define jl_gotonode_label(x) (((intptr_t*)x)[0])
; #define jl_globalref_mod(s) (*(jl_module_t**)s)
; #define jl_globalref_name(s) (((jl_sym_t**)s)[1])
;
; #define jl_nparams(t) jl_svec_len(((jl_datatype_t*)(t))->parameters)
; #define jl_tparam0(t) jl_svecref(((jl_datatype_t*)(t))->parameters, 0)
; #define jl_tparam1(t) jl_svecref(((jl_datatype_t*)(t))->parameters, 1)
; #define jl_tparam(t,i) jl_svecref(((jl_datatype_t*)(t))->parameters, i)
;
; ; get a pointer to the data in a datatype
; #define jl_data_ptr(v) ((jl_value_t**)v)
;
; #define jl_array_ptr_data(a) ((jl_value_t**)((jl_array_t*)a)->Data)
; #define jl_string_data(s) ((char*)((jl_array_t*)jl_data_ptr(s)[0])->Data)
; #define jl_string_len(s) (jl_array_len((jl_array_t*)(jl_data_ptr(s)[0])))
; #define jl_iostr_data(s) ((char*)((jl_array_t*)jl_data_ptr(s)[0])->Data)
;
; #define jl_gf_mtable(f) (((jl_datatype_t*)jl_typeof(f))->name->mt)
; #define jl_gf_name(f) (jl_gf_mtable(f)->name)
;
; ; struct type info
; #define jl_field_name(st,i) (jl_sym_t*)jl_svecref(((jl_datatype_t*)st)->name->names, (i))
; #define jl_field_type(st,i) jl_svecref(((jl_datatype_t*)st)->types, (i))
; #define jl_field_count(st) jl_svec_len(((jl_datatype_t*)st)->types)
; #define jl_datatype_size(t) (((jl_datatype_t*)t)->size)
; #define jl_datatype_nfields(t) (((jl_datatype_t*)(t))->layout->nfields)
;
; ; inline version with strong type check to detect typos in a `->name` chain
; STATIC_INLINE char *jl_symbol_name_(jl_sym_t *s)
; {
; Return (char*)s + LLT_ALIGN(SizeOf(jl_sym_t), SizeOf(void*));
; }
; #define jl_symbol_name(s) jl_symbol_name_(s)
;
; #define jl_dt_layout_fields(d) ((const char*)(d) + SizeOf(jl_datatype_layout_t))
;
; #define DEFINE_FIELD_ACCESSORS(f) \
; Static inline uint32_t jl_field_##f(jl_datatype_t *st, int i) \
; { \
; const jl_datatype_layout_t *ly = st->layout; \
; assert(i >= 0 && (size_t)i < ly->nfields); \
; If (ly->fielddesc_type == 0) { \
; Return ((const jl_fielddesc8_t*)jl_dt_layout_fields(ly))[i].f; \
; } \
; Else If (ly->fielddesc_type == 1) { \
; Return ((const jl_fielddesc16_t*)jl_dt_layout_fields(ly))[i].f; \
; } \
; Else { \
; Return ((const jl_fielddesc32_t*)jl_dt_layout_fields(ly))[i].f; \
; } \
; } \
;
; DEFINE_FIELD_ACCESSORS(offset)
; DEFINE_FIELD_ACCESSORS(size)
; Static inline int jl_field_isptr(jl_datatype_t *st, int i)
; {
; const jl_datatype_layout_t *ly = st->layout;
; assert(i >= 0 && (size_t)i < ly->nfields);
; Return ((const jl_fielddesc8_t*)(jl_dt_layout_fields(ly) + (i << (ly->fielddesc_type + 1))))->isptr;
; }
;
; Static inline uint32_t jl_fielddesc_size(int8_t fielddesc_type)
; {
; If (fielddesc_type == 0) {
; Return SizeOf(jl_fielddesc8_t);
; }
; Else If (fielddesc_type == 1) {
; Return SizeOf(jl_fielddesc16_t);
; }
; Else {
; Return SizeOf(jl_fielddesc32_t);
; }
; }
;
; #undef DEFINE_FIELD_ACCESSORS
If _JL_Library_ID
CompilerIf Not Defined(STORE_ARRAY_LEN, #PB_Constant)
Global jl_array_len_.jl_array_len_ = GetFunction(_JL_Library_ID, "jl_array_len_")
CompilerEndIf
EndIf
;- basic predicates -----------------------------------------------------------
Macro jl_is_nothing(v) : ((v) = *jl_nothing\_) : EndMacro
; Macro jl_is_tuple(v) : (((jl_datatype_t*)jl_typeof(v))->name == jl_tuple_typename) : EndMacro
Macro jl_is_svec(v) : jl_typeis(v, *jl_simplevector_type\_) : EndMacro
Macro jl_is_simplevector(v) : jl_is_svec(v) : EndMacro
Macro jl_is_datatype(v) : jl_typeis(v, *jl_datatype_type\_) : EndMacro
; Macro jl_is_mutable(t) : (((jl_datatype_t*)t)->mutabl) : EndMacro
; Macro jl_is_mutable_datatype(t) : (jl_is_datatype(t) && (((jl_datatype_t*)t)->mutabl)) : EndMacro
; Macro jl_is_immutable(t) : (!((jl_datatype_t*)t)->mutabl) : EndMacro
; Macro jl_is_immutable_datatype(t) : (jl_is_datatype(t) && (!((jl_datatype_t*)t)->mutabl)) : EndMacro
Macro jl_is_uniontype(v) : jl_typeis(v, *jl_uniontype_type\_) : EndMacro
Macro jl_is_typevar(v) : jl_typeis(v, *jl_tvar_type\_) : EndMacro
Macro jl_is_typector(v) : jl_typeis(v, *jl_typector_type\_) : EndMacro
Macro jl_is_TypeConstructor(v) : jl_typeis(v, *jl_typector_type\_) : EndMacro
Macro jl_is_typename(v) : jl_typeis(v, *jl_typename_type\_) : EndMacro
Macro jl_is_int8(v) : jl_typeis(v, *jl_int8_type\_) : EndMacro
Macro jl_is_int16(v) : jl_typeis(v, *jl_int16_type\_) : EndMacro
Macro jl_is_int32(v) : jl_typeis(v, *jl_int32_type\_) : EndMacro
Macro jl_is_int64(v) : jl_typeis(v, *jl_int64_type\_) : EndMacro
Macro jl_is_uint8(v) : jl_typeis(v, *jl_uint8_type\_) : EndMacro
Macro jl_is_uint16(v) : jl_typeis(v, *jl_uint16_type\_) : EndMacro
Macro jl_is_uint32(v) : jl_typeis(v, *jl_uint32_type\_) : EndMacro
Macro jl_is_uint64(v) : jl_typeis(v, *jl_uint64_type\_) : EndMacro
Macro jl_is_float(v) : jl_subtype(v, *jl_floatingpoint_type\_,1) : EndMacro
Macro jl_is_floattype(v) : jl_subtype(v, *jl_floatingpoint_type\_,0) : EndMacro
Macro jl_is_float32(v) : jl_typeis(v, *jl_float32_type\_) : EndMacro
Macro jl_is_float64(v) : jl_typeis(v, *jl_float64_type\_) : EndMacro
Macro jl_is_bool(v) : jl_typeis(v, *jl_bool_type\_) : EndMacro
Macro jl_is_symbol(v) : jl_typeis(v, *jl_sym_type\_) : EndMacro
Macro jl_is_ssavalue(v) : jl_typeis(v, *jl_ssavalue_type\_) : EndMacro
Macro jl_is_slot(v) : (jl_typeis(v, *jl_slotnumber_type\_) || jl_typeis(v, *jl_typedslot_type\_)) : EndMacro
Macro jl_is_expr(v) : jl_typeis(v, *jl_expr_type\_) : EndMacro
Macro jl_is_globalref(v) : jl_typeis(v, *jl_globalref_type\_) : EndMacro
Macro jl_is_labelnode(v) : jl_typeis(v, *jl_labelnode_type\_) : EndMacro
Macro jl_is_gotonode(v) : jl_typeis(v, *jl_gotonode_type\_) : EndMacro
Macro jl_is_quotenode(v) : jl_typeis(v, *jl_quotenode_type\_) : EndMacro
Macro jl_is_newvarnode(v) : jl_typeis(v, *jl_newvarnode_type\_) : EndMacro
Macro jl_is_linenode(v) : jl_typeis(v, *jl_linenumbernode_type\_) : EndMacro
Macro jl_is_lambda_info(v) : jl_typeis(v, *jl_lambda_info_type\_) : EndMacro
Macro jl_is_method(v) : jl_typeis(v, *jl_method_type\_) : EndMacro
Macro jl_is_module(v) : jl_typeis(v, *jl_module_type\_) : EndMacro
Macro jl_is_mtable(v) : jl_typeis(v, *jl_methtable_type\_) : EndMacro
Macro jl_is_task(v) : jl_typeis(v, *jl_task_type\_) : EndMacro
Macro jl_is_string(v) : jl_typeis(v, *jl_string_type\_) : EndMacro
Macro jl_is_cpointer(v) : jl_is_cpointer_type(jl_typeof(v)) : EndMacro
Macro jl_is_pointer(v) : jl_is_cpointer_type(jl_typeof(v)) : EndMacro
; STATIC_INLINE int jl_is_bitstype(void *v)
; {
; Return (jl_is_datatype(v) && jl_is_immutable(v) &&
; ((jl_datatype_t*)(v))->layout &&
; jl_datatype_nfields(v) == 0 &&
; ((jl_datatype_t*)(v))->size > 0);
; }
;
; STATIC_INLINE int jl_is_structtype(void *v)
; {
; Return (jl_is_datatype(v) &&
; (jl_field_count(v) > 0 ||
; ((jl_datatype_t*)(v))->size == 0) &&
; !((jl_datatype_t*)(v))->abstract);
; }
;
; STATIC_INLINE int jl_isbits(void *t) ; corresponding to isbits() in julia
; {
; Return (jl_is_datatype(t) && ((jl_datatype_t*)t)->layout &&
; !((jl_datatype_t*)t)->mutabl && ((jl_datatype_t*)t)->layout->pointerfree);
; }
;
; STATIC_INLINE int jl_is_datatype_singleton(jl_datatype_t *d)
; {
; Return (d->instance != NULL);
; }
;
; STATIC_INLINE int jl_is_datatype_make_singleton(jl_datatype_t *d)
; {
; Return (!d->abstract && d->size == 0 && d != jl_sym_type && d->name != jl_array_typename &&
; d->uid != 0 && (d->name->names == jl_emptysvec || !d->mutabl));
; }
;
; STATIC_INLINE int jl_is_abstracttype(void *v)
; {
; Return (jl_is_datatype(v) && ((jl_datatype_t*)(v))->abstract);
; }
;
; STATIC_INLINE int jl_is_array_type(void *t)
; {
; Return (jl_is_datatype(t) &&
; ((jl_datatype_t*)(t))->name == jl_array_typename);
; }
;
; STATIC_INLINE int jl_is_array(void *v)
; {
; jl_value_t *t = jl_typeof(v);
; Return jl_is_array_type(t);
; }
;
; STATIC_INLINE int jl_is_cpointer_type(jl_value_t *t)
; {
; Return (jl_is_datatype(t) &&
; ((jl_datatype_t*)(t))->name == jl_pointer_type->name);
; }
;
; STATIC_INLINE int jl_is_abstract_ref_type(jl_value_t *t)
; {
; Return (jl_is_datatype(t) &&
; ((jl_datatype_t*)(t))->name == jl_ref_type->name);
; }
;
; STATIC_INLINE jl_value_t *jl_is_ref_type(jl_value_t *t)
; {
; If (!jl_is_datatype(t)) Return 0;
; jl_datatype_t *dt = (jl_datatype_t*)t;
; While (dt != jl_any_type && dt->name != dt->super->name) {
; If (dt->name == jl_ref_type->name)
; Return (jl_value_t*)dt;
; dt = dt->super;
; }
; Return 0;
; }
;
; STATIC_INLINE int jl_is_tuple_type(void *t)
; {
; Return (jl_is_datatype(t) &&
; ((jl_datatype_t*)(t))->name == jl_tuple_typename);
; }
;
; STATIC_INLINE int jl_is_vecelement_type(jl_value_t* t)
; {
; Return (jl_is_datatype(t) &&
; ((jl_datatype_t*)(t))->name == jl_vecelement_typename);
; }
;
; STATIC_INLINE int jl_is_type_type(jl_value_t *v)
; {
; Return (jl_is_datatype(v) &&
; ((jl_datatype_t*)(v))->name == jl_type_type->name);
; }
; object identity
PrototypeC.l jl_egal(*a.jl_value_t, *b.jl_value_t)
PrototypeC.i jl_object_id(*v.jl_value_t)
; type predicates and basic operations
PrototypeC.l jl_is_leaf_type(*v.jl_value_t)
PrototypeC.l jl_has_typevars(*v.jl_value_t)
PrototypeC.l jl_subtype(*a.jl_value_t, *b.jl_value_t, ta.l)
PrototypeC.l jl_types_equal(*a.jl_value_t, *b.jl_value_t)
PrototypeC.i jl_type_union(*typesjl_svec_t) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_type_intersection(*a.jl_value_t, *b.jl_value_t) ; Returns *jl_value_t.jl_value_t
PrototypeC.l jl_args_morespecific(*a.jl_value_t, *b.jl_value_t)
PrototypeC.i jl_typename_str(*v.jl_value_t) ; Returns a pointer to a string
PrototypeC.i jl_typeof_str(*v.jl_value_t) ; Returns a pointer to a string
PrototypeC.l jl_type_morespecific(*a.jl_value_t, *b.jl_value_t)
; #ifdef NDEBUG
; STATIC_INLINE int jl_is_leaf_type_(jl_value_t *v)
; {
; Return jl_is_datatype(v) && ((jl_datatype_t*)v)->isleaftype;
; }
; #define jl_is_leaf_type(v) jl_is_leaf_type_(v)
; #endif
; type constructors
PrototypeC.i jl_new_typename(*name.jl_sym_t) ; Returns *jl_typename_t.jl_typename_t
PrototypeC.i jl_new_typevar(*name.jl_sym_t,*lb.jl_value_t, *ub.jl_value_t) ; Returns *jl_tvar_t.jl_tvar_t
PrototypeC.i jl_apply_type(*tc.jl_value_t, *params.jl_svec_t) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_apply_tuple_type(*params.jl_svec_t) ; Returns *jl_tupletype_t.jl_tupletype_t
; PrototypeC.i jl_apply_tuple_type_v(**p.jl_value_t, np.i) ; Returns *jl_tupletype_t.jl_tupletype_t
PrototypeC.i jl_new_datatype(*name.jl_sym_t, *super.jl_datatype_t, *parameters.jl_svec_t, *fnames.jl_svec_t, *ftypes.jl_svec_t, abstract.l, mutabl.l, ninitialized.l) ; Returns *jl_datatype_t.jl_datatype_t
PrototypeC.i jl_new_bitstype(*name.jl_value_t, *super.jl_datatype_t, *parameters.jl_svec_t, nbits.i) ; Returns *jl_datatype_t.jl_datatype_t
; constructors
PrototypeC.i jl_new_bits(*bt.jl_value_t, *Data) ; Returns *jl_value_t.jl_value_t
; PrototypeC.i jl_new_struct(*type.jl_datatype_t, ...) ; Returns *jl_value_t.jl_value_t
; PrototypeC.i jl_new_structv(*type.jl_datatype_t, **args.jl_value_t, na.l) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_new_struct_uninit(*type.jl_datatype_t) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_new_lambda_info_uninit() ; Returns *jl_lambda_info_t.jl_lambda_info_t
PrototypeC.i jl_new_lambda_info_from_ast(*ast.jl_expr_t) ; Returns *jl_lambda_info_t.jl_lambda_info_t
; PrototypeC.i jl_new_method(*definition.jl_lambda_info_t, *name.jl_sym_t, *sig.jl_tupletype_t, *tvars.jl_svec_t, isstaged.l) ; Returns *jl_method_t.jl_method_t
; PrototypeC.i jl_svec(n.i, ...) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_svec1(*a) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_svec2(*a, *b) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_alloc_svec(n.i) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_alloc_svec_uninit(n.i) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_svec_copy(*a.jl_svec_t) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_svec_fill(n.i, *x.jl_value_t) ; Returns *jl_svec_t.jl_svec_t
PrototypeC.i jl_tupletype_fill(n.i, *v.jl_value_t) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_symbol(str.p-utf8) ; Returns *jl_sym_t.jl_sym_t
PrototypeC.i jl_symbol_lookup(str.p-utf8) ; Returns *jl_sym_t.jl_sym_t
PrototypeC.i jl_symbol_n(str.p-utf8, len.l) ; Returns *jl_sym_t.jl_sym_t
PrototypeC.i jl_gensym() ; Returns *jl_sym_t.jl_sym_t
PrototypeC.i jl_tagged_gensym(str.p-utf8, len.l) ; Returns *jl_sym_t.jl_sym_t
PrototypeC.i jl_get_root_symbol() ; Returns *jl_sym_t.jl_sym_t
; PrototypeC.i jl_generic_function_def(*name.jl_sym_t, **bp.jl_value_t, *bp_owner.jl_value_t, *bnd.jl_binding_t) ; Returns *jl_value_t.jl_value_t
; PrototypeC jl_method_def(*argdata.jl_svec_t, *f.jl_lambda_info_t, *isstaged.jl_value_t)
PrototypeC.i jl_get_kwsorter(*tn.jl_typename_t) ; Returns *jl_function_t.jl_function_t
PrototypeC.i jl_box_bool(x.b) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_int8(x.b) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_uint8(x.a) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_int16(x.w) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_uint16(x.u) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_int32(x.l) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_uint32(x.l) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_char(x.l) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_int64(x.q) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_uint64(x.q) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_float32(x.f) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_float64(x.d) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_voidpointer(*x) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_ssavalue(x.i) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box_slotnumber(x.i) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box8 (*t.jl_datatype_t, x.b) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box16(*t.jl_datatype_t, x.w) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box32(*t.jl_datatype_t, x.l) ; Returns *jl_value_t.jl_value_t
PrototypeC.i jl_box64(*t.jl_datatype_t, x.q) ; Returns *jl_value_t.jl_value_t
PrototypeC.b jl_unbox_bool(*v.jl_value_t)
PrototypeC.b jl_unbox_int8(*v.jl_value_t)
PrototypeC.a jl_unbox_uint8(*v.jl_value_t)
PrototypeC.w jl_unbox_int16(*v.jl_value_t)
PrototypeC.u jl_unbox_uint16(*v.jl_value_t)
PrototypeC.l jl_unbox_int32(*v.jl_value_t)
PrototypeC.l jl_unbox_uint32(*v.jl_value_t)
PrototypeC.q jl_unbox_int64(*v.jl_value_t)
PrototypeC.q jl_unbox_uint64(*v.jl_value_t)
PrototypeC.f jl_unbox_float32(*v.jl_value_t)
PrototypeC.d jl_unbox_float64(*v.jl_value_t)
PrototypeC.i jl_unbox_voidpointer(*v.jl_value_t)
PrototypeC.l jl_get_size(*val.jl_value_t, *pnt.Integer)