Attachment 'vm_class_manipulation.txt'

Download

   1 /** 
   2  * Function returns class name.
   3  *
   4  * @param klass - class handle
   5  *
   6  * @return Class name bytes.
   7  *
   8  * @note Assertion is raised if <i>klass</i> is equal to null.
   9  */
  10 const char *
  11 class_get_name(Class_Handle klass);
  12 
  13 /** 
  14  * Function returns class name.
  15  *
  16  * @param klass - class handle
  17  *
  18  * @return Class name bytes.
  19  */
  20 char *
  21 class_get_java_name(Class_Handle klass);
  22 
  23 /** 
  24  * Function returns super class of current class.
  25  *
  26  * @param klass - class handle
  27  *
  28  * @return Class handle of super class.
  29  *
  30  * @note Assertion is raised if <i>klass</i> is equal to null.
  31  */
  32 Class_Handle
  33 class_get_super_class(Class_Handle klass);
  34 
  35 /**
  36  * Function receives number of super interfaces of class.
  37  *
  38  * @param klass - class handle
  39  *
  40  * @return Number of super interfaces of class.
  41  *
  42  * @note Assertion is raised if <i>klass</i> is equal to null.
  43  * @note Replace class_number_implements function.
  44  */
  45 unsigned short
  46 class_get_superinterfaces_number(Class_Handle klass);
  47 
  48 
  49 /**
  50  * Function returns super interface of class.
  51  *
  52  * @param klass - class handle
  53  * @param index - super interface number
  54  *
  55  * @return Super interface of class.
  56  *
  57  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
  58  * @note Replace class_get_implements function.
  59  */
  60 Class_Handle
  61 
  62 class_get_superinterface(Class_Handle klass, unsigned short index);
  63 
  64 
  65 /**
  66  * Function return declaring class of current class.
  67  *
  68  * @param klass - class handle
  69  *
  70  * @return Return class handle of class that declared current one,
  71  *         or NULL if it's a top-level class.
  72  */
  73 Class_Handle
  74 class_get_declaring_class(Class_Handle klass);
  75 
  76 
  77 /**
  78 
  79  * Function returns the number of inner classes of current class.
  80 
  81  *
  82  * @param klass - class handle
  83  *
  84 
  85  * @return Returns the number of inner classes.
  86 
  87  *
  88 
  89  * @note Replases class_number_inner_classes function.
  90 
  91  */
  92 
  93 unsigned short
  94 
  95 class_get_inner_classes_number(Class_Handle klass);
  96 
  97 
  98 /**
  99 
 100  * Function returns inner class of current class.
 101 
 102  *
 103  * @param klass - class handle
 104  * @param index - inner class index
 105  *
 106 
 107  * @return Returns inner class.
 108 
 109  *
 110 
 111  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 112  */
 113 
 114 Class_Handle
 115 class_get_inner_class(Class_Handle klass, unsigned short index);
 116 
 117 
 118 /**
 119 
 120  * Function returns class loader of current class.
 121 
 122  *
 123  * @param klass - class handle
 124  *
 125 
 126  * @return Returns class loader.
 127 
 128  *
 129 
 130  * @note Assertion is raised if <i>klass</i> is equal to null.
 131  */
 132 
 133 ClassLoaderHandle
 134 
 135 class_get_class_loader(Class_Handle klass);
 136 
 137 
 138 
 139 /**
 140 
 141  * Function returns the number of class fields of current class.
 142 
 143  *
 144  * @param klass - class handle
 145  *
 146 
 147  * @return Returns the number of class fields.
 148 
 149  *
 150 
 151  * @note Assertion is raised if <i>klass</i> is equal to null.
 152  * @note Replaces class_number_fields function.
 153  */
 154 
 155 unsigned short
 156 
 157 class_get_fields_number(Class_Handle klass);
 158 
 159 
 160 /**
 161 
 162  * Function returns class field of current class.
 163 
 164  *
 165  * @param klass - class handle
 166  * @param index - class field index
 167  *
 168 
 169  * @return Returns the number of class fields.
 170 
 171  *
 172 
 173  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 174  */
 175 
 176 Field_Handle
 177 class_get_field(Class_Handle klass, unsigned short index);
 178 
 179 /**
 180  * Function returns number of methods for current class.
 181  *
 182 
 183  * @param klass - class handle
 184  *
 185 
 186  * @return Number of methods for class.
 187  *
 188 
 189  * @note Assertion is raised if klass is equal to null.
 190  * @note Replaces class_get_number_methods function.
 191  */
 192 unsigned short
 193 
 194 class_get_methods_number(Class_Handle klass);
 195 
 196 
 197 /** 
 198  * Function returns method of current class.
 199  *
 200 
 201  * @param klass - class handle
 202  * @param index - method index
 203  *
 204 
 205  * @return Method handle.
 206  *
 207 
 208  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 209  */
 210 Method_Handle
 211 class_get_method(Class_Handle klass, unsigned short index);
 212 
 213 /** 
 214  * Function returns access flags for current class.
 215  *
 216 
 217  * @param klass - class handle
 218  *
 219 
 220  * @return Class access flags.
 221  *
 222 
 223  * @note Assertion is raised if <i>klass</i> is equal to null.
 224  */
 225 unsigned short
 226 class_get_flags(Class_Handle klass);
 227 
 228 /**
 229  * Function returns source file name for current class.
 230  *
 231 
 232  * @param klass - class handle
 233  *
 234  * @return Source file name.
 235  */
 236 const char *
 237 class_get_source_file_name(Class_Handle klass);
 238 
 239 /**
 240  * Function checks if current class is primitive class.
 241  *
 242  * @param klass - class handle
 243  *
 244  * @return If class is primitive returns <code>TRUE</code>, else returns <code>FALSE</code>.
 245  *
 246  * @note Assertion is raised if <i>klass</i> is equal to null.
 247  */
 248 Boolean
 249 class_is_primitive(Class_Handle klass);
 250 
 251 /**
 252  * Function checks if current class is array.
 253  *
 254  * @param klass - class handle
 255  *
 256  * @return If class is array returns <code>TRUE</code>, else returns <code>FALSE</code>.
 257  *
 258  * @note Assertion is raised if <i>klass</i> is equal to null.
 259  */
 260 Boolean
 261 class_is_array(Class_Handle klass);
 262 
 263 /**
 264  * Function checks if current class is an instance of another class.
 265  *
 266  * @param klass - class handle
 267  * @param super_klass - super class handle
 268  *
 269  * @return If <i>klass</i> is an instance of <i>super_class</i> returns
 270  *         <code>TRUE</code>, else returns <code>FALSE</code>.
 271  *
 272  * @note Assertion is raised if <i>klass</i> or <i>super_klass</i> are equal to null.
 273  */
 274 Boolean
 275 class_is_instanceof(Class_Handle klass, Class_Handle super_klass);
 276 
 277 /**
 278  * Function checks if current class is abstract.
 279  *
 280  * @param klass - class handle
 281  *
 282  * @return If class is abstract returns <code>TRUE</code>, else returns <code>FALSE</code>.
 283  *
 284  * @note Assertion is raised if <i>klass</i> is equal to null.
 285  * @note Replaces class_property_is_abstract function.
 286 
 287  */
 288 
 289 Boolean
 290 
 291 class_is_abstract(Class_Handle klass);
 292 
 293 /**
 294  * Function checks if current class is interface class.
 295  *
 296  * @param klass - class handle
 297  *
 298  * @return If class is interface class returns <code>TRUE</code>,
 299  *         else returns <code>FALSE</code>.
 300  *
 301  * @note Assertion is raised if <i>klass</i> is equal to null.
 302  * @note Replaces class_is_interface_ and class_property_is_interface2 functions.
 303 
 304  */
 305 
 306 Boolean
 307 
 308 class_is_interface(Class_Handle klass);
 309 
 310 
 311 /**
 312  * Function checks if current class is final.
 313  *
 314  * @param klass - class handle
 315  *
 316  * @return If class is final returns <code>TRUE</code>, else returns <code>FALSE</code>.
 317  *
 318  * @note Assertion is raised if <i>klass</i> is equal to null.
 319  * @note Replaces class_is_final_ and class_property_is_final functions.
 320 
 321  */
 322 
 323 Boolean
 324 
 325 class_is_final(Class_Handle klass);
 326 
 327 
 328 /**
 329  * Function checks if given classes are the same.
 330  *
 331  * @param klass1 - first class handle
 332  * @param klass2 - second class handle
 333  *
 334  * @return If classes are the same returns <code>TRUE</code>, else returns <code>FALSE</code>.
 335  *
 336  * @note Assertion is raised if <i>klass1</i> or <i>klass2</i> are equal to null.
 337  */
 338 
 339 Boolean
 340 class_is_same_class(Class_Handle klass1, Class_Handler klass2);
 341 
 342 /**
 343  * Function checks if class extends current class with given name.
 344  *
 345  * @param klass      - checked klass
 346  * @param super_name - parent class name
 347  *
 348  * @return If given class extends current class with given name,
 349  *         function returns <code>TRUE</code>, else function returns <code>FALSE</code>.
 350  *
 351  * @note Assertion is raised if <i>klass</i> or <i>super_name</i> are equal to null.
 352  */
 353 Boolean
 354 class_is_extending_class(Class_Handle klass, const char* super_name);
 355 
 356 
 357 /**
 358  * Function checks if an inner class is public.
 359  *
 360  * @param klass - class handle
 361  * @param index - inner class index
 362  *
 363  * @return If an inner class is public, function returns <code>TRUE</code>,
 364  *         else function returns <code>FALSE</code>.
 365  *
 366  * @note Assertion is raised if <i>klass</i> is equal to null.
 367  */
 368 Boolean
 369 class_is_inner_class_public(Class_Handle klass, unsigned index);
 370 
 371 /**
 372  * Function returns a hierarchy depth for a given class.
 373  *
 374  * @param klass - class handle
 375  *
 376  * @return Return a hierarchy depth.
 377  */
 378 int
 379 class_get_depth(Class_Handle klass);
 380 
 381 /**
 382  * Returns the offset of the referent field 
 383  * in the java.lang.ref.Reference object.
 384  *
 385  * clss is assumed to represent the reference object,
 386  * i.e. class_is_reference() returned non-zero value.
 387  *
 388  * @note the returned value is most probably a constant,
 389  *       and is not dependent on the clss.
 390  *
 391  * @note this interface allows only one non-strong (i.e. weak
 392  *       soft or phantom) reference per object.
 393  *       It seems to be sufficient for JVM Spec.
 394  */
 395 int
 396 class_get_referent_offset(Class_Handle clss);
 397 
 398 /**
 399  * Function returns an VM_Data_Type value for a given class.
 400  *
 401  * @param klass - class handle
 402  *
 403  * @return VM_Data_Type value
 404  */
 405 VM_Data_Type
 406 class_get_primitive_type_of_class(Class_Handle klass);
 407 
 408 /**
 409  * Function returns a class corresponding to a primitive type.
 410  *
 411  * @param type - primitive type
 412  *
 413  * @return Class corresponding to a primitive type.
 414  *
 415  * @note For all primitive types <i>type</i>:
 416  *      <code>type == class_get_primitive_type_of_class(class_get_class_of_primitive_type(type))</code>
 417  */
 418 Class_Handle
 419 class_get_class_of_primitive_type(VM_Data_Type type);
 420 
 421 
 422 /**
 423  * For given a class handle <i>klass</i> construct a class handle of
 424  * the type representing array of <i>klass</i>. If class <i>klass</i>
 425  * is value type, assume that the element is a reference to a boxed
 426  * instance of that type.
 427  *
 428  * @param klass - class handle
 429  *
 430  * @return Return a class handle of the type representing array of <i>klass</i>.
 431  */
 432 Class_Handle
 433 class_get_array_of_class(Class_Handle klass);
 434 
 435 /**
 436  * Function returns the class of the array element of the given class.
 437  *
 438  * @param klass - class handle
 439  *
 440  * @return The class of the array element of the given class.
 441  *
 442  * @note The behavior is undefined if the parameter does not represent
 443  * an array class.
 444  */
 445 Class_Handle
 446 class_get_array_element_class(Class_Handle klass);
 447 
 448 /**
 449  * For a class that is an array function returns the type info for the elements
 450  * of the array.
 451  *
 452  * @param klass - class handle
 453  *
 454  * @return The type info for the elements of the array.
 455  */
 456 Type_Info_Handle
 457 class_get_element_type_info(Class_Handle klass);
 458 
 459 /**
 460  * Function gets the handle for a field. 
 461  *
 462  * @param klass - class handle
 463  * @param index - The value of <i>index</i> indexes into the set of fields that 
 464  *                includes both fields defined in this class and inherited fields.
 465  *
 466  * @return The handle for a field.
 467  *
 468  * @note If <i>index</i> is greater than or equal to
 469  *       <code>class_num_instance_fields_recursive</code>, return NULL.
 470  */
 471 Field_Handle
 472 class_get_instance_field_recursive(Class_Handle klass, unsigned index);
 473 
 474 /**
 475  * For a class handle that represents and array, function returns the
 476  * size of the element of the array.
 477  *
 478  * @param klass - class handle
 479  *
 480  * @return The size of the element of the array.
 481  */
 482 unsigned
 483 class_element_size(Class_Handle klass);
 484 
 485 /**
 486  * Function returns the vtable handle of the given class.
 487  *
 488  * @param klass - class handle
 489  *
 490  * @return The vtable handle of the given class.
 491  */
 492 VTable_Handle
 493 class_get_vtable(Class_Handle klass);
 494 
 495 /**
 496  * Function returns <code>TRUE</code> if the class is neither initialized
 497  * nor in the process of being initialized. The intention is that the JIT
 498  * will emit a call to VM_RT_INITIALIZE_CLASS before every access to a static
 499  * field in Java.
 500  *
 501  * @param klass - class handle
 502  *
 503  * @return Return <code>TRUE</code> if the class is neither initialized
 504  *         nor in the process of being initialized.
 505  */
 506 Boolean
 507 class_needs_initialization(Class_Handle klass);
 508 
 509 /**
 510  * Function returns <code>TRUE</code> if the class is already fully
 511  * initialized.
 512  *
 513  * @param klass - class handle
 514  *
 515  * @return Return <code>TRUE</code> if the class is already fully
 516  *         initialized.
 517  */
 518 Boolean
 519 class_is_initialized(Class_Handle klass);
 520 
 521 /**
 522  * Function returns the allocation handle to be used for runtime type
 523  * checks in JIT-generated code, given a class handle.
 524  *
 525  * @param klass - class handle
 526  *
 527  * @return The allocation handle to be used for runtime type checks.
 528  */
 529 Runtime_Type_Handle
 530 class_get_runtime_type_handle(Class_Handle klass);
 531 
 532 /**
 533  * Function returns the allocation handle to be used for the object
 534  * allocation routines, given a class handle.
 535  *
 536  * @param klass - class handle
 537  *
 538  * @return The allocation handle to be used for the object
 539  *         allocation routines.
 540  */
 541 Allocation_Handle
 542 class_get_allocation_handle(Class_Handle klass);
 543 
 544 /**
 545  * Function gets the alignment of the class.
 546  *
 547  * @param klass - class handle
 548  *
 549  * @return The alignment of the class.
 550  */
 551 unsigned
 552 class_get_alignment(Class_Handle klass);
 553 
 554 /**
 555  * Function returns <code>TRUE</code> if the class has a non-trivial finalizer.
 556  *
 557  * @param klass - class handle
 558  *
 559  * @return Returns <code>TRUE</code> if the class has a non-trivial finalizer..
 560  */
 561 Boolean
 562 class_is_finalizable(Class_Handle klass);
 563 
 564 /**
 565  * Function checks if this is an array of primitives.
 566  *
 567  * @param klass - class handle
 568  *
 569  * @return Returns <code>TRUE</code> if this is an array of primitives.
 570  */
 571 Boolean
 572 class_is_non_ref_array(Class_Handle klass);
 573 
 574 /**
 575  * Returns non-zero value if the class represented by Class_Handle
 576  * is a descendant of java.lang.ref.Reference. The particular type
 577  * of reference (weak, soft or phantom) is encoded by the return 
 578  * value of WeakReferenceType.
 579  *
 580  * @param klass - class handle
 581  *
 582  * @return Returns non-zero value if the class is a descendant
 583  *         of java.lang.ref.Reference.
 584  */
 585 WeakReferenceType
 586 class_is_reference(Class_Handle klass);
 587 
 588 /**
 589  * Function returns <code>TRUE</code> if th class is likely to be used
 590  * as an exception object. This is a hint only. If the result is <code>FALSE</code>,
 591  * the class may still be used for exceptions but it is less likely.
 592  *
 593  * @param klass - class handle
 594  *
 595  * @return Return <code>TRUE</code> if th class is likely to be used
 596  *         as an exception object.
 597  */
 598 Boolean
 599 class_hint_is_exceptiontype(Class_Handle klass);
 600 
 601 /**
 602  * Function returns <code>TRUE</code> if the class represents an enum.
 603  *
 604  * @param klass - class handle
 605  *
 606  * @return Return <code>TRUE</code> if the class represents an enum.
 607  *
 608  * @note For Java 1.4 always returns <code>FALSE</code>.
 609  */
 610 Boolean
 611 class_is_enum(Class_Handle klass);
 612 
 613 /**
 614  * Function returns number of instance fields defined in a class.
 615  * This number includes inherited fields.
 616  *
 617  * @param klass - class handle
 618  *
 619  * @return Return number of instance fields defined in a class.
 620  *
 621  * @note Replace class_num_instance_fields_recursive function.
 622  */
 623 unsigned
 624 class_get_all_instance_fields_number(Class_Handle klass);
 625 
 626 /**
 627  * Function returns the name of the package containing the class.
 628  *
 629  * @param klass - class handle
 630  *
 631  * @return Return the name of the package containing the class.
 632  */
 633 const char *
 634 class_get_package_name(Class_Handle klass);
 635 
 636 /**
 637  * Function returns a pointer to the location where the constant is stored.
 638  *
 639  * @param klass - class handle
 640  * @param index - interpreted as a constant pool index
 641  *
 642  * @return Return a pointer to the location where the constant is stored.
 643  *
 644  * @note This function shouldn't be called for constant strings.  
 645  *       Instead, either:
 646  *       1. the jitted code should get the string object at runtime by calling
 647  *          VM_RT_LDC_STRING, or
 648  *       2. use class_get_const_string_intern_addr().
 649  */
 650 const void *
 651 class_get_const_addr(Class_Handle klass, unsigned short index);
 652 
 653 /**
 654  * Function returns the type of a compile-time constant.
 655  *
 656  * @param klass - class handle
 657  * @param index - interpreted as a constant pool index
 658  *
 659  * @return Return the type of a compile-time constant.
 660  */
 661 VM_Data_Type
 662 class_get_const_type(Class_Handle klass, unsigned short index);
 663 
 664 /**
 665  * Function returns the address where the interned version of the string
 666  * is stored. Calling class_get_const_string_intern_addr has
 667  * a side-effect of interning the string, so that the JIT can
 668  * load a reference to the interned string without checking if
 669  * it is null.
 670  *
 671  * @param klass - class handle
 672  * @param index - interpreted as a constant pool index
 673  *
 674  * @return Return the address where the interned version of the string
 675  *         is stored.
 676  */
 677 void *
 678 class_get_const_string_intern_addr(Class_Handle klass, unsigned short index);
 679 
 680 /**
 681 
 682  * Function looks up of methods in class.
 683  *
 684  * @param klass - class handle
 685  * @param signature - method signature
 686  * @param recursive - flag for recursive search
 687  *
 688  * @return Found method handle.
 689  *
 690  * @note Reference to internal type Signature.
 691  * @note Replace class_lookup_method_recursively function and function class_lookup_method
 692  *       with parameter recursive.
 693  */
 694 
 695 Method_Handle
 696 
 697 class_lookup_method(Class_Handle klass, Signature* signature, Boolean recursive);
 698 
 699 
 700 
 701 /**
 702 
 703  * Function looks up of fields in class.
 704  *
 705  * @param klass - class handle
 706  * @param signature - field signature
 707  * @param recursive - flag for recursive search
 708  *
 709  * @return Found field handle.
 710  *
 711  * @note Reference to internal type Signature.
 712  * @note Replace class_lookup_field_recursive function and function class_lookup_field
 713  *       with parameter recursive.
 714  */
 715 
 716 Field_Handle
 717 class_lookup_field(Class_Handle klass, Signature* signature, Boolean recursive);
 718 
 719 /**
 720  * Function returns the signature for field or method/interface in constant pool entry.
 721  *
 722  * @param klass - class handle
 723  * @param cp_index - interpreted as a constant pool index
 724  *
 725  * @return Return the signature for field or method/interface in constant pool entry.
 726  */
 727 const char *
 728 class_get_cp_entry_signature(Class_Handle klass, unsigned short cp_index);
 729 
 730 /**
 731  * Function returns the data type for field in constant pool entry.
 732  *
 733  * @param klass - class handle
 734  * @param cp_index - interpreted as a constant pool index
 735  *
 736  * @return Return the data type for field in constant pool entry.
 737  */
 738 VM_Data_Type
 739 class_get_cp_field_type(Class_Handle klass, unsigned short cp_index);
 740 
 741 /**
 742  * Function initializes the <i>iterator</i>, to iterate over all classes that
 743  * descend from <i>klass</i>, including <i>klass</i> itself.
 744  *
 745  * @param klass - class handle
 746  * @param iterator - class iterator
 747  *
 748  * @return Return <code>TRUE</code> if iteration is supported over <i>klass</i>,
 749  *         <code>FALSE</code> if not.
 750  *
 751  * @note Reference to internal type ChaClassIterator.
 752  */
 753 Boolean
 754 class_iterator_initialize(ChaClassIterator *iterator, Class_Handle klass);
 755 
 756 /**
 757  * Function returns the current class of the iterator.
 758  *
 759  * @param iterator - class iterator
 760  *
 761  * @return Return the current class of the iterator
 762  *
 763  * @note NULL is returned if there are no more classes.
 764  * @note Reference to internal type ChaClassIterator.
 765  */
 766 Class_Handle
 767 class_iterator_get_current(ChaClassIterator *iterator);
 768 
 769 /**
 770  * Function advances the iterator.
 771  *
 772  * @param iterator - class iterator
 773  *
 774  * @note Reference to internal type ChaClassIterator.
 775  */
 776 void class_iterator_advance(ChaClassIterator *iterator);
 777 
 778 /**
 779  * Function returns java type for the descriptor.
 780  *
 781  * @param descriptor - java type descriptor
 782  *
 783  * @return Return java type for the descriptor.
 784  *
 785  * @note Replaces get_java_type function.
 786  */
 787 Java_Type
 788 type_get_java_type(const char* descriptor);
 789 
 790 /**
 791  * Function returns the descriptor for method.
 792  *
 793  * @param klass - class handle
 794  * @param index - interpreted as a constant pool index
 795  *
 796  * @return Return the the descriptor for method.
 797  *
 798  * @note Replaces const_pool_get_method_descriptor function.
 799  */
 800 const char *
 801 class_get_cp_method_descriptor(Class_Handle klass, unsigned short index);
 802 
 803 /**
 804  * Function returns the descriptor for field.
 805  *
 806  * @param klass - class handle
 807  * @param index - interpreted as a constant pool index
 808  *
 809  * @return Return the the descriptor for field.
 810  *
 811  * @note Replaces const_pool_get_field_descriptor function.
 812  */
 813 const char *
 814 class_get_cp_field_descriptor(Class_Handle klass, unsigned short index);
 815 
 816 /** 
 817  * Function returns class constant pool size.
 818  *
 819  * @param klass - class handle
 820  *
 821  * @return Return constant pool size.
 822  *
 823  * @note Assertion is raised if <i>klass</i> is equal to null.
 824  */
 825 unsigned short
 826 class_get_cp_size(Class_Handle klass);
 827 
 828 /** 
 829  * Function returns constant pool entry tag.
 830  *
 831  * @param klass - class handle
 832  * @param index - constant pool entry index
 833  *
 834  * @return Return constant pool entry tag.
 835  *
 836  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 837  */
 838 unsigned char
 839 class_get_cp_tag(Class_Handle klass, unsigned short index);
 840 
 841 /** 
 842  * Function returns class name entry index in constant pool.
 843  *
 844  * @param klass - class handle
 845  * @param index - constant pool entry index
 846  *
 847  * @return Return class name entry index.
 848  *
 849  * @note Function is legal only for constant pool entry with CONSTANT_Class tags.
 850  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 851  */
 852 unsigned short
 853 class_get_cp_class_name_index(Class_Handle klass, unsigned short index);
 854 
 855 /** 
 856  * Function returns class name entry index in constant pool.
 857  *
 858  * @param klass - class handle
 859  * @param index - constant pool entry index
 860  *
 861  * @return Return class name entry index.
 862  *
 863  * @note Function is legal for constant pool entry with 
 864  *       CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.
 865  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 866  */
 867 unsigned short
 868 class_get_cp_ref_class_index(Class_Handle klass, unsigned short index);
 869 
 870 /** 
 871  * Function returns name_and_type entry index in constant pool.
 872  *
 873  * @param klass - class handle
 874  * @param index - constant pool entry index
 875  *
 876  * @return Return name_and_type entry index.
 877  *
 878  * @note Function is legal for constant pool entry with 
 879  *       CONSTANT_Fieldref, CONSTANT_Methodref and CONSTANT_InterfaceMethodref tags.
 880  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 881  */
 882 unsigned short
 883 class_get_cp_ref_name_and_type_index(Class_Handle klass, unsigned short index);
 884 
 885 /** 
 886  * Function returns string entry index in constant pool.
 887  *
 888  * @param klass - class handle
 889  * @param index - constant pool entry index
 890  *
 891  * @return Return string entry index.
 892  *
 893  * @note Function is legal for constant pool entry with CONSTANT_String tags.
 894  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 895  */
 896 unsigned short
 897 class_get_cp_string_index(Class_Handle klass, unsigned short index);
 898 
 899 /** 
 900  * Function returns name entry index in constant pool.
 901  *
 902  * @param klass - class handle
 903  * @param index - constant pool entry index
 904  *
 905  * @return Return name entry index.
 906  *
 907  * @note Function is legal for constant pool entry with CONSTANT_NameAndType tags.
 908  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 909  */
 910 unsigned short
 911 class_get_cp_name_index(Class_Handle klass, unsigned short index);
 912 
 913 /** 
 914  * Function returns descriptor entry index in constant pool.
 915  *
 916  * @param klass - class handle
 917  * @param index - constant pool entry index
 918  *
 919  * @return Return descriptor entry index.
 920  *
 921  * @note Function is legal for constant pool entry with CONSTANT_NameAndType tags.
 922  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 923  */
 924 unsigned short
 925 class_get_cp_descriptor_index(Class_Handle klass, unsigned short index);
 926 
 927 /** 
 928  * Function returns bytes for UTF8 constant pool entry.
 929  *
 930  * @param klass - class handle
 931  * @param index - constant pool entry index
 932  *
 933  * @return bytes for UTF8 constant pool entry
 934  *
 935  * @note Function is legal for constant pool entry with CONSTANT_UTF8 tags.
 936  * @note Assertion is raised if <i>klass</i> is equal to null or <i>index</i> is out of range.
 937  */
 938 const char *
 939 class_get_cp_utf8_bytes(Class_Handle klass, unsigned short index);
 940 
 941 /**
 942  * Function resolves class for constant pool entry.
 943  *
 944  * @param klass - class handle
 945  * @param index - constant pool entry index
 946  * @param exc   - pointer to exception
 947  *
 948  * @return Return class resolved for constant pool entry.
 949  *
 950  * @note Replace vm_resolve_class and resolve_class functions.
 951  * @note Reference to external type Loader_Exception.
 952  */
 953 Class_Handle
 954 class_resolve_class(Class_Handle klass, unsigned short index, Loader_Exception* exc);
 955 
 956 /**
 957  * Function resolves class for constant pool entry 
 958  * and checks possibility for instance creation.
 959  *
 960  * @param klass - class handle
 961  * @param index - constant pool entry index
 962  * @param exc   - pointer to exception
 963  *
 964  * @return Return class resolved for constant pool entry.
 965  *
 966  * @note Replace vm_resolve_class_new and resolve_class_new functions.
 967  * @note Reference to external type Loader_Exception.
 968  * @note If an instance of the class couldn't be created, returns NULL and set
 969  *       <i>exc</i> exception value.
 970  */
 971 Class_Handle
 972 class_resolve_class_new(Class_Handle klass, unsigned short index, Loader_Exception *exc);
 973 
 974 /**
 975  * Function resolves class interface method for constant pool entry.
 976  *
 977  * @param klass - class handle
 978  * @param index - constant pool entry index
 979  * @param exc   - pointer to exception
 980  *
 981  * @return Return interface method resolved for constant pool entry.
 982  *
 983  * @note Replace resolve_interface_method function.
 984  * @note Reference to external type Loader_Exception.
 985  */
 986 Method_Handle
 987 class_resolve_interface_method(Class_Handle klass, unsigned short index,
 988                                Loader_Exception *exc);
 989 
 990 /**
 991  * Function resolves class static method for constant pool entry.
 992  *
 993  * @param klass - class handle
 994  * @param index - constant pool entry index
 995  * @param exc   - pointer to exception
 996  *
 997  * @return Return static method resolved for constant pool entry.
 998  *
 999  * @note Replace resolve_static_method function.
1000  * @note Reference to external type Loader_Exception.
1001  */
1002 Method_Handle
1003 class_resolve_static_method(Class_Handle klass, unsigned short index,
1004                             Loader_Exception *exc);
1005 
1006 /**
1007  * Function resolves class virtual method for constant pool entry.
1008  *
1009  * @param klass - class handle
1010  * @param index - constant pool entry index
1011  * @param exc   - pointer to exception
1012  *
1013  * @return Return virtual method resolved for constant pool entry.
1014  *
1015  * @note Replace resolve_virtual_method function.
1016  * @note Reference to external type Loader_Exception.
1017  */
1018 Method_Handle
1019 class_resolve_virtual_method(Class_Handle klass, unsigned short index,
1020                              Loader_Exception* exc);
1021 
1022 /**
1023  * Function resolves class special method for constant pool entry.
1024  *
1025  * @param klass - class handle
1026  * @param index - constant pool entry index
1027  * @param exc   - pointer to exception
1028  *
1029  * @return Return special method resolved for constant pool entry.
1030  *
1031  * @note Replace resolve_special_method function.
1032  * @note Reference to external type Loader_Exception.
1033  */
1034 Method_Handle
1035 class_resolve_special_method(Class_Handle klass, unsigned short index,
1036                              Loader_Exception* exc);
1037 
1038 /**
1039  * Function resolves class static field for constant pool entry.
1040  *
1041  * @param klass - class handle
1042  * @param index - constant pool entry index
1043  * @param exc   - pointer to exception
1044  *
1045  * @return Return static field resolved for constant pool entry.
1046  *
1047  * @note Replace resolve_static_field function.
1048  * @note Reference to external type Loader_Exception.
1049  */
1050 Field_Handle
1051 class_resolve_static_field(Class_Handle klass, unsigned short index, Loader_Exception* exc);
1052 
1053 /**
1054  * Function resolves class nonstatic field for constant pool entry.
1055  *
1056  * @param klass - class handle
1057  * @param index - constant pool entry index
1058  * @param exc   - pointer to exception
1059  *
1060  * @return Return nonstatic field resolved for constant pool entry.
1061  *
1062  * @note Replace resolve_nonstatic_field function.
1063  * @note Reference to external type Loader_Exception.
1064  */
1065 Field_Handle
1066 class_resolve_nonstatic_field(Class_Handle klass, unsigned short index,
1067                               Loader_Exception* exc);
1068 
1069 
1070 /**
1071  * Function converts class handle to JNI handle class.
1072  *
1073  * @param jnienv - JNI environment
1074  * @param klass  - class handle
1075  *
1076  * @return Return JNI handle class.
1077  *
1078  * @note Replace jni_class_from_handle and jclass_to_struct_Class functions.
1079  */
1080 jclass
1081 
1082 class_from_handle_jni(JNIEnv *jnienv, Class_Handle klass);
1083 
1084 
1085 
1086 /**
1087  * Function converts JNI class handle to class handle.
1088  *
1089  * @param jnienv - JNI environment
1090  * @param klass  - JNI class handle
1091  *
1092  * @return Return class handle.
1093  *
1094  * @note Replace jni_get_class_handle and struct_Class_to_jclass functions.
1095  */
1096 Class_Handle
1097 
1098 class_to_handle_jni(JNIEnv *jnienv, jclass klass);
1099 
1100 
1101 
1102 /**
1103  * Function provides preparation phase of class loading for a given class.
1104  *
1105  * @param klass  - class handle
1106  * @param ld_exc - pointer to exception
1107  *
1108  * @return Return result of class preparing.
1109  *
1110  * @note Reference to external type Loader_Exception.
1111  */
1112 Loader_Result
1113 class_prepare(Class_Handle klass, Loader_Exception *ld_exc);
1114 
1115 
1116 /**
1117  * Function provides initialization phase for a given class.
1118  *
1119  * @param klass  - class handle
1120  */
1121 void
1122 class_initialize(Class_Handle klass);
1123 
1124 /**
1125  * Function provides initialization phase of for a given class for JNI.
1126  *
1127  * @param klass           - class handle
1128  * @param throw_exception - exception thrown flag
1129  */
1130 void
1131 class_initialize_from_jni(Class_Handle klass, bool throw_exception);

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.