Top


定義場所(file name)

hotspot/src/share/vm/prims/jvm.cpp

名前(function name)

void initialize_converter_functions() {

本体部(body)

  {- -------------------------------------------
  (1) 使用している JDK のバージョンが 1.4 以上であれば, することはないので終了.
      ---------------------------------------- -}

      if (JDK_Version::is_gte_jdk14x_version()) {
        // These functions only exist for compatibility with 1.3.1 and earlier
        return;
      }

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      // called from universe_post_init()
      assert(
        int_bits_to_float_fn   == NULL &&
        long_bits_to_double_fn == NULL &&
        float_to_int_bits_fn   == NULL &&
        double_to_long_bits_fn == NULL ,
        "initialization done twice"
      );

  {- -------------------------------------------
  (1) NativeLookup::base_library_lookup() で対応する関数へのポインタを取得し, それぞれの変数にセットする.
      ---------------------------------------- -}

      // initialize
      int_bits_to_float_fn   = CAST_TO_FN_PTR(IntBitsToFloatFn  , NativeLookup::base_library_lookup("java/lang/Float" , "intBitsToFloat"  , "(I)F"));
      long_bits_to_double_fn = CAST_TO_FN_PTR(LongBitsToDoubleFn, NativeLookup::base_library_lookup("java/lang/Double", "longBitsToDouble", "(J)D"));
      float_to_int_bits_fn   = CAST_TO_FN_PTR(FloatToIntBitsFn  , NativeLookup::base_library_lookup("java/lang/Float" , "floatToIntBits"  , "(F)I"));
      double_to_long_bits_fn = CAST_TO_FN_PTR(DoubleToLongBitsFn, NativeLookup::base_library_lookup("java/lang/Double", "doubleToLongBits", "(D)J"));

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      // verify
      assert(
        int_bits_to_float_fn   != NULL &&
        long_bits_to_double_fn != NULL &&
        float_to_int_bits_fn   != NULL &&
        double_to_long_bits_fn != NULL ,
        "initialization failed"
      );
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.