1# Copyright (c) 2021-2024 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14# Mapping beetween managed core types and C++ mirror classes 15coretypes: 16- managed_class: panda.Object 17 mirror_class: ObjectHeader 18 19- managed_class: panda.String 20 mirror_class: coretypes::String 21 22- managed_class: panda.Class 23 mirror_class: coretypes::Class 24 25# Namespace that contains intrinsics implementation. For functions from 26# this namespace declaration in intrinsics.h will be generated 27intrinsics_namespace: ark::intrinsics 28 29# NB! The `space` property allows to group intrinsics and control 30# which intrinsics are loaded during startup. By default only "core" 31# space is loaded. See --load-runtimes for more details. 32# 33# The `signature` for instance intrinsics (`static` is false) doesn't include 34# `this` argument. 35intrinsics: 36- name: MathAbsI32 37 space: core 38 class_name: Math 39 method_name: absI32 40 static: true 41 signature: 42 ret: i32 43 args: 44 - i32 45 impl: ark::intrinsics::AbsI32 46 safe_intrinsic: true 47 48- name: MathAbsI64 49 space: core 50 class_name: Math 51 method_name: absI64 52 static: true 53 signature: 54 ret: i64 55 args: 56 - i64 57 impl: ark::intrinsics::AbsI64 58 safe_intrinsic: true 59 60- name: MathAbsF32 61 space: core 62 class_name: Math 63 method_name: absF32 64 static: true 65 signature: 66 ret: f32 67 args: 68 - f32 69 impl: ark::intrinsics::AbsF32 70 safe_intrinsic: true 71 72- name: MathAbsF64 73 space: core 74 class_name: Math 75 method_name: absF64 76 static: true 77 signature: 78 ret: f64 79 args: 80 - f64 81 impl: ark::intrinsics::AbsF64 82 safe_intrinsic: true 83 84- name: MathMinI32 85 space: core 86 class_name: Math 87 method_name: minI32 88 static: true 89 signature: 90 ret: i32 91 args: [i32, i32] 92 impl: ark::intrinsics::MinI32 93 safe_intrinsic: true 94 95- name: MathMinI64 96 space: core 97 class_name: Math 98 method_name: minI64 99 static: true 100 signature: 101 ret: i64 102 args: [i64, i64] 103 impl: ark::intrinsics::MinI64 104 safe_intrinsic: true 105 106- name: MathMinF32 107 space: core 108 class_name: Math 109 method_name: minF32 110 static: true 111 signature: 112 ret: f32 113 args: [f32, f32] 114 impl: ark::intrinsics::MinF32 115 safe_intrinsic: true 116 117- name: MathMinF64 118 space: core 119 class_name: Math 120 method_name: minF64 121 static: true 122 signature: 123 ret: f64 124 args: [f64, f64] 125 impl: ark::intrinsics::MinF64 126 safe_intrinsic: true 127 128- name: MathMaxI32 129 space: core 130 class_name: Math 131 method_name: maxI32 132 static: true 133 signature: 134 ret: i32 135 args: [i32, i32] 136 impl: ark::intrinsics::MaxI32 137 safe_intrinsic: true 138 139- name: MathMaxI64 140 space: core 141 class_name: Math 142 method_name: maxI64 143 static: true 144 signature: 145 ret: i64 146 args: [i64, i64] 147 impl: ark::intrinsics::MaxI64 148 safe_intrinsic: true 149 150- name: MathMaxF32 151 space: core 152 class_name: Math 153 method_name: maxF32 154 static: true 155 signature: 156 ret: f32 157 args: [f32, f32] 158 impl: ark::intrinsics::MaxF32 159 safe_intrinsic: true 160 161- name: MathMaxF64 162 space: core 163 class_name: Math 164 method_name: maxF64 165 static: true 166 signature: 167 ret: f64 168 args: [f64, f64] 169 impl: ark::intrinsics::MaxF64 170 safe_intrinsic: true 171 172- name: DoubleIsInf 173 space: core 174 class_name: Double 175 method_name: isInfinite 176 static: true 177 signature: 178 ret: u1 179 args: 180 - f64 181 impl: ark::intrinsics::IsInfF64 182 codegen_func: CreateFloatIsInf 183 llvm_codegen_func: EmitIsInf 184 safe_intrinsic: true 185 186- name: FloatIsInf 187 space: core 188 class_name: Float 189 method_name: isInfinite 190 static: true 191 signature: 192 ret: u1 193 args: 194 - f32 195 impl: ark::intrinsics::IsInfF32 196 codegen_func: CreateFloatIsInf 197 llvm_codegen_func: EmitIsInf 198 safe_intrinsic: true 199 200- name: MathSinF32 201 space: core 202 class_name: Math 203 method_name: fsin 204 static: true 205 signature: 206 ret: f32 207 args: 208 - f32 209 impl: ark::intrinsics::SinF32 210 llvm_impl: sin 211 safe_intrinsic: true 212 213- name: MathSinF64 214 space: core 215 class_name: Math 216 method_name: sin 217 static: true 218 signature: 219 ret: f64 220 args: 221 - f64 222 impl: ark::intrinsics::SinF64 223 llvm_impl: sin 224 safe_intrinsic: true 225 226- name: MathCosF32 227 space: core 228 class_name: Math 229 method_name: fcos 230 static: true 231 signature: 232 ret: f32 233 args: 234 - f32 235 impl: ark::intrinsics::CosF32 236 llvm_impl: cos 237 safe_intrinsic: true 238 239- name: MathCosF64 240 space: core 241 class_name: Math 242 method_name: cos 243 static: true 244 signature: 245 ret: f64 246 args: 247 - f64 248 impl: ark::intrinsics::CosF64 249 llvm_impl: cos 250 safe_intrinsic: true 251 252- name: MathPowF32 253 space: core 254 class_name: Math 255 method_name: fpow 256 static: true 257 signature: 258 ret: f32 259 args: 260 - f32 261 - f32 262 impl: ark::intrinsics::PowF32 263 llvm_impl: pow 264 safe_intrinsic: true 265 266- name: MathPowF64 267 space: core 268 class_name: Math 269 method_name: pow 270 static: true 271 signature: 272 ret: f64 273 args: 274 - f64 275 - f64 276 impl: ark::intrinsics::PowF64 277 llvm_impl: pow 278 safe_intrinsic: true 279 280- name: MathSqrtF32 281 space: core 282 class_name: Math 283 method_name: fsqrt 284 static: true 285 signature: 286 ret: f32 287 args: 288 - f32 289 impl: ark::intrinsics::SqrtF32 290 safe_intrinsic: true 291 292- name: MathSqrtF64 293 space: core 294 class_name: Math 295 method_name: sqrt 296 static: true 297 signature: 298 ret: f64 299 args: 300 - f64 301 impl: ark::intrinsics::SqrtF64 302 safe_intrinsic: true 303 304- name: MathCalculateDouble 305 space: core 306 class_name: Math 307 method_name: calculateDouble 308 static: true 309 private: true 310 signature: 311 ret: f64 312 args: [u32, f64] 313 impl: ark::intrinsics::CalculateDouble 314 clear_flags: [ can_throw, heap_inv ] 315 316- name: MathCalculateFloat 317 space: core 318 class_name: Math 319 method_name: calculateFloat 320 static: true 321 private: true 322 signature: 323 ret: f32 324 args: [u32, f32] 325 impl: ark::intrinsics::CalculateFloat 326 clear_flags: [ can_throw, heap_inv ] 327 328- name: IOPrintString 329 space: core 330 class_name: IO 331 method_name: printString 332 static: true 333 signature: 334 ret: void 335 args: 336 - panda.String 337 impl: ark::intrinsics::PrintString 338 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 339 340- name: IOPrintF32 341 space: core 342 class_name: IO 343 method_name: printF32 344 static: true 345 signature: 346 ret: void 347 args: 348 - f32 349 impl: ark::intrinsics::PrintF32 350 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 351 352- name: IOPrintF64 353 space: core 354 class_name: IO 355 method_name: printF64 356 static: true 357 signature: 358 ret: void 359 args: 360 - f64 361 impl: ark::intrinsics::PrintF64 362 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 363 364- name: IOPrintI32 365 space: core 366 class_name: IO 367 method_name: printI32 368 static: true 369 signature: 370 ret: void 371 args: 372 - i32 373 impl: ark::intrinsics::PrintI32 374 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 375 376- name: IOPrintU32 377 space: core 378 class_name: IO 379 method_name: printU32 380 static: true 381 signature: 382 ret: void 383 args: 384 - u32 385 impl: ark::intrinsics::PrintU32 386 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 387 388- name: IOPrintI64 389 space: core 390 class_name: IO 391 method_name: printI64 392 static: true 393 signature: 394 ret: void 395 args: 396 - i64 397 impl: ark::intrinsics::PrintI64 398 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 399 400- name: IOPrintU64 401 space: core 402 class_name: IO 403 method_name: printU64 404 static: true 405 signature: 406 ret: void 407 args: 408 - u64 409 impl: ark::intrinsics::PrintU64 410 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 411 412- name: CompilerMemmoveUnchecked_1Byte 413 space: core 414 compiler_only: true 415 static: true 416 signature: 417 ret: void 418 args: 419 - u8\[ 420 - u8\[ 421 - i32 422 - i32 423 - i32 424 codegen_arch: [arm64, amd64] 425 codegen_func: CreateMemmoveUnchecked 426 llvm_codegen_func: EmitMemmoveUnchecked 427 need_param_locations: true 428 429- name: CompilerMemmoveUnchecked_2Byte 430 space: core 431 compiler_only: true 432 static: true 433 signature: 434 ret: void 435 args: 436 - u16\[ 437 - u16\[ 438 - i32 439 - i32 440 - i32 441 codegen_arch: [arm64, amd64] 442 codegen_func: CreateMemmoveUnchecked 443 llvm_codegen_func: EmitMemmoveUnchecked 444 need_param_locations: true 445 446- name: CompilerMemmoveUnchecked_4Byte 447 space: core 448 compiler_only: true 449 static: true 450 signature: 451 ret: void 452 args: 453 - u32\[ 454 - u32\[ 455 - i32 456 - i32 457 - i32 458 codegen_arch: [arm64, amd64] 459 codegen_func: CreateMemmoveUnchecked 460 llvm_codegen_func: EmitMemmoveUnchecked 461 need_param_locations: true 462 463- name: CompilerMemmoveUnchecked_8Byte 464 space: core 465 compiler_only: true 466 static: true 467 signature: 468 ret: void 469 args: 470 - u64\[ 471 - u64\[ 472 - i32 473 - i32 474 - i32 475 codegen_arch: [arm64, amd64] 476 codegen_func: CreateMemmoveUnchecked 477 llvm_codegen_func: EmitMemmoveUnchecked 478 need_param_locations: true 479 480- name: SystemCompileMethod 481 space: core 482 class_name: System 483 method_name: compileMethod 484 static: true 485 private: true 486 signature: 487 ret: u8 488 args: [panda.String] 489 impl: ark::intrinsics::CompileMethod 490 491- name: SystemExit 492 space: core 493 class_name: System 494 method_name: exit 495 static: true 496 signature: 497 ret: void 498 args: 499 - i32 500 impl: ark::intrinsics::SystemExit 501 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 502 503- name: SystemNanoTime 504 space: core 505 class_name: System 506 method_name: nanoTime 507 static: true 508 signature: 509 ret: i64 510 args: [] 511 impl: ark::intrinsics::NanoTime 512 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 513 514- name: SystemAssert 515 space: core 516 class_name: System 517 method_name: assert 518 static: true 519 signature: 520 ret: void 521 args: [u1] 522 impl: ark::intrinsics::Assert 523 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 524 525- name: SystemAssertPrint 526 space: core 527 class_name: System 528 method_name: assertPrint 529 static: true 530 signature: 531 ret: void 532 args: [u1, panda.String] 533 impl: ark::intrinsics::AssertPrint 534 clear_flags: [require_state, runtime_call, can_throw, heap_inv] 535 536- name: SystemScheduleCoroutine 537 space: core 538 class_name: System 539 method_name: scheduleCoroutine 540 static: true 541 signature: 542 ret: void 543 args: [] 544 impl: ark::intrinsics::SystemScheduleCoroutine 545 546- name: SystemCoroutineGetWorkerId 547 space: core 548 class_name: System 549 method_name: getCoroutineWorkerId 550 static: true 551 signature: 552 ret: i32 553 args: [] 554 impl: ark::intrinsics::SystemCoroutineGetWorkerId 555 556- name: CheckTag 557 space: core 558 class_name: DebugUtils 559 method_name: checkTag 560 static: true 561 signature: 562 ret: void 563 args: [i64, i64] 564 impl: ark::intrinsics::CheckTag 565 clear_flags: [require_state, runtime_call, can_throw, heap_inv ] 566 567- name: ConvertStringToI32 568 space: core 569 class_name: Convert 570 method_name: stringToI32 571 static: true 572 signature: 573 ret: i32 574 args: [panda.String] 575 impl: ark::intrinsics::ConvertStringToI32 576 safe_intrinsic: true 577 578- name: ConvertStringToU32 579 space: core 580 class_name: Convert 581 method_name: stringToU32 582 static: true 583 signature: 584 ret: u32 585 args: [panda.String] 586 impl: ark::intrinsics::ConvertStringToU32 587 safe_intrinsic: true 588 589- name: ConvertStringToI64 590 space: core 591 class_name: Convert 592 method_name: stringToI64 593 static: true 594 signature: 595 ret: i64 596 args: [panda.String] 597 impl: ark::intrinsics::ConvertStringToI64 598 safe_intrinsic: true 599 600- name: ConvertStringToU64 601 space: core 602 class_name: Convert 603 method_name: stringToU64 604 static: true 605 signature: 606 ret: u64 607 args: [panda.String] 608 impl: ark::intrinsics::ConvertStringToU64 609 safe_intrinsic: true 610 611- name: ConvertStringToF32 612 space: core 613 class_name: Convert 614 method_name: stringToF32 615 static: true 616 signature: 617 ret: f32 618 args: [panda.String] 619 impl: ark::intrinsics::ConvertStringToF32 620 safe_intrinsic: true 621 622- name: ConvertStringToF64 623 space: core 624 class_name: Convert 625 method_name: stringToF64 626 static: true 627 signature: 628 ret: f64 629 args: [panda.String] 630 impl: ark::intrinsics::ConvertStringToF64 631 safe_intrinsic: true 632 633- name: ObjectCreateNonMovable 634 space: core 635 class_name: Object 636 method_name: createNonMovable 637 static: true 638 signature: 639 ret: panda.Object 640 args: [panda.Class] 641 impl: ark::intrinsics::ObjectCreateNonMovable 642 clear_flags: [ heap_inv ] 643 644- name: ObjectMonitorEnter 645 space: core 646 class_name: Object 647 method_name: monitorEnter 648 static: true 649 signature: 650 ret: void 651 args: [panda.Object] 652 impl: ark::intrinsics::ObjectMonitorEnter 653 654- name: ObjectMonitorExit 655 space: core 656 class_name: Object 657 method_name: monitorExit 658 static: true 659 signature: 660 ret: void 661 args: [panda.Object] 662 impl: ark::intrinsics::ObjectMonitorExit 663 664- name: ObjectWait 665 space: core 666 class_name: Object 667 method_name: Wait 668 static: true 669 signature: 670 ret: void 671 args: [panda.Object] 672 impl: ark::intrinsics::ObjectWait 673 674- name: ObjectTimedWait 675 space: core 676 class_name: Object 677 method_name: TimedWait 678 static: true 679 signature: 680 ret: void 681 args: [panda.Object, u64] 682 impl: ark::intrinsics::ObjectTimedWait 683 684- name: ObjectTimedWaitNanos 685 space: core 686 class_name: Object 687 method_name: TimedWaitNanos 688 static: true 689 signature: 690 ret: void 691 args: [panda.Object, u64, u64] 692 impl: ark::intrinsics::ObjectTimedWaitNanos 693 694- name: ObjectNotify 695 space: core 696 class_name: Object 697 method_name: Notify 698 static: true 699 signature: 700 ret: void 701 args: [panda.Object] 702 impl: ark::intrinsics::ObjectNotify 703 clear_flags: [require_state, runtime_call, can_throw, heap_inv ] 704 705- name: ObjectNotifyAll 706 space: core 707 class_name: Object 708 method_name: NotifyAll 709 static: true 710 signature: 711 ret: void 712 args: [panda.Object] 713 impl: ark::intrinsics::ObjectNotifyAll 714 clear_flags: [require_state, runtime_call, can_throw, heap_inv ] 715