src/share/vm/adlc/output_h.cpp

changeset 4159
8e47bac5643a
parent 4037
da91efe96a93
child 4161
d336b3173277
     1.1 --- a/src/share/vm/adlc/output_h.cpp	Mon Oct 08 17:04:00 2012 -0700
     1.2 +++ b/src/share/vm/adlc/output_h.cpp	Tue Oct 09 10:11:38 2012 +0200
     1.3 @@ -207,6 +207,10 @@
     1.4        if (i > 0) fprintf(fp,", ");
     1.5        fprintf(fp,"  const TypeNarrowOop *_c%d;\n", i);
     1.6      }
     1.7 +    else if (!strcmp(type, "ConNKlass")) {
     1.8 +      if (i > 0) fprintf(fp,", ");
     1.9 +      fprintf(fp,"  const TypeNarrowKlass *_c%d;\n", i);
    1.10 +    }
    1.11      else if (!strcmp(type, "ConL")) {
    1.12        if (i > 0) fprintf(fp,", ");
    1.13        fprintf(fp,"  jlong          _c%d;\n", i);
    1.14 @@ -243,6 +247,10 @@
    1.15          fprintf(fp,"  const TypePtr *_c%d;\n", i);
    1.16          i++;
    1.17        }
    1.18 +      else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
    1.19 +        fprintf(fp,"  const TypePtr *_c%d;\n", i);
    1.20 +        i++;
    1.21 +      }
    1.22        else if (!strcmp(comp->base_type(globals), "ConL")) {
    1.23          fprintf(fp,"  jlong            _c%d;\n", i);
    1.24          i++;
    1.25 @@ -288,11 +296,12 @@
    1.26        fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
    1.27        break;
    1.28      }
    1.29 -    case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
    1.30 -    case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; }
    1.31 -    case Form::idealL : { fprintf(fp,"jlong c%d", i);   break;        }
    1.32 -    case Form::idealF : { fprintf(fp,"jfloat c%d", i);  break;        }
    1.33 -    case Form::idealD : { fprintf(fp,"jdouble c%d", i); break;        }
    1.34 +    case Form::idealN :      { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
    1.35 +    case Form::idealNKlass : { fprintf(fp,"const TypeNarrowKlass *c%d", i); break; }
    1.36 +    case Form::idealP :      { fprintf(fp,"const TypePtr *c%d", i); break; }
    1.37 +    case Form::idealL :      { fprintf(fp,"jlong c%d", i);   break;        }
    1.38 +    case Form::idealF :      { fprintf(fp,"jfloat c%d", i);  break;        }
    1.39 +    case Form::idealD :      { fprintf(fp,"jdouble c%d", i); break;        }
    1.40      default:
    1.41        assert(!is_ideal_bool, "Non-constant operand lacks component list.");
    1.42        break;
    1.43 @@ -316,6 +325,11 @@
    1.44          fprintf(fp,"const TypePtr *c%d", i);
    1.45          i++;
    1.46        }
    1.47 +      else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
    1.48 +        if (i > 0) fprintf(fp,", ");
    1.49 +        fprintf(fp,"const TypePtr *c%d", i);
    1.50 +        i++;
    1.51 +      }
    1.52        else if (!strcmp(comp->base_type(globals), "ConL")) {
    1.53          if (i > 0) fprintf(fp,", ");
    1.54          fprintf(fp,"jlong c%d", i);
    1.55 @@ -380,6 +394,10 @@
    1.56      fprintf(fp,"    _c%d->dump_on(st);\n", i);
    1.57      ++i;
    1.58    }
    1.59 +  else if (!strcmp(ideal_type, "ConNKlass")) {
    1.60 +    fprintf(fp,"    _c%d->dump_on(st);\n", i);
    1.61 +    ++i;
    1.62 +  }
    1.63    else if (!strcmp(ideal_type, "ConL")) {
    1.64      fprintf(fp,"    st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
    1.65      ++i;
    1.66 @@ -1239,7 +1257,7 @@
    1.67        if( type != NULL ) {
    1.68          Form::DataType data_type = oper->is_base_constant(_globalNames);
    1.69          // Check if we are an ideal pointer type
    1.70 -        if( data_type == Form::idealP || data_type == Form::idealN ) {
    1.71 +        if( data_type == Form::idealP || data_type == Form::idealN || data_type == Form::idealNKlass ) {
    1.72            // Return the ideal type we already have: <TypePtr *>
    1.73            fprintf(fp," return _c0;");
    1.74          } else {
    1.75 @@ -1377,6 +1395,16 @@
    1.76            fprintf(fp,   " return _c0->get_ptrtype()->reloc();");
    1.77            fprintf(fp, " }\n");
    1.78          }
    1.79 +        else if (!strcmp(oper->ideal_type(_globalNames), "ConNKlass")) {
    1.80 +          // Access the locally stored constant
    1.81 +          fprintf(fp,"  virtual intptr_t       constant() const {");
    1.82 +          fprintf(fp,   " return _c0->get_ptrtype()->get_con();");
    1.83 +          fprintf(fp, " }\n");
    1.84 +          // Generate query to determine if this pointer is an oop
    1.85 +          fprintf(fp,"  virtual relocInfo::relocType           constant_reloc() const {");
    1.86 +          fprintf(fp,   " return _c0->get_ptrtype()->reloc();");
    1.87 +          fprintf(fp, " }\n");
    1.88 +        }
    1.89          else if (!strcmp(oper->ideal_type(_globalNames), "ConL")) {
    1.90            fprintf(fp,"  virtual intptr_t       constant() const {");
    1.91            // We don't support addressing modes with > 4Gig offsets.
    1.92 @@ -1810,6 +1838,7 @@
    1.93          break;
    1.94        case Form::idealP:
    1.95        case Form::idealN:
    1.96 +      case Form::idealNKlass:
    1.97          fprintf(fp,"    return  opnd_array(1)->type();\n");
    1.98          break;
    1.99        case Form::idealD:

mercurial