1/* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17// DEF_INTRINSICS_FUNC(ID, NAME, ATTR, RET_TYPE, 18// ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) 19#ifndef DEF_INTRINSICS_FUNC 20# error "missing DEF_INTRINSICS_FUNC definition!" 21#endif 22 23#define _EVAL_DEF_INTRINSICS_FUNC(ID, NAME, ATTR, RET_TYPE, ...) \ 24 DEF_INTRINSICS_FUNC(ID, NAME, ATTR, RET_TYPE, __VA_ARGS__) 25 26#define _EXPAND_ARG0() kNone, kNone, kNone, kNone, kNone 27#define _EXPAND_ARG1(ARG1) ARG1, kNone, kNone, kNone, kNone 28#define _EXPAND_ARG2(ARG1, ARG2) ARG1, ARG2, kNone, kNone, kNone 29#define _EXPAND_ARG3(ARG1, ARG2, ARG3) ARG1, ARG2, ARG3, kNone, kNone 30#define _EXPAND_ARG4(ARG1, ARG2, ARG3, ARG4) ARG1, ARG2, ARG3, ARG4, kNone 31#define _EXPAND_ARG5(ARG1, ARG2, ARG3, ARG4, ARG5) \ 32 ARG1, ARG2, ARG3, ARG4, ARG5 33 34#define _JTYPE(TYPE, SPACE) _JTYPE_OF_ ## TYPE ## _UNDER_ ## SPACE 35 36// Note: These should be consistent with the type return from 37// IRBuilder::GetJType([type], kArray). 38#define _JTYPE_OF_kInt1Ty_UNDER_kArray kInt8Ty 39#define _JTYPE_OF_kInt8Ty_UNDER_kArray kInt8Ty 40#define _JTYPE_OF_kInt16Ty_UNDER_kArray kInt16Ty 41#define _JTYPE_OF_kInt32Ty_UNDER_kArray kInt32Ty 42#define _JTYPE_OF_kInt64Ty_UNDER_kArray kInt64Ty 43#define _JTYPE_OF_kJavaObjectTy_UNDER_kArray kJavaObjectTy 44 45// Note: These should be consistent with the type return from 46// IRBuilder::GetJType([type], kField). 47#define _JTYPE_OF_kInt1Ty_UNDER_kField kInt32Ty 48#define _JTYPE_OF_kInt8Ty_UNDER_kField kInt32Ty 49#define _JTYPE_OF_kInt16Ty_UNDER_kField kInt32Ty 50#define _JTYPE_OF_kInt32Ty_UNDER_kField kInt32Ty 51#define _JTYPE_OF_kInt64Ty_UNDER_kField kInt64Ty 52#define _JTYPE_OF_kJavaObjectTy_UNDER_kField kJavaObjectTy 53 54//---------------------------------------------------------------------------- 55// Thread 56//---------------------------------------------------------------------------- 57 58// Thread* art_portable_get_current_thread() 59_EVAL_DEF_INTRINSICS_FUNC(GetCurrentThread, 60 art_portable_get_current_thread, 61 kAttrReadNone | kAttrNoThrow, 62 kJavaThreadTy, 63 _EXPAND_ARG0()) 64 65// void art_portable_test_suspend(Thread* thread) 66_EVAL_DEF_INTRINSICS_FUNC(TestSuspend, 67 art_portable_test_suspend, 68 kAttrNoThrow, 69 kVoidTy, 70 _EXPAND_ARG1(kJavaThreadTy)) 71 72// void art_portable_check_suspend() /* Expands to GetCurrentThread/TestSuspend */ 73_EVAL_DEF_INTRINSICS_FUNC(CheckSuspend, 74 art_portable_check_suspend, 75 kAttrNoThrow, 76 kVoidTy, 77 _EXPAND_ARG0()) 78 79// void art_portable_mark_gc_card(Object* new_value, Object* object) 80_EVAL_DEF_INTRINSICS_FUNC(MarkGCCard, 81 art_portable_mark_gc_card, 82 kAttrNoThrow, 83 kVoidTy, 84 _EXPAND_ARG2(kJavaObjectTy, kJavaObjectTy)) 85 86//---------------------------------------------------------------------------- 87// Exception 88//---------------------------------------------------------------------------- 89 90// Should not expand - introduces the catch targets for a potentially 91// throwing instruction. The result is a switch key and this 92// instruction will be followed by a switch statement. The catch 93// targets will be enumerated as cases of the switch, with the fallthrough 94// designating the block containing the potentially throwing instruction. 95// bool art_portable_catch_targets(int dex_pc) 96_EVAL_DEF_INTRINSICS_FUNC(CatchTargets, 97 art_portable_catch_targets, 98 kAttrReadOnly | kAttrNoThrow, 99 kInt32Ty, 100 _EXPAND_ARG1(kInt32ConstantTy)) 101 102// void art_portable_throw_exception(JavaObject* exception) 103_EVAL_DEF_INTRINSICS_FUNC(ThrowException, 104 art_portable_throw_exception, 105 kAttrDoThrow, 106 kVoidTy, 107 _EXPAND_ARG1(kJavaObjectTy)) 108 109// void art_portable_hl_throw_exception(JavaObject* exception) 110_EVAL_DEF_INTRINSICS_FUNC(HLThrowException, 111 art_portable_hl_throw_exception, 112 kAttrDoThrow, 113 kVoidTy, 114 _EXPAND_ARG1(kJavaObjectTy)) 115 116// JavaObject* art_portable_get_current_exception() 117_EVAL_DEF_INTRINSICS_FUNC(GetException, 118 art_portable_get_current_exception, 119 kAttrReadOnly | kAttrNoThrow, 120 kJavaObjectTy, 121 _EXPAND_ARG0()) 122 123// bool art_portable_is_exception_pending() 124_EVAL_DEF_INTRINSICS_FUNC(IsExceptionPending, 125 art_portable_is_exception_pending, 126 kAttrReadOnly | kAttrNoThrow, 127 kInt1Ty, 128 _EXPAND_ARG0()) 129 130// int art_portable_find_catch_block(Method* method, int try_item_offset) 131_EVAL_DEF_INTRINSICS_FUNC(FindCatchBlock, 132 art_portable_find_catch_block, 133 kAttrReadOnly | kAttrNoThrow, 134 kInt32Ty, 135 _EXPAND_ARG2(kJavaMethodTy, kInt32ConstantTy)) 136 137// void art_portable_throw_div_zero() 138_EVAL_DEF_INTRINSICS_FUNC(ThrowDivZeroException, 139 art_portable_throw_div_zero, 140 kAttrDoThrow, 141 kVoidTy, 142 _EXPAND_ARG0()) 143 144// void art_portable_throw_null_pointer_exception(uint32_t dex_pc) 145_EVAL_DEF_INTRINSICS_FUNC(ThrowNullPointerException, 146 art_portable_throw_null_pointer_exception, 147 kAttrDoThrow, 148 kVoidTy, 149 _EXPAND_ARG1(kInt32ConstantTy)) 150 151// void art_portable_throw_array_bounds(int index, int array_len) 152_EVAL_DEF_INTRINSICS_FUNC(ThrowIndexOutOfBounds, 153 art_portable_throw_array_bounds, 154 kAttrDoThrow, 155 kVoidTy, 156 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 157 158//---------------------------------------------------------------------------- 159// ConstString 160//---------------------------------------------------------------------------- 161 162// JavaObject* art_portable_const_string(uint32_t string_idx) 163_EVAL_DEF_INTRINSICS_FUNC(ConstString, 164 art_portable_const_string, 165 kAttrReadOnly | kAttrNoThrow, 166 kJavaObjectTy, 167 _EXPAND_ARG1(kInt32ConstantTy)) 168 169// JavaObject* art_portable_load_string_from_dex_cache(Method* method, uint32_t string_idx) 170_EVAL_DEF_INTRINSICS_FUNC(LoadStringFromDexCache, 171 art_portable_load_string_from_dex_cache, 172 kAttrReadOnly | kAttrNoThrow, 173 kJavaObjectTy, 174 _EXPAND_ARG1(kInt32ConstantTy)) 175 176// JavaObject* art_portable_resolve_string(Method* method, uint32_t string_idx) 177_EVAL_DEF_INTRINSICS_FUNC(ResolveString, 178 art_portable_resolve_string, 179 kAttrNone, 180 kJavaObjectTy, 181 _EXPAND_ARG2(kJavaMethodTy, kInt32ConstantTy)) 182 183//---------------------------------------------------------------------------- 184// ConstClass 185//---------------------------------------------------------------------------- 186 187// JavaObject* art_portable_const_class(uint32_t type_idx) 188_EVAL_DEF_INTRINSICS_FUNC(ConstClass, 189 art_portable_const_class, 190 kAttrReadOnly | kAttrNoThrow, 191 kJavaObjectTy, 192 _EXPAND_ARG1(kInt32ConstantTy)) 193 194// JavaObject* art_portable_initialize_type_and_verify_access(uint32_t type_idx, 195// Method* referrer, 196// Thread* thread) 197_EVAL_DEF_INTRINSICS_FUNC(InitializeTypeAndVerifyAccess, 198 art_portable_initialize_type_and_verify_access, 199 kAttrNone, 200 kJavaObjectTy, 201 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaThreadTy)) 202 203// JavaObject* art_portable_load_type_from_dex_cache(uint32_t type_idx) 204_EVAL_DEF_INTRINSICS_FUNC(LoadTypeFromDexCache, 205 art_portable_load_type_from_dex_cache, 206 kAttrReadOnly | kAttrNoThrow, 207 kJavaObjectTy, 208 _EXPAND_ARG1(kInt32ConstantTy)) 209 210// JavaObject* art_portable_initialize_type(uint32_t type_idx, 211// Method* referrer, 212// Thread* thread) 213_EVAL_DEF_INTRINSICS_FUNC(InitializeType, 214 art_portable_initialize_type, 215 kAttrNone, 216 kJavaObjectTy, 217 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaThreadTy)) 218 219//---------------------------------------------------------------------------- 220// Lock 221//---------------------------------------------------------------------------- 222 223// void art_portable_lock_object(JavaObject* obj, Thread* thread) 224_EVAL_DEF_INTRINSICS_FUNC(LockObject, 225 art_portable_lock_object, 226 kAttrNoThrow, 227 kVoidTy, 228 _EXPAND_ARG2(kJavaObjectTy, kJavaThreadTy)) 229 230// void art_portable_unlock_object(JavaObject* obj, Thread* thread) 231_EVAL_DEF_INTRINSICS_FUNC(UnlockObject, 232 art_portable_unlock_object, 233 kAttrNone, 234 kVoidTy, 235 _EXPAND_ARG2(kJavaObjectTy, kJavaThreadTy)) 236 237//---------------------------------------------------------------------------- 238// Cast 239//---------------------------------------------------------------------------- 240 241// void art_portable_check_cast(JavaObject* dest_type, JavaObject* src_type) 242_EVAL_DEF_INTRINSICS_FUNC(CheckCast, 243 art_portable_check_cast, 244 kAttrNone, 245 kVoidTy, 246 _EXPAND_ARG2(kJavaObjectTy, kJavaObjectTy)) 247 248// void art_portable_hl_check_cast(uint32_t type_idx, JavaObject* obj) 249_EVAL_DEF_INTRINSICS_FUNC(HLCheckCast, 250 art_portable_hl_check_cast, 251 kAttrReadOnly | kAttrNoThrow, 252 kVoidTy, 253 _EXPAND_ARG2(kInt32ConstantTy, kJavaObjectTy)) 254 255// int art_portable_is_assignable(JavaObject* dest_type, JavaObject* src_type) 256_EVAL_DEF_INTRINSICS_FUNC(IsAssignable, 257 art_portable_is_assignable, 258 kAttrReadOnly | kAttrNoThrow, 259 kInt32Ty, 260 _EXPAND_ARG2(kJavaObjectTy, kJavaObjectTy)) 261 262//---------------------------------------------------------------------------- 263// Allocation 264//---------------------------------------------------------------------------- 265 266// JavaObject* art_portable_alloc_object(uint32_t type_idx, 267// Method* referrer, 268// Thread* thread) 269_EVAL_DEF_INTRINSICS_FUNC(AllocObject, 270 art_portable_alloc_object, 271 kAttrNone, 272 kJavaObjectTy, 273 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaThreadTy)) 274 275// JavaObject* art_portable_alloc_object_with_access_check(uint32_t type_idx, 276// Method* referrer, 277// Thread* thread) 278_EVAL_DEF_INTRINSICS_FUNC(AllocObjectWithAccessCheck, 279 art_portable_alloc_object_with_access_check, 280 kAttrNone, 281 kJavaObjectTy, 282 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaThreadTy)) 283 284//---------------------------------------------------------------------------- 285// Instance 286//---------------------------------------------------------------------------- 287 288// JavaObject* art_portable_new_instance(uint32_t type_idx) 289_EVAL_DEF_INTRINSICS_FUNC(NewInstance, 290 art_portable_new_instance, 291 kAttrNone, 292 kJavaObjectTy, 293 _EXPAND_ARG1(kInt32Ty)) 294 295// bool art_portable_instance_of(uint32_t type_idx, JavaObject* ref) 296_EVAL_DEF_INTRINSICS_FUNC(InstanceOf, 297 art_portable_instance_of, 298 kAttrNone, 299 kInt32Ty, 300 _EXPAND_ARG2(kInt32Ty, kJavaObjectTy)) 301 302//---------------------------------------------------------------------------- 303// Array 304//---------------------------------------------------------------------------- 305 306// JavaObject* art_portable_new_array(uint32_t type_idx, uint32_t array_size) 307_EVAL_DEF_INTRINSICS_FUNC(NewArray, 308 art_portable_new_array, 309 kAttrNone, 310 kJavaObjectTy, 311 _EXPAND_ARG2(kInt32ConstantTy, kInt32Ty)) 312 313// uint32_t art_portable_opt_array_length(int32_t opt_flags, JavaObject* array) 314_EVAL_DEF_INTRINSICS_FUNC(OptArrayLength, 315 art_portable_opt_array_length, 316 kAttrReadOnly | kAttrNoThrow, 317 kInt32Ty, 318 _EXPAND_ARG2(kInt32Ty, kJavaObjectTy)) 319 320// uint32_t art_portable_array_length(JavaObject* array) 321_EVAL_DEF_INTRINSICS_FUNC(ArrayLength, 322 art_portable_array_length, 323 kAttrReadOnly | kAttrNoThrow, 324 kInt32Ty, 325 _EXPAND_ARG1(kJavaObjectTy)) 326 327// JavaObject* art_portable_alloc_array(uint32_t type_idx, 328// Method* referrer, 329// uint32_t length, 330// Thread* thread) 331_EVAL_DEF_INTRINSICS_FUNC(AllocArray, 332 art_portable_alloc_array, 333 kAttrNone, 334 kJavaObjectTy, 335 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kInt32Ty, kJavaThreadTy)) 336 337// JavaObject* art_portable_alloc_array_with_access_check(uint32_t type_idx, 338// Method* referrer, 339// uint32_t length, 340// Thread* thread) 341_EVAL_DEF_INTRINSICS_FUNC(AllocArrayWithAccessCheck, 342 art_portable_alloc_array_with_access_check, 343 kAttrNone, 344 kJavaObjectTy, 345 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kInt32Ty, kJavaThreadTy)) 346 347// JavaObject* art_portable_check_and_alloc_array(uint32_t type_idx, 348// Method* referrer, 349// uint32_t length, 350// Thread* thread) 351_EVAL_DEF_INTRINSICS_FUNC(CheckAndAllocArray, 352 art_portable_check_and_alloc_array, 353 kAttrNone, 354 kJavaObjectTy, 355 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kInt32ConstantTy, kJavaThreadTy)) 356 357// JavaObject* art_portable_check_and_alloc_array_with_access_check(uint32_t type_idx, 358// Method* referrer, 359// uint32_t length, 360// Thread* thread) 361_EVAL_DEF_INTRINSICS_FUNC(CheckAndAllocArrayWithAccessCheck, 362 art_portable_check_and_alloc_array_with_access_check, 363 kAttrNone, 364 kJavaObjectTy, 365 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kInt32ConstantTy, kJavaThreadTy)) 366 367// art_portable_aget_* and art_portable_aput_* never generate exception since the 368// necessary checking on arguments (e.g., array and index) has already done 369// before invocation of these intrinsics. 370// 371// [type] void art_portable_aget_[type](JavaObject* array, uint32_t index) 372_EVAL_DEF_INTRINSICS_FUNC(ArrayGet, 373 art_portable_aget, 374 kAttrReadOnly | kAttrNoThrow, 375 _JTYPE(kInt32Ty, kArray), 376 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 377 378_EVAL_DEF_INTRINSICS_FUNC(ArrayGetWide, 379 art_portable_aget_wide, 380 kAttrReadOnly | kAttrNoThrow, 381 _JTYPE(kInt64Ty, kArray), 382 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 383 384_EVAL_DEF_INTRINSICS_FUNC(ArrayGetObject, 385 art_portable_aget_object, 386 kAttrReadOnly | kAttrNoThrow, 387 _JTYPE(kJavaObjectTy, kArray), 388 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 389 390_EVAL_DEF_INTRINSICS_FUNC(ArrayGetBoolean, 391 art_portable_aget_boolean, 392 kAttrReadOnly | kAttrNoThrow, 393 _JTYPE(kInt1Ty, kArray), 394 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 395 396_EVAL_DEF_INTRINSICS_FUNC(ArrayGetByte, 397 art_portable_aget_byte, 398 kAttrReadOnly | kAttrNoThrow, 399 _JTYPE(kInt8Ty, kArray), 400 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 401 402_EVAL_DEF_INTRINSICS_FUNC(ArrayGetChar, 403 art_portable_aget_char, 404 kAttrReadOnly | kAttrNoThrow, 405 _JTYPE(kInt16Ty, kArray), 406 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 407 408_EVAL_DEF_INTRINSICS_FUNC(ArrayGetShort, 409 art_portable_aget_short, 410 kAttrReadOnly | kAttrNoThrow, 411 _JTYPE(kInt16Ty, kArray), 412 _EXPAND_ARG2(kJavaObjectTy, kInt32Ty)) 413 414// void art_portable_aput_[type]([type] value, JavaObject* array, uint32_t index) 415_EVAL_DEF_INTRINSICS_FUNC(ArrayPut, 416 art_portable_aput, 417 kAttrNoThrow, 418 kVoidTy, 419 _EXPAND_ARG3(_JTYPE(kInt32Ty, kArray), kJavaObjectTy, kInt32Ty)) 420 421_EVAL_DEF_INTRINSICS_FUNC(ArrayPutWide, 422 art_portable_aput_wide, 423 kAttrNoThrow, 424 kVoidTy, 425 _EXPAND_ARG3(_JTYPE(kInt64Ty, kArray), kJavaObjectTy, kInt32Ty)) 426 427_EVAL_DEF_INTRINSICS_FUNC(ArrayPutObject, 428 art_portable_aput_object, 429 kAttrNoThrow, 430 kVoidTy, 431 _EXPAND_ARG3(_JTYPE(kJavaObjectTy, kArray), kJavaObjectTy, kInt32Ty)) 432 433_EVAL_DEF_INTRINSICS_FUNC(ArrayPutBoolean, 434 art_portable_aput_boolean, 435 kAttrNoThrow, 436 kVoidTy, 437 _EXPAND_ARG3(_JTYPE(kInt1Ty, kArray), kJavaObjectTy, kInt32Ty)) 438 439_EVAL_DEF_INTRINSICS_FUNC(ArrayPutByte, 440 art_portable_aput_byte, 441 kAttrNoThrow, 442 kVoidTy, 443 _EXPAND_ARG3(_JTYPE(kInt8Ty, kArray), kJavaObjectTy, kInt32Ty)) 444 445_EVAL_DEF_INTRINSICS_FUNC(ArrayPutChar, 446 art_portable_aput_char, 447 kAttrNoThrow, 448 kVoidTy, 449 _EXPAND_ARG3(_JTYPE(kInt16Ty, kArray), kJavaObjectTy, kInt32Ty)) 450 451_EVAL_DEF_INTRINSICS_FUNC(ArrayPutShort, 452 art_portable_aput_short, 453 kAttrNoThrow, 454 kVoidTy, 455 _EXPAND_ARG3(_JTYPE(kInt16Ty, kArray), kJavaObjectTy, kInt32Ty)) 456 457// void art_portable_check_put_array_element(JavaObject* value, JavaObject* array) 458_EVAL_DEF_INTRINSICS_FUNC(CheckPutArrayElement, 459 art_portable_check_put_array_element, 460 kAttrNone, 461 kVoidTy, 462 _EXPAND_ARG2(kJavaObjectTy, kJavaObjectTy)) 463 464// void art_portable_filled_new_array(Array* array, 465// uint32_t elem_jty, ...) 466_EVAL_DEF_INTRINSICS_FUNC(FilledNewArray, 467 art_portable_filled_new_array, 468 kAttrNoThrow, 469 kVoidTy, 470 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kVarArgTy)) 471 472// void art_portable_fill_array_data(Method* referrer, 473// uint32_t dex_pc, 474// Array* array, 475// uint32_t payload_offset) 476_EVAL_DEF_INTRINSICS_FUNC(FillArrayData, 477 art_portable_fill_array_data, 478 kAttrNone, 479 kVoidTy, 480 _EXPAND_ARG4(kJavaMethodTy, kInt32ConstantTy, kJavaObjectTy, kInt32ConstantTy)) 481 482// void art_portable_hl_fill_array_data(int32_t offset, JavaObject* array) 483_EVAL_DEF_INTRINSICS_FUNC(HLFillArrayData, 484 art_portable_hl_fill_array_data, 485 kAttrNone, 486 kVoidTy, 487 _EXPAND_ARG2(kInt32ConstantTy, kJavaObjectTy)) 488 489//---------------------------------------------------------------------------- 490// Instance Field 491//---------------------------------------------------------------------------- 492 493// [type] art_portable_iget_[type](uint32_t field_idx, 494// Method* referrer, 495// JavaObject* obj) 496_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGet, 497 art_portable_iget, 498 kAttrNone, 499 _JTYPE(kInt32Ty, kField), 500 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 501 502_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetWide, 503 art_portable_iget_wide, 504 kAttrNone, 505 _JTYPE(kInt64Ty, kField), 506 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 507 508_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetObject, 509 art_portable_iget_object, 510 kAttrNone, 511 _JTYPE(kJavaObjectTy, kField), 512 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 513 514_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetBoolean, 515 art_portable_iget_boolean, 516 kAttrNone, 517 _JTYPE(kInt1Ty, kField), 518 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 519 520_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetByte, 521 art_portable_iget_byte, 522 kAttrNone, 523 _JTYPE(kInt8Ty, kField), 524 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 525 526_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetChar, 527 art_portable_iget_char, 528 kAttrNone, 529 _JTYPE(kInt16Ty, kField), 530 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 531 532_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetShort, 533 art_portable_iget_short, 534 kAttrNone, 535 _JTYPE(kInt16Ty, kField), 536 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy)) 537 538// [type] art_portable_iget_[type].fast(int field_offset, 539// bool is_volatile, 540// JavaObject* obj) 541_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetFast, 542 art_portable_iget.fast, 543 kAttrReadOnly | kAttrNoThrow, 544 _JTYPE(kInt32Ty, kField), 545 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 546 547_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetWideFast, 548 art_portable_iget_wide.fast, 549 kAttrReadOnly | kAttrNoThrow, 550 _JTYPE(kInt64Ty, kField), 551 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 552 553_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetObjectFast, 554 art_portable_iget_object.fast, 555 kAttrReadOnly | kAttrNoThrow, 556 _JTYPE(kJavaObjectTy, kField), 557 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 558 559_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetBooleanFast, 560 art_portable_iget_boolean.fast, 561 kAttrReadOnly | kAttrNoThrow, 562 _JTYPE(kInt1Ty, kField), 563 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 564 565_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetByteFast, 566 art_portable_iget_byte.fast, 567 kAttrReadOnly | kAttrNoThrow, 568 _JTYPE(kInt8Ty, kField), 569 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 570 571_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetCharFast, 572 art_portable_iget_char.fast, 573 kAttrReadOnly | kAttrNoThrow, 574 _JTYPE(kInt16Ty, kField), 575 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 576 577_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldGetShortFast, 578 art_portable_iget_short.fast, 579 kAttrReadOnly | kAttrNoThrow, 580 _JTYPE(kInt16Ty, kField), 581 _EXPAND_ARG3(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy)) 582 583// void art_portable_iput_[type](uint32_t field_idx, 584// Method* referrer, 585// JavaObject* obj, 586// [type] new_value) 587_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPut, 588 art_portable_iput, 589 kAttrNone, 590 kVoidTy, 591 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kInt32Ty, kField))) 592 593_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutWide, 594 art_portable_iput_wide, 595 kAttrNone, 596 kVoidTy, 597 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kInt64Ty, kField))) 598 599_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutObject, 600 art_portable_iput_object, 601 kAttrNone, 602 kVoidTy, 603 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kJavaObjectTy, kField))) 604 605_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutBoolean, 606 art_portable_iput_boolean, 607 kAttrNone, 608 kVoidTy, 609 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kInt1Ty, kField))) 610 611_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutByte, 612 art_portable_iput_byte, 613 kAttrNone, 614 kVoidTy, 615 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kInt8Ty, kField))) 616 617_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutChar, 618 art_portable_iput_char, 619 kAttrNone, 620 kVoidTy, 621 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kInt16Ty, kField))) 622 623_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutShort, 624 art_portable_iput_short, 625 kAttrNone, 626 kVoidTy, 627 _EXPAND_ARG4(kInt32ConstantTy, kJavaMethodTy, kJavaObjectTy, _JTYPE(kInt16Ty, kField))) 628 629// void art_portable_iput_[type].fast(int field_offset, 630// bool is_volatile, 631// JavaObject* obj, 632// [type] new_value) 633_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutFast, 634 art_portable_iput.fast, 635 kAttrNoThrow, 636 kVoidTy, 637 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kInt32Ty, kField))) 638 639_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutWideFast, 640 art_portable_iput_wide.fast, 641 kAttrNoThrow, 642 kVoidTy, 643 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kInt64Ty, kField))) 644 645_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutObjectFast, 646 art_portable_iput_object.fast, 647 kAttrNoThrow, 648 kVoidTy, 649 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kJavaObjectTy, kField))) 650 651_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutBooleanFast, 652 art_portable_iput_boolean.fast, 653 kAttrNoThrow, 654 kVoidTy, 655 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kInt1Ty, kField))) 656 657_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutByteFast, 658 art_portable_iput_byte.fast, 659 kAttrNoThrow, 660 kVoidTy, 661 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kInt8Ty, kField))) 662 663_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutCharFast, 664 art_portable_iput_char.fast, 665 kAttrNoThrow, 666 kVoidTy, 667 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kInt16Ty, kField))) 668 669_EVAL_DEF_INTRINSICS_FUNC(InstanceFieldPutShortFast, 670 art_portable_iput_short.fast, 671 kAttrNoThrow, 672 kVoidTy, 673 _EXPAND_ARG4(kInt32ConstantTy, kInt1ConstantTy, kJavaObjectTy, _JTYPE(kInt16Ty, kField))) 674 675//---------------------------------------------------------------------------- 676// Static Field 677//---------------------------------------------------------------------------- 678 679// [type] art_portable_sget_[type](uint32_t field_idx, Method* referrer) 680_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGet, 681 art_portable_sget, 682 kAttrNone, 683 _JTYPE(kInt32Ty, kField), 684 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 685 686_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetWide, 687 art_portable_sget_wide, 688 kAttrNone, 689 _JTYPE(kInt64Ty, kField), 690 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 691 692_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetObject, 693 art_portable_sget_object, 694 kAttrNone, 695 _JTYPE(kJavaObjectTy, kField), 696 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 697 698_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetBoolean, 699 art_portable_sget_boolean, 700 kAttrNone, 701 _JTYPE(kInt1Ty, kField), 702 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 703 704_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetByte, 705 art_portable_sget_byte, 706 kAttrNone, 707 _JTYPE(kInt8Ty, kField), 708 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 709 710_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetChar, 711 art_portable_sget_char, 712 kAttrNone, 713 _JTYPE(kInt16Ty, kField), 714 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 715 716_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetShort, 717 art_portable_sget_short, 718 kAttrNone, 719 _JTYPE(kInt16Ty, kField), 720 _EXPAND_ARG2(kInt32ConstantTy, kJavaMethodTy)) 721 722// [type] art_portable_sget_[type].fast(JavaObject* ssb, 723// int field_offset, 724// bool is_volatile) 725_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetFast, 726 art_portable_sget.fast, 727 kAttrReadOnly | kAttrNoThrow, 728 _JTYPE(kInt32Ty, kField), 729 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 730 731_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetWideFast, 732 art_portable_sget_wide.fast, 733 kAttrReadOnly | kAttrNoThrow, 734 _JTYPE(kInt64Ty, kField), 735 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 736 737_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetObjectFast, 738 art_portable_sget_object.fast, 739 kAttrReadOnly | kAttrNoThrow, 740 _JTYPE(kJavaObjectTy, kField), 741 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 742 743_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetBooleanFast, 744 art_portable_sget_boolean.fast, 745 kAttrReadOnly | kAttrNoThrow, 746 _JTYPE(kInt1Ty, kField), 747 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 748 749_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetByteFast, 750 art_portable_sget_byte.fast, 751 kAttrReadOnly | kAttrNoThrow, 752 _JTYPE(kInt8Ty, kField), 753 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 754 755_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetCharFast, 756 art_portable_sget_char.fast, 757 kAttrReadOnly | kAttrNoThrow, 758 _JTYPE(kInt16Ty, kField), 759 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 760 761_EVAL_DEF_INTRINSICS_FUNC(StaticFieldGetShortFast, 762 art_portable_sget_short.fast, 763 kAttrReadOnly | kAttrNoThrow, 764 _JTYPE(kInt16Ty, kField), 765 _EXPAND_ARG3(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy)) 766 767// void art_portable_sput_[type](uint32_t field_idx, 768// Method* referrer, 769// [type] new_value) 770_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPut, 771 art_portable_sput, 772 kAttrNone, 773 kVoidTy, 774 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kInt32Ty, kField))) 775 776_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutWide, 777 art_portable_sput_wide, 778 kAttrNone, 779 kVoidTy, 780 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kInt64Ty, kField))) 781 782_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutObject, 783 art_portable_sput_object, 784 kAttrNone, 785 kVoidTy, 786 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kJavaObjectTy, kField))) 787 788_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutBoolean, 789 art_portable_sput_boolean, 790 kAttrNone, 791 kVoidTy, 792 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kInt1Ty, kField))) 793 794_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutByte, 795 art_portable_sput_byte, 796 kAttrNone, 797 kVoidTy, 798 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kInt8Ty, kField))) 799 800_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutChar, 801 art_portable_sput_char, 802 kAttrNone, 803 kVoidTy, 804 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kInt16Ty, kField))) 805 806_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutShort, 807 art_portable_sput_short, 808 kAttrNone, 809 kVoidTy, 810 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, _JTYPE(kInt16Ty, kField))) 811 812// void art_portable_sput_[type].fast(JavaObject* ssb, 813// int field_offset, 814// bool is_volatile, 815// [type] new_value) 816_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutFast, 817 art_portable_sput.fast, 818 kAttrNoThrow, 819 kVoidTy, 820 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kInt32Ty, kField))) 821 822_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutWideFast, 823 art_portable_sput_wide.fast, 824 kAttrNoThrow, 825 kVoidTy, 826 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kInt64Ty, kField))) 827 828_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutObjectFast, 829 art_portable_sput_object.fast, 830 kAttrNoThrow, 831 kVoidTy, 832 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kJavaObjectTy, kField))) 833 834_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutBooleanFast, 835 art_portable_sput_boolean.fast, 836 kAttrNoThrow, 837 kVoidTy, 838 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kInt1Ty, kField))) 839 840_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutByteFast, 841 art_portable_sput_byte.fast, 842 kAttrNoThrow, 843 kVoidTy, 844 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kInt8Ty, kField))) 845 846_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutCharFast, 847 art_portable_sput_char.fast, 848 kAttrNoThrow, 849 kVoidTy, 850 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kInt16Ty, kField))) 851 852_EVAL_DEF_INTRINSICS_FUNC(StaticFieldPutShortFast, 853 art_portable_sput_short.fast, 854 kAttrNoThrow, 855 kVoidTy, 856 _EXPAND_ARG4(kJavaObjectTy, kInt32ConstantTy, kInt1ConstantTy, _JTYPE(kInt16Ty, kField))) 857 858// JavaObject* art_portable_load_declaring_class_ssb(Method* method) 859// Load the static storage base of the class that given method resides 860_EVAL_DEF_INTRINSICS_FUNC(LoadDeclaringClassSSB, 861 art_portable_load_declaring_class_ssb, 862 kAttrReadOnly | kAttrNoThrow, 863 kJavaObjectTy, 864 _EXPAND_ARG1(kJavaMethodTy)) 865 866// JavaObject* art_portable_init_and_load_class_ssb(uint32_t type_idx, 867// Method* referrer, 868// Thread* thread) 869_EVAL_DEF_INTRINSICS_FUNC(InitializeAndLoadClassSSB, 870 art_portable_init_and_load_class_ssb, 871 kAttrNone, 872 kJavaObjectTy, 873 _EXPAND_ARG3(kInt32ConstantTy, kJavaMethodTy, kJavaThreadTy)) 874 875//---------------------------------------------------------------------------- 876// High-level Array get/put 877// 878// Similar to art_portable_aget/aput_xxx, but checks not yet performed. 879// OptFlags contain info describing whether frontend has determined that 880// null check and/or array bounds check may be skipped. 881// 882// [type] void art_portable_hl_aget_[type](int optFlags, JavaObject* array, uint32_t index) 883_EVAL_DEF_INTRINSICS_FUNC(HLArrayGet, 884 art_portable_hl_aget, 885 kAttrReadOnly | kAttrNoThrow, 886 kInt32Ty, 887 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 888 889_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetFloat, 890 art_portable_hl_aget_float, 891 kAttrReadOnly | kAttrNoThrow, 892 kFloatTy, 893 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 894 895_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetWide, 896 art_portable_hl_aget_wide, 897 kAttrReadOnly | kAttrNoThrow, 898 kInt64Ty, 899 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 900 901_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetDouble, 902 art_portable_hl_aget_double, 903 kAttrReadOnly | kAttrNoThrow, 904 kDoubleTy, 905 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 906 907_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetObject, 908 art_portable_hl_aget_object, 909 kAttrReadOnly | kAttrNoThrow, 910 kJavaObjectTy, 911 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 912 913_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetBoolean, 914 art_portable_hl_aget_boolean, 915 kAttrReadOnly | kAttrNoThrow, 916 kInt32Ty, 917 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 918 919_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetByte, 920 art_portable_hl_aget_byte, 921 kAttrReadOnly | kAttrNoThrow, 922 kInt32Ty, 923 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 924 925_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetChar, 926 art_portable_hl_aget_char, 927 kAttrReadOnly | kAttrNoThrow, 928 kInt32Ty, 929 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 930 931_EVAL_DEF_INTRINSICS_FUNC(HLArrayGetShort, 932 art_portable_hl_aget_short, 933 kAttrReadOnly | kAttrNoThrow, 934 kInt32Ty, 935 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 936 937// void art_portable_aput_[type](int optFlags, [type] value, JavaObject* array, uint32_t index) 938_EVAL_DEF_INTRINSICS_FUNC(HLArrayPut, 939 art_portable_hl_aput, 940 kAttrNoThrow, 941 kVoidTy, 942 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 943 944_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutFloat, 945 art_portable_hl_aput_float, 946 kAttrNoThrow, 947 kVoidTy, 948 _EXPAND_ARG4(kInt32Ty, kFloatTy, kJavaObjectTy, kInt32Ty)) 949 950_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutWide, 951 art_portable_hl_aput_wide, 952 kAttrNoThrow, 953 kVoidTy, 954 _EXPAND_ARG4(kInt32Ty, kInt64Ty, kJavaObjectTy, kInt32Ty)) 955 956_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutDouble, 957 art_portable_hl_aput_double, 958 kAttrNoThrow, 959 kVoidTy, 960 _EXPAND_ARG4(kInt32Ty, kDoubleTy, kJavaObjectTy, kInt32Ty)) 961 962_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutObject, 963 art_portable_hl_aput_object, 964 kAttrNoThrow, 965 kVoidTy, 966 _EXPAND_ARG4(kInt32Ty, kJavaObjectTy, kJavaObjectTy, kInt32Ty)) 967 968_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutBoolean, 969 art_portable_hl_aput_boolean, 970 kAttrNoThrow, 971 kVoidTy, 972 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 973 974_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutByte, 975 art_portable_hl_aput_byte, 976 kAttrNoThrow, 977 kVoidTy, 978 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 979 980_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutChar, 981 art_portable_hl_aput_char, 982 kAttrNoThrow, 983 kVoidTy, 984 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 985 986_EVAL_DEF_INTRINSICS_FUNC(HLArrayPutShort, 987 art_portable_hl_aput_short, 988 kAttrNoThrow, 989 kVoidTy, 990 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 991 992//---------------------------------------------------------------------------- 993// High-level Instance get/put 994// 995// Similar to art_portable_iget/iput_xxx, but checks not yet performed. 996// OptFlags contain info describing whether frontend has determined that 997// null check may be skipped. 998// 999// [type] void art_portable_hl_iget_[type](int optFlags, JavaObject* obj, uint32_t field_idx) 1000_EVAL_DEF_INTRINSICS_FUNC(HLIGet, 1001 art_portable_hl_iget, 1002 kAttrReadOnly | kAttrNoThrow, 1003 kInt32Ty, 1004 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1005 1006_EVAL_DEF_INTRINSICS_FUNC(HLIGetFloat, 1007 art_portable_hl_iget_float, 1008 kAttrReadOnly | kAttrNoThrow, 1009 kFloatTy, 1010 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1011 1012_EVAL_DEF_INTRINSICS_FUNC(HLIGetWide, 1013 art_portable_hl_iget_wide, 1014 kAttrReadOnly | kAttrNoThrow, 1015 kInt64Ty, 1016 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1017 1018_EVAL_DEF_INTRINSICS_FUNC(HLIGetDouble, 1019 art_portable_hl_iget_double, 1020 kAttrReadOnly | kAttrNoThrow, 1021 kDoubleTy, 1022 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1023 1024_EVAL_DEF_INTRINSICS_FUNC(HLIGetObject, 1025 art_portable_hl_iget_object, 1026 kAttrReadOnly | kAttrNoThrow, 1027 kJavaObjectTy, 1028 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1029 1030_EVAL_DEF_INTRINSICS_FUNC(HLIGetBoolean, 1031 art_portable_hl_iget_boolean, 1032 kAttrReadOnly | kAttrNoThrow, 1033 kInt32Ty, 1034 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1035 1036_EVAL_DEF_INTRINSICS_FUNC(HLIGetByte, 1037 art_portable_hl_iget_byte, 1038 kAttrReadOnly | kAttrNoThrow, 1039 kInt32Ty, 1040 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1041 1042_EVAL_DEF_INTRINSICS_FUNC(HLIGetChar, 1043 art_portable_hl_iget_char, 1044 kAttrReadOnly | kAttrNoThrow, 1045 kInt32Ty, 1046 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1047 1048_EVAL_DEF_INTRINSICS_FUNC(HLIGetShort, 1049 art_portable_hl_iget_short, 1050 kAttrReadOnly | kAttrNoThrow, 1051 kInt32Ty, 1052 _EXPAND_ARG3(kInt32Ty, kJavaObjectTy, kInt32Ty)) 1053 1054// void art_portable_iput_[type](int optFlags, [type] value, JavaObject* obj, uint32_t field_idx) 1055_EVAL_DEF_INTRINSICS_FUNC(HLIPut, 1056 art_portable_hl_iput, 1057 kAttrNoThrow, 1058 kVoidTy, 1059 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 1060 1061_EVAL_DEF_INTRINSICS_FUNC(HLIPutFloat, 1062 art_portable_hl_iput_float, 1063 kAttrNoThrow, 1064 kVoidTy, 1065 _EXPAND_ARG4(kInt32Ty, kFloatTy, kJavaObjectTy, kInt32Ty)) 1066 1067_EVAL_DEF_INTRINSICS_FUNC(HLIPutWide, 1068 art_portable_hl_iput_wide, 1069 kAttrNoThrow, 1070 kVoidTy, 1071 _EXPAND_ARG4(kInt32Ty, kInt64Ty, kJavaObjectTy, kInt32Ty)) 1072 1073_EVAL_DEF_INTRINSICS_FUNC(HLIPutDouble, 1074 art_portable_hl_iput_double, 1075 kAttrNoThrow, 1076 kVoidTy, 1077 _EXPAND_ARG4(kInt32Ty, kDoubleTy, kJavaObjectTy, kInt32Ty)) 1078 1079_EVAL_DEF_INTRINSICS_FUNC(HLIPutObject, 1080 art_portable_hl_iput_object, 1081 kAttrNoThrow, 1082 kVoidTy, 1083 _EXPAND_ARG4(kInt32Ty, kJavaObjectTy, kJavaObjectTy, kInt32Ty)) 1084 1085_EVAL_DEF_INTRINSICS_FUNC(HLIPutBoolean, 1086 art_portable_hl_iput_boolean, 1087 kAttrNoThrow, 1088 kVoidTy, 1089 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 1090 1091_EVAL_DEF_INTRINSICS_FUNC(HLIPutByte, 1092 art_portable_hl_iput_byte, 1093 kAttrNoThrow, 1094 kVoidTy, 1095 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 1096 1097_EVAL_DEF_INTRINSICS_FUNC(HLIPutChar, 1098 art_portable_hl_iput_char, 1099 kAttrNoThrow, 1100 kVoidTy, 1101 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 1102 1103_EVAL_DEF_INTRINSICS_FUNC(HLIPutShort, 1104 art_portable_hl_iput_short, 1105 kAttrNoThrow, 1106 kVoidTy, 1107 _EXPAND_ARG4(kInt32Ty, kInt32Ty, kJavaObjectTy, kInt32Ty)) 1108 1109//---------------------------------------------------------------------------- 1110// High-level Invokes (fast-path determination not yet performed) 1111// 1112// NOTE: We expect these intrinsics to be temporary. Once calling conventions are 1113// fully merged, the unified front end will lower down to the 1114// InvokeRetxxx() intrinsics in the next section and these will be 1115// removed. 1116// 1117// arg0: InvokeType [ignored if FilledNewArray] 1118// arg1: method_idx [ignored if FilledNewArray] 1119// arg2: optimization_flags (primary to note whether null checking is needed) 1120// [arg3..argN]: actual arguments 1121//---------------------------------------------------------------------------- 1122// INVOKE method returns void 1123_EVAL_DEF_INTRINSICS_FUNC(HLInvokeVoid, 1124 art_portable_hl_invoke.void, 1125 kAttrNone, 1126 kVoidTy, 1127 _EXPAND_ARG1(kVarArgTy)) 1128 1129// INVOKE method returns object 1130_EVAL_DEF_INTRINSICS_FUNC(HLInvokeObj, 1131 art_portable_hl_invoke.obj, 1132 kAttrNone, 1133 kJavaObjectTy, 1134 _EXPAND_ARG1(kVarArgTy)) 1135 1136// INVOKE method returns int 1137_EVAL_DEF_INTRINSICS_FUNC(HLInvokeInt, 1138 art_portable_hl_invoke.i32, 1139 kAttrNone, 1140 kInt32Ty, 1141 _EXPAND_ARG1(kVarArgTy)) 1142 1143// INVOKE method returns float 1144_EVAL_DEF_INTRINSICS_FUNC(HLInvokeFloat, 1145 art_portable_hl_invoke.f32, 1146 kAttrNone, 1147 kFloatTy, 1148 _EXPAND_ARG1(kVarArgTy)) 1149 1150// INVOKE method returns long 1151_EVAL_DEF_INTRINSICS_FUNC(HLInvokeLong, 1152 art_portable_hl_invoke.i64, 1153 kAttrNone, 1154 kInt64Ty, 1155 _EXPAND_ARG1(kVarArgTy)) 1156 1157// INVOKE method returns double 1158_EVAL_DEF_INTRINSICS_FUNC(HLInvokeDouble, 1159 art_portable_hl_invoke.f64, 1160 kAttrNone, 1161 kDoubleTy, 1162 _EXPAND_ARG1(kVarArgTy)) 1163 1164// FILLED_NEW_ARRAY returns object 1165_EVAL_DEF_INTRINSICS_FUNC(HLFilledNewArray, 1166 art_portable_hl_filled_new_array, 1167 kAttrNone, 1168 kJavaObjectTy, 1169 _EXPAND_ARG1(kVarArgTy)) 1170 1171//---------------------------------------------------------------------------- 1172// Invoke 1173//---------------------------------------------------------------------------- 1174 1175// Method* art_portable_find_static_method_with_access_check(uint32_t method_idx, 1176// JavaObject* this, 1177// Method* referrer, 1178// Thread* thread) 1179_EVAL_DEF_INTRINSICS_FUNC(FindStaticMethodWithAccessCheck, 1180 art_portable_find_static_method_with_access_check, 1181 kAttrNone, 1182 kJavaMethodTy, 1183 _EXPAND_ARG4(kInt32ConstantTy, kJavaObjectTy, kJavaMethodTy, kJavaThreadTy)) 1184 1185// Method* art_portable_find_direct_method_with_access_check(uint32_t method_idx, 1186// JavaObject* this, 1187// Method* referrer, 1188// Thread* thread) 1189_EVAL_DEF_INTRINSICS_FUNC(FindDirectMethodWithAccessCheck, 1190 art_portable_find_direct_method_with_access_check, 1191 kAttrNone, 1192 kJavaMethodTy, 1193 _EXPAND_ARG4(kInt32ConstantTy, kJavaObjectTy, kJavaMethodTy, kJavaThreadTy)) 1194 1195// Method* art_portable_find_virtual_method_with_access_check(uint32_t method_idx, 1196// JavaObject* this, 1197// Method* referrer, 1198// Thread* thread) 1199_EVAL_DEF_INTRINSICS_FUNC(FindVirtualMethodWithAccessCheck, 1200 art_portable_find_virtual_method_with_access_check, 1201 kAttrNone, 1202 kJavaMethodTy, 1203 _EXPAND_ARG4(kInt32ConstantTy, kJavaObjectTy, kJavaMethodTy, kJavaThreadTy)) 1204 1205// Method* art_portable_find_super_method_with_access_check(uint32_t method_idx, 1206// JavaObject* this, 1207// Method* referrer, 1208// Thread* thread) 1209_EVAL_DEF_INTRINSICS_FUNC(FindSuperMethodWithAccessCheck, 1210 art_portable_find_super_method_with_access_check, 1211 kAttrNone, 1212 kJavaMethodTy, 1213 _EXPAND_ARG4(kInt32ConstantTy, kJavaObjectTy, kJavaMethodTy, kJavaThreadTy)) 1214 1215// Method* art_portable_find_interface_method_with_access_check(uint32_t method_idx, 1216// JavaObject* this, 1217// Method* referrer, 1218// Thread* thread) 1219_EVAL_DEF_INTRINSICS_FUNC(FindInterfaceMethodWithAccessCheck, 1220 art_portable_find_interface_method_with_access_check, 1221 kAttrNone, 1222 kJavaMethodTy, 1223 _EXPAND_ARG4(kInt32ConstantTy, kJavaObjectTy, kJavaMethodTy, kJavaThreadTy)) 1224 1225// Method* art_portable_get_sd_callee_method_obj_addr(uint32_t method_idx) 1226_EVAL_DEF_INTRINSICS_FUNC(GetSDCalleeMethodObjAddrFast, 1227 art_portable_get_sd_callee_method_obj_addr_fast, 1228 kAttrReadOnly | kAttrNoThrow, 1229 kJavaMethodTy, 1230 _EXPAND_ARG1(kInt32ConstantTy)) 1231 1232// Method* art_portable_get_virtual_callee_method_obj_addr(uint32_t vtable_idx, 1233// JavaObject* this) 1234_EVAL_DEF_INTRINSICS_FUNC(GetVirtualCalleeMethodObjAddrFast, 1235 art_portable_get_virtual_callee_method_obj_addr_fast, 1236 kAttrReadOnly | kAttrNoThrow, 1237 kJavaMethodTy, 1238 _EXPAND_ARG2(kInt32ConstantTy, kJavaObjectTy)) 1239 1240// Method* art_portable_get_interface_callee_method_obj_addr(uint32_t method_idx, 1241// JavaObject* this, 1242// Method* referrer, 1243// Thread* thread) 1244_EVAL_DEF_INTRINSICS_FUNC(GetInterfaceCalleeMethodObjAddrFast, 1245 art_portable_get_interface_callee_method_obj_addr_fast, 1246 kAttrNone, 1247 kJavaMethodTy, 1248 _EXPAND_ARG4(kInt32ConstantTy, kJavaObjectTy, kJavaMethodTy, kJavaThreadTy)) 1249 1250// [type] art_portable_invoke.[type](Method* callee, ...) 1251// INVOKE method returns void 1252_EVAL_DEF_INTRINSICS_FUNC(InvokeRetVoid, 1253 art_portable_invoke.void, 1254 kAttrNone, 1255 kVoidTy, 1256 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1257 1258// INVOKE method returns the value of type boolean 1259_EVAL_DEF_INTRINSICS_FUNC(InvokeRetBoolean, 1260 art_portable_invoke.bool, 1261 kAttrNone, 1262 kInt1Ty, 1263 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1264 1265// INVOKE method returns the value of type byte 1266_EVAL_DEF_INTRINSICS_FUNC(InvokeRetByte, 1267 art_portable_invoke.byte, 1268 kAttrNone, 1269 kInt8Ty, 1270 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1271 1272// INVOKE method returns the value of type char 1273_EVAL_DEF_INTRINSICS_FUNC(InvokeRetChar, 1274 art_portable_invoke.char, 1275 kAttrNone, 1276 kInt16Ty, 1277 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1278 1279// INVOKE method returns the value of type short 1280_EVAL_DEF_INTRINSICS_FUNC(InvokeRetShort, 1281 art_portable_invoke.short, 1282 kAttrNone, 1283 kInt16Ty, 1284 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1285 1286// INVOKE method returns the value of type int 1287_EVAL_DEF_INTRINSICS_FUNC(InvokeRetInt, 1288 art_portable_invoke.int, 1289 kAttrNone, 1290 kInt32Ty, 1291 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1292 1293// INVOKE method returns the value of type long 1294_EVAL_DEF_INTRINSICS_FUNC(InvokeRetLong, 1295 art_portable_invoke.long, 1296 kAttrNone, 1297 kInt64Ty, 1298 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1299 1300// INVOKE method returns the value of type float 1301_EVAL_DEF_INTRINSICS_FUNC(InvokeRetFloat, 1302 art_portable_invoke.float, 1303 kAttrNone, 1304 kFloatTy, 1305 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1306 1307// INVOKE method returns the value of type double 1308_EVAL_DEF_INTRINSICS_FUNC(InvokeRetDouble, 1309 art_portable_invoke.double, 1310 kAttrNone, 1311 kDoubleTy, 1312 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1313 1314// INVOKE method returns the value of type "object" 1315_EVAL_DEF_INTRINSICS_FUNC(InvokeRetObject, 1316 art_portable_invoke.object, 1317 kAttrNone, 1318 kJavaObjectTy, 1319 _EXPAND_ARG2(kJavaMethodTy, kVarArgTy)) 1320 1321//---------------------------------------------------------------------------- 1322// Math 1323//---------------------------------------------------------------------------- 1324 1325// int art_portable_{div,rem}_int(int a, int b) 1326_EVAL_DEF_INTRINSICS_FUNC(DivInt, 1327 art_portable_div_int, 1328 kAttrReadNone | kAttrNoThrow, 1329 kInt32Ty, 1330 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1331 1332_EVAL_DEF_INTRINSICS_FUNC(RemInt, 1333 art_portable_rem_int, 1334 kAttrReadNone | kAttrNoThrow, 1335 kInt32Ty, 1336 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1337 1338// long art_portable_{div,rem}_long(long a, long b) 1339_EVAL_DEF_INTRINSICS_FUNC(DivLong, 1340 art_portable_div_long, 1341 kAttrReadNone | kAttrNoThrow, 1342 kInt64Ty, 1343 _EXPAND_ARG2(kInt64Ty, kInt64Ty)) 1344 1345_EVAL_DEF_INTRINSICS_FUNC(RemLong, 1346 art_portable_rem_long, 1347 kAttrReadNone | kAttrNoThrow, 1348 kInt64Ty, 1349 _EXPAND_ARG2(kInt64Ty, kInt64Ty)) 1350 1351// int64_t art_portable_d2l(double f) 1352_EVAL_DEF_INTRINSICS_FUNC(D2L, 1353 art_portable_d2l, 1354 kAttrReadNone | kAttrNoThrow, 1355 kInt64Ty, 1356 _EXPAND_ARG1(kDoubleTy)) 1357 1358// int32_t art_portable_d2l(double f) 1359_EVAL_DEF_INTRINSICS_FUNC(D2I, 1360 art_portable_d2i, 1361 kAttrReadNone | kAttrNoThrow, 1362 kInt32Ty, 1363 _EXPAND_ARG1(kDoubleTy)) 1364 1365// int64_t art_portable_f2l(float f) 1366_EVAL_DEF_INTRINSICS_FUNC(F2L, 1367 art_portable_f2l, 1368 kAttrReadNone | kAttrNoThrow, 1369 kInt64Ty, 1370 _EXPAND_ARG1(kFloatTy)) 1371 1372// int32_t art_portable_f2i(float f) 1373_EVAL_DEF_INTRINSICS_FUNC(F2I, 1374 art_portable_f2i, 1375 kAttrReadNone | kAttrNoThrow, 1376 kInt32Ty, 1377 _EXPAND_ARG1(kFloatTy)) 1378 1379//---------------------------------------------------------------------------- 1380// sput intrinsics to assist MIR to Greenland_ir conversion. 1381// "HL" versions - will be deprecated when fast/slow path handling done 1382// in the common frontend. 1383//---------------------------------------------------------------------------- 1384 1385// void sput_hl(int field_idx, int val) 1386_EVAL_DEF_INTRINSICS_FUNC(HLSput, 1387 art_portable_hl_sput, 1388 kAttrReadOnly | kAttrNoThrow, 1389 kVoidTy, 1390 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1391 1392// void sput_hl_object(int field_idx, object* val) 1393_EVAL_DEF_INTRINSICS_FUNC(HLSputObject, 1394 art_portable_hl_sput_object, 1395 kAttrReadOnly | kAttrNoThrow, 1396 kVoidTy, 1397 _EXPAND_ARG2(kInt32Ty, kJavaObjectTy)) 1398 1399// void sput_hl_boolean(int field_idx, kInt1Ty) 1400_EVAL_DEF_INTRINSICS_FUNC(HLSputBoolean, 1401 art_portable_hl_sput_boolean, 1402 kAttrReadOnly | kAttrNoThrow, 1403 kVoidTy, 1404 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1405 1406// void sput_hl_byte(int field_idx, int val) 1407_EVAL_DEF_INTRINSICS_FUNC(HLSputByte, 1408 art_portable_hl_sput_byte, 1409 kAttrReadOnly | kAttrNoThrow, 1410 kVoidTy, 1411 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1412 1413// void sput_hl_char(int field_idx, kInt16Ty val) 1414_EVAL_DEF_INTRINSICS_FUNC(HLSputChar, 1415 art_portable_hl_sput_char, 1416 kAttrReadOnly | kAttrNoThrow, 1417 kVoidTy, 1418 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1419 1420// void sput_hl_short(int field_idx, int val) 1421_EVAL_DEF_INTRINSICS_FUNC(HLSputShort, 1422 art_portable_hl_sput_short, 1423 kAttrReadOnly | kAttrNoThrow, 1424 kVoidTy, 1425 _EXPAND_ARG2(kInt32Ty, kInt32Ty)) 1426 1427// void sput_hl_wide(int field_idx, long val) 1428_EVAL_DEF_INTRINSICS_FUNC(HLSputWide, 1429 art_portable_hl_sput_wide, 1430 kAttrReadOnly | kAttrNoThrow, 1431 kVoidTy, 1432 _EXPAND_ARG2(kInt32Ty, kInt64Ty)) 1433 1434// void sput_hl_double(int field_idx, double val) 1435_EVAL_DEF_INTRINSICS_FUNC(HLSputDouble, 1436 art_portable_hl_sput_double, 1437 kAttrReadOnly | kAttrNoThrow, 1438 kVoidTy, 1439 _EXPAND_ARG2(kInt32Ty, kDoubleTy)) 1440 1441// void sput_hl_float(int field_idx, float val) 1442_EVAL_DEF_INTRINSICS_FUNC(HLSputFloat, 1443 art_portable_hl_sput_float, 1444 kAttrReadOnly | kAttrNoThrow, 1445 kVoidTy, 1446 _EXPAND_ARG2(kInt32Ty, kFloatTy)) 1447 1448//---------------------------------------------------------------------------- 1449// sget intrinsics to assist MIR to Greenland_ir conversion. 1450// "HL" versions - will be deprecated when fast/slow path handling done 1451// in the common frontend. 1452//---------------------------------------------------------------------------- 1453 1454// int sget_hl(int field_idx) 1455_EVAL_DEF_INTRINSICS_FUNC(HLSget, 1456 art_portable_hl_sget, 1457 kAttrReadOnly | kAttrNoThrow, 1458 kInt32Ty, 1459 _EXPAND_ARG1(kInt32Ty)) 1460 1461// object* sget_hl_object(int field_idx) 1462_EVAL_DEF_INTRINSICS_FUNC(HLSgetObject, 1463 art_portable_hl_sget_object, 1464 kAttrReadOnly | kAttrNoThrow, 1465 kJavaObjectTy, 1466 _EXPAND_ARG1(kInt32Ty)) 1467 1468// boolean sget_hl_boolean(int field_idx) 1469_EVAL_DEF_INTRINSICS_FUNC(HLSgetBoolean, 1470 art_portable_hl_sget_boolean, 1471 kAttrReadOnly | kAttrNoThrow, 1472 kInt32Ty, 1473 _EXPAND_ARG1(kInt32Ty)) 1474 1475// byte sget_hl_byte(int field_idx) 1476_EVAL_DEF_INTRINSICS_FUNC(HLSgetByte, 1477 art_portable_hl_sget_byte, 1478 kAttrReadOnly | kAttrNoThrow, 1479 kInt32Ty, 1480 _EXPAND_ARG1(kInt32Ty)) 1481 1482// char sget_hl_char(int field_idx) 1483_EVAL_DEF_INTRINSICS_FUNC(HLSgetChar, 1484 art_portable_hl_sget_char, 1485 kAttrReadOnly | kAttrNoThrow, 1486 kInt32Ty, 1487 _EXPAND_ARG1(kInt32Ty)) 1488 1489// char sget_hl_short(int field_idx) 1490_EVAL_DEF_INTRINSICS_FUNC(HLSgetShort, 1491 art_portable_hl_sget_short, 1492 kAttrReadOnly | kAttrNoThrow, 1493 kInt32Ty, 1494 _EXPAND_ARG1(kInt32Ty)) 1495 1496// char sget_hl_wide(int field_idx) 1497_EVAL_DEF_INTRINSICS_FUNC(HLSgetWide, 1498 art_portable_hl_sget_wide, 1499 kAttrReadOnly | kAttrNoThrow, 1500 kInt64Ty, 1501 _EXPAND_ARG1(kInt32Ty)) 1502 1503// char sget_hl_double(int field_idx) 1504_EVAL_DEF_INTRINSICS_FUNC(HLSgetDouble, 1505 art_portable_hl_sget_double, 1506 kAttrReadOnly | kAttrNoThrow, 1507 kDoubleTy, 1508 _EXPAND_ARG1(kInt32Ty)) 1509 1510// char sget_hl_float(int field_idx) 1511_EVAL_DEF_INTRINSICS_FUNC(HLSgetFloat, 1512 art_portable_hl_sget_float, 1513 kAttrReadOnly | kAttrNoThrow, 1514 kFloatTy, 1515 _EXPAND_ARG1(kInt32Ty)) 1516//---------------------------------------------------------------------------- 1517// Monitor enter/exit 1518//---------------------------------------------------------------------------- 1519// uint32_t art_portable_monitor_enter(int optFlags, JavaObject* obj) 1520_EVAL_DEF_INTRINSICS_FUNC(MonitorEnter, 1521 art_portable_monitor_enter, 1522 kAttrReadOnly | kAttrNoThrow, 1523 kVoidTy, 1524 _EXPAND_ARG2(kInt32Ty, kJavaObjectTy)) 1525 1526// uint32_t art_portable_monitor_exit(int optFlags, JavaObject* obj) 1527_EVAL_DEF_INTRINSICS_FUNC(MonitorExit, 1528 art_portable_monitor_exit, 1529 kAttrReadOnly | kAttrNoThrow, 1530 kVoidTy, 1531 _EXPAND_ARG2(kInt32Ty, kJavaObjectTy)) 1532 1533//---------------------------------------------------------------------------- 1534// Shadow Frame 1535//---------------------------------------------------------------------------- 1536 1537// void art_portable_alloca_shadow_frame(int num_entry) 1538_EVAL_DEF_INTRINSICS_FUNC(AllocaShadowFrame, 1539 art_portable_alloca_shadow_frame, 1540 kAttrNoThrow, 1541 kVoidTy, 1542 _EXPAND_ARG1(kInt32ConstantTy)) 1543 1544// void art_portable_set_vreg(int entry_idx, ...) 1545_EVAL_DEF_INTRINSICS_FUNC(SetVReg, 1546 art_portable_set_vreg, 1547 kAttrNoThrow, 1548 kVoidTy, 1549 _EXPAND_ARG2(kInt32ConstantTy, kVarArgTy)) 1550 1551// void art_portable_pop_shadow_frame() 1552_EVAL_DEF_INTRINSICS_FUNC(PopShadowFrame, 1553 art_portable_pop_shadow_frame, 1554 kAttrNoThrow, 1555 kVoidTy, 1556 _EXPAND_ARG0()) 1557 1558// void art_portable_update_dex_pc(uint32_t dex_pc) 1559_EVAL_DEF_INTRINSICS_FUNC(UpdateDexPC, 1560 art_portable_update_dex_pc, 1561 kAttrNoThrow, 1562 kVoidTy, 1563 _EXPAND_ARG1(kInt32ConstantTy)) 1564 1565//---------------------------------------------------------------------------- 1566// FP Comparison 1567//---------------------------------------------------------------------------- 1568// int cmpl_float(float, float) 1569_EVAL_DEF_INTRINSICS_FUNC(CmplFloat, 1570 art_portable_cmpl_float, 1571 kAttrReadOnly | kAttrNoThrow, 1572 kInt32Ty, 1573 _EXPAND_ARG2(kFloatTy, kFloatTy)) 1574 1575// int cmpg_float(float, float) 1576_EVAL_DEF_INTRINSICS_FUNC(CmpgFloat, 1577 art_portable_cmpg_float, 1578 kAttrReadOnly | kAttrNoThrow, 1579 kInt32Ty, 1580 _EXPAND_ARG2(kFloatTy, kFloatTy)) 1581 1582// int cmpl_double(double, double) 1583_EVAL_DEF_INTRINSICS_FUNC(CmplDouble, 1584 art_portable_cmpl_double, 1585 kAttrReadOnly | kAttrNoThrow, 1586 kInt32Ty, 1587 _EXPAND_ARG2(kDoubleTy, kDoubleTy)) 1588 1589// int cmpg_double(double, double) 1590_EVAL_DEF_INTRINSICS_FUNC(CmpgDouble, 1591 art_portable_cmpg_double, 1592 kAttrReadOnly | kAttrNoThrow, 1593 kInt32Ty, 1594 _EXPAND_ARG2(kDoubleTy, kDoubleTy)) 1595 1596//---------------------------------------------------------------------------- 1597// Long Comparison 1598//---------------------------------------------------------------------------- 1599// int cmp_long(long, long) 1600_EVAL_DEF_INTRINSICS_FUNC(CmpLong, 1601 art_portable_cmp_long, 1602 kAttrReadOnly | kAttrNoThrow, 1603 kInt32Ty, 1604 _EXPAND_ARG2(kInt64Ty, kInt64Ty)) 1605 1606//---------------------------------------------------------------------------- 1607// Const intrinsics to assist MIR to Greenland_ir conversion. Should not materialize 1608// For simplicity, all use integer input 1609//---------------------------------------------------------------------------- 1610// int const_int(int) 1611_EVAL_DEF_INTRINSICS_FUNC(ConstInt, 1612 art_portable_const_int, 1613 kAttrReadOnly | kAttrNoThrow, 1614 kInt32Ty, 1615 _EXPAND_ARG1(kInt32Ty)) 1616 1617// JavaObject* const_obj(int) 1618_EVAL_DEF_INTRINSICS_FUNC(ConstObj, 1619 art_portable_const_obj, 1620 kAttrReadOnly | kAttrNoThrow, 1621 kJavaObjectTy, 1622 _EXPAND_ARG1(kInt32Ty)) 1623 1624// long const_long(long) 1625_EVAL_DEF_INTRINSICS_FUNC(ConstLong, 1626 art_portable_const_long, 1627 kAttrReadOnly | kAttrNoThrow, 1628 kInt64Ty, 1629 _EXPAND_ARG1(kInt64Ty)) 1630 1631// float const_float(int) 1632_EVAL_DEF_INTRINSICS_FUNC(ConstFloat, 1633 art_portable_const_Float, 1634 kAttrReadOnly | kAttrNoThrow, 1635 kFloatTy, 1636 _EXPAND_ARG1(kInt32Ty)) 1637 1638// double const_double(long) 1639_EVAL_DEF_INTRINSICS_FUNC(ConstDouble, 1640 art_portable_const_Double, 1641 kAttrReadOnly | kAttrNoThrow, 1642 kDoubleTy, 1643 _EXPAND_ARG1(kInt64Ty)) 1644 1645 1646//---------------------------------------------------------------------------- 1647// Copy intrinsics to assist MIR to Greenland_ir conversion. Should not materialize 1648//---------------------------------------------------------------------------- 1649 1650// void method_info(void) 1651_EVAL_DEF_INTRINSICS_FUNC(MethodInfo, 1652 art_portable_method_info, 1653 kAttrReadOnly | kAttrNoThrow, 1654 kVoidTy, 1655 _EXPAND_ARG0()) 1656 1657// int copy_int(int) 1658_EVAL_DEF_INTRINSICS_FUNC(CopyInt, 1659 art_portable_copy_int, 1660 kAttrReadOnly | kAttrNoThrow, 1661 kInt32Ty, 1662 _EXPAND_ARG1(kInt32Ty)) 1663 1664// JavaObject* copy_obj(obj) 1665_EVAL_DEF_INTRINSICS_FUNC(CopyObj, 1666 art_portable_copy_obj, 1667 kAttrReadOnly | kAttrNoThrow, 1668 kJavaObjectTy, 1669 _EXPAND_ARG1(kJavaObjectTy)) 1670 1671// long copy_long(long) 1672_EVAL_DEF_INTRINSICS_FUNC(CopyLong, 1673 art_portable_copy_long, 1674 kAttrReadOnly | kAttrNoThrow, 1675 kInt64Ty, 1676 _EXPAND_ARG1(kInt64Ty)) 1677 1678// float copy_float(float) 1679_EVAL_DEF_INTRINSICS_FUNC(CopyFloat, 1680 art_portable_copy_Float, 1681 kAttrReadOnly | kAttrNoThrow, 1682 kFloatTy, 1683 _EXPAND_ARG1(kFloatTy)) 1684 1685// double copy_double(double) 1686_EVAL_DEF_INTRINSICS_FUNC(CopyDouble, 1687 art_portable_copy_Double, 1688 kAttrReadOnly | kAttrNoThrow, 1689 kDoubleTy, 1690 _EXPAND_ARG1(kDoubleTy)) 1691 1692//---------------------------------------------------------------------------- 1693// Shift intrinsics. Shift semantics for Dalvik are a bit different than 1694// the llvm shift operators. For 32-bit shifts, the shift count is constrained 1695// to the range of 0..31, while for 64-bit shifts we limit to 0..63. 1696// Further, the shift count for Long shifts in Dalvik is 32 bits, while 1697// llvm requires a 64-bit shift count. For GBC, we represent shifts as an 1698// intrinsic to allow most efficient target-dependent lowering. 1699//---------------------------------------------------------------------------- 1700// long shl_long(long,int) 1701_EVAL_DEF_INTRINSICS_FUNC(SHLLong, 1702 art_portable_shl_long, 1703 kAttrReadOnly | kAttrNoThrow, 1704 kInt64Ty, 1705 _EXPAND_ARG2(kInt64Ty,kInt32Ty)) 1706// long shr_long(long,int) 1707_EVAL_DEF_INTRINSICS_FUNC(SHRLong, 1708 art_portable_shr_long, 1709 kAttrReadOnly | kAttrNoThrow, 1710 kInt64Ty, 1711 _EXPAND_ARG2(kInt64Ty,kInt32Ty)) 1712// long ushr_long(long,int) 1713_EVAL_DEF_INTRINSICS_FUNC(USHRLong, 1714 art_portable_ushl_long, 1715 kAttrReadOnly | kAttrNoThrow, 1716 kInt64Ty, 1717 _EXPAND_ARG2(kInt64Ty,kInt32Ty)) 1718// int shl_int(int,int) 1719_EVAL_DEF_INTRINSICS_FUNC(SHLInt, 1720 art_portable_shl_int, 1721 kAttrReadOnly | kAttrNoThrow, 1722 kInt32Ty, 1723 _EXPAND_ARG2(kInt32Ty,kInt32Ty)) 1724// long shr_int(int,int) 1725_EVAL_DEF_INTRINSICS_FUNC(SHRInt, 1726 art_portable_shr_int, 1727 kAttrReadOnly | kAttrNoThrow, 1728 kInt32Ty, 1729 _EXPAND_ARG2(kInt32Ty,kInt32Ty)) 1730// int ushr_long(int,int) 1731_EVAL_DEF_INTRINSICS_FUNC(USHRInt, 1732 art_portable_ushl_int, 1733 kAttrReadOnly | kAttrNoThrow, 1734 kInt32Ty, 1735 _EXPAND_ARG2(kInt32Ty,kInt32Ty)) 1736//---------------------------------------------------------------------------- 1737// Conversion instrinsics. Note: these should eventually be removed. We 1738// can express these directly in bitcode, but by using intrinsics the 1739// Quick compiler can be more efficient. Some extra optimization infrastructure 1740// will have to be developed to undo the bitcode verbosity when these are 1741// done inline. 1742//---------------------------------------------------------------------------- 1743// int int_to_byte(int) 1744_EVAL_DEF_INTRINSICS_FUNC(IntToByte, 1745 art_portable_int_to_byte, 1746 kAttrReadOnly | kAttrNoThrow, 1747 kInt32Ty, 1748 _EXPAND_ARG1(kInt32Ty)) 1749 1750// int int_to_char(int) 1751_EVAL_DEF_INTRINSICS_FUNC(IntToChar, 1752 art_portable_int_to_char, 1753 kAttrReadOnly | kAttrNoThrow, 1754 kInt32Ty, 1755 _EXPAND_ARG1(kInt32Ty)) 1756 1757// int int_to_short(int) 1758_EVAL_DEF_INTRINSICS_FUNC(IntToShort, 1759 art_portable_int_to_short, 1760 kAttrReadOnly | kAttrNoThrow, 1761 kInt32Ty, 1762 _EXPAND_ARG1(kInt32Ty)) 1763 1764//---------------------------------------------------------------------------- 1765// Memory barrier 1766//---------------------------------------------------------------------------- 1767// void constructor_barrier() 1768_EVAL_DEF_INTRINSICS_FUNC(ConstructorBarrier, 1769 art_portable_constructor_barrier, 1770 kAttrReadOnly | kAttrNoThrow, 1771 kVoidTy, 1772 _EXPAND_ARG0()) 1773 1774// Clean up all internal used macros 1775#undef _EXPAND_ARG0 1776#undef _EXPAND_ARG1 1777#undef _EXPAND_ARG2 1778#undef _EXPAND_ARG3 1779#undef _EXPAND_ARG4 1780#undef _EXPAND_ARG5 1781 1782#undef _JTYPE_OF_kInt1Ty_UNDER_kArray 1783#undef _JTYPE_OF_kInt8Ty_UNDER_kArray 1784#undef _JTYPE_OF_kInt16Ty_UNDER_kArray 1785#undef _JTYPE_OF_kInt32Ty_UNDER_kArray 1786#undef _JTYPE_OF_kInt64Ty_UNDER_kArray 1787#undef _JTYPE_OF_kJavaObjectTy_UNDER_kArray 1788 1789#undef _JTYPE_OF_kInt1Ty_UNDER_kField 1790#undef _JTYPE_OF_kInt8Ty_UNDER_kField 1791#undef _JTYPE_OF_kInt16Ty_UNDER_kField 1792#undef _JTYPE_OF_kInt32Ty_UNDER_kField 1793#undef _JTYPE_OF_kInt64Ty_UNDER_kField 1794#undef _JTYPE_OF_kJavaObjectTy_UNDER_kField 1795 1796#undef DEF_INTRINSICS_FUNC 1797