Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4356656

Some uses of JavaValue don't work on Sparc

XMLWordPrintable

    • tiger
    • sparc
    • solaris_7



      Name: cl74495 Date: 07/26/2000


      JavaValue is defined in globalDefinitions.hpp as
      class JavaValue {
       public:
        BasicType _type;
        union {
          jboolean b;
          jbyte x;
          jchar c;
          jfloat f;
          jdouble d;
          jshort s;
          jint i;
          jlong l;
          jobject h;
        } _value;

      If you try to code a call from C++ to a Java method with result type
      boolean, you have to do it like this:

      JavaValue result(T_BOOLEAN);
      ....
      JavaCalls::call_static(&result, ..... );
      ...
      bool cResult = result._value.i ;

      result._value.b will always be zero on sparc because the elements of
      the union align differently on sparc than on Intel.
      You might want to omit the unusable elements of the union and
      define accessor methods instead.
      (Review ID: 107227)
      ======================================================================

            rverabel Raghu Verabelli (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: