Mercurial > hg > truffle
comparison src/share/vm/adlc/output_h.cpp @ 6848:8e47bac5643a
7054512: Compress class pointers after perm gen removal
Summary: support of compress class pointers in the compilers.
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Tue, 09 Oct 2012 10:11:38 +0200 |
parents | da91efe96a93 |
children | d336b3173277 |
comparison
equal
deleted
inserted
replaced
6847:65d07d9ee446 | 6848:8e47bac5643a |
---|---|
205 } | 205 } |
206 else if (!strcmp(type, "ConN")) { | 206 else if (!strcmp(type, "ConN")) { |
207 if (i > 0) fprintf(fp,", "); | 207 if (i > 0) fprintf(fp,", "); |
208 fprintf(fp," const TypeNarrowOop *_c%d;\n", i); | 208 fprintf(fp," const TypeNarrowOop *_c%d;\n", i); |
209 } | 209 } |
210 else if (!strcmp(type, "ConNKlass")) { | |
211 if (i > 0) fprintf(fp,", "); | |
212 fprintf(fp," const TypeNarrowKlass *_c%d;\n", i); | |
213 } | |
210 else if (!strcmp(type, "ConL")) { | 214 else if (!strcmp(type, "ConL")) { |
211 if (i > 0) fprintf(fp,", "); | 215 if (i > 0) fprintf(fp,", "); |
212 fprintf(fp," jlong _c%d;\n", i); | 216 fprintf(fp," jlong _c%d;\n", i); |
213 } | 217 } |
214 else if (!strcmp(type, "ConF")) { | 218 else if (!strcmp(type, "ConF")) { |
238 else if (!strcmp(comp->base_type(globals), "ConP")) { | 242 else if (!strcmp(comp->base_type(globals), "ConP")) { |
239 fprintf(fp," const TypePtr *_c%d;\n", i); | 243 fprintf(fp," const TypePtr *_c%d;\n", i); |
240 i++; | 244 i++; |
241 } | 245 } |
242 else if (!strcmp(comp->base_type(globals), "ConN")) { | 246 else if (!strcmp(comp->base_type(globals), "ConN")) { |
247 fprintf(fp," const TypePtr *_c%d;\n", i); | |
248 i++; | |
249 } | |
250 else if (!strcmp(comp->base_type(globals), "ConNKlass")) { | |
243 fprintf(fp," const TypePtr *_c%d;\n", i); | 251 fprintf(fp," const TypePtr *_c%d;\n", i); |
244 i++; | 252 i++; |
245 } | 253 } |
246 else if (!strcmp(comp->base_type(globals), "ConL")) { | 254 else if (!strcmp(comp->base_type(globals), "ConL")) { |
247 fprintf(fp," jlong _c%d;\n", i); | 255 fprintf(fp," jlong _c%d;\n", i); |
286 switch( constant_type ) { | 294 switch( constant_type ) { |
287 case Form::idealI : { | 295 case Form::idealI : { |
288 fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i); | 296 fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i); |
289 break; | 297 break; |
290 } | 298 } |
291 case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; } | 299 case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; } |
292 case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; } | 300 case Form::idealNKlass : { fprintf(fp,"const TypeNarrowKlass *c%d", i); break; } |
293 case Form::idealL : { fprintf(fp,"jlong c%d", i); break; } | 301 case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; } |
294 case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; } | 302 case Form::idealL : { fprintf(fp,"jlong c%d", i); break; } |
295 case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; } | 303 case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; } |
304 case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; } | |
296 default: | 305 default: |
297 assert(!is_ideal_bool, "Non-constant operand lacks component list."); | 306 assert(!is_ideal_bool, "Non-constant operand lacks component list."); |
298 break; | 307 break; |
299 } | 308 } |
300 } // end if NULL | 309 } // end if NULL |
310 if (i > 0) fprintf(fp,", "); | 319 if (i > 0) fprintf(fp,", "); |
311 fprintf(fp,"const TypePtr *c%d", i); | 320 fprintf(fp,"const TypePtr *c%d", i); |
312 i++; | 321 i++; |
313 } | 322 } |
314 else if (!strcmp(comp->base_type(globals), "ConN")) { | 323 else if (!strcmp(comp->base_type(globals), "ConN")) { |
324 if (i > 0) fprintf(fp,", "); | |
325 fprintf(fp,"const TypePtr *c%d", i); | |
326 i++; | |
327 } | |
328 else if (!strcmp(comp->base_type(globals), "ConNKlass")) { | |
315 if (i > 0) fprintf(fp,", "); | 329 if (i > 0) fprintf(fp,", "); |
316 fprintf(fp,"const TypePtr *c%d", i); | 330 fprintf(fp,"const TypePtr *c%d", i); |
317 i++; | 331 i++; |
318 } | 332 } |
319 else if (!strcmp(comp->base_type(globals), "ConL")) { | 333 else if (!strcmp(comp->base_type(globals), "ConL")) { |
375 else if (!strcmp(ideal_type, "ConP")) { | 389 else if (!strcmp(ideal_type, "ConP")) { |
376 fprintf(fp," _c%d->dump_on(st);\n", i); | 390 fprintf(fp," _c%d->dump_on(st);\n", i); |
377 ++i; | 391 ++i; |
378 } | 392 } |
379 else if (!strcmp(ideal_type, "ConN")) { | 393 else if (!strcmp(ideal_type, "ConN")) { |
394 fprintf(fp," _c%d->dump_on(st);\n", i); | |
395 ++i; | |
396 } | |
397 else if (!strcmp(ideal_type, "ConNKlass")) { | |
380 fprintf(fp," _c%d->dump_on(st);\n", i); | 398 fprintf(fp," _c%d->dump_on(st);\n", i); |
381 ++i; | 399 ++i; |
382 } | 400 } |
383 else if (!strcmp(ideal_type, "ConL")) { | 401 else if (!strcmp(ideal_type, "ConL")) { |
384 fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i); | 402 fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i); |
1237 fprintf(fp," virtual const Type *type() const {"); | 1255 fprintf(fp," virtual const Type *type() const {"); |
1238 const char *type = getIdealType(optype); | 1256 const char *type = getIdealType(optype); |
1239 if( type != NULL ) { | 1257 if( type != NULL ) { |
1240 Form::DataType data_type = oper->is_base_constant(_globalNames); | 1258 Form::DataType data_type = oper->is_base_constant(_globalNames); |
1241 // Check if we are an ideal pointer type | 1259 // Check if we are an ideal pointer type |
1242 if( data_type == Form::idealP || data_type == Form::idealN ) { | 1260 if( data_type == Form::idealP || data_type == Form::idealN || data_type == Form::idealNKlass ) { |
1243 // Return the ideal type we already have: <TypePtr *> | 1261 // Return the ideal type we already have: <TypePtr *> |
1244 fprintf(fp," return _c0;"); | 1262 fprintf(fp," return _c0;"); |
1245 } else { | 1263 } else { |
1246 // Return the appropriate bottom type | 1264 // Return the appropriate bottom type |
1247 fprintf(fp," return %s;", getIdealType(optype)); | 1265 fprintf(fp," return %s;", getIdealType(optype)); |
1366 fprintf(fp," virtual relocInfo::relocType constant_reloc() const {"); | 1384 fprintf(fp," virtual relocInfo::relocType constant_reloc() const {"); |
1367 fprintf(fp, " return _c0->reloc();"); | 1385 fprintf(fp, " return _c0->reloc();"); |
1368 fprintf(fp, " }\n"); | 1386 fprintf(fp, " }\n"); |
1369 } | 1387 } |
1370 else if (!strcmp(oper->ideal_type(_globalNames), "ConN")) { | 1388 else if (!strcmp(oper->ideal_type(_globalNames), "ConN")) { |
1389 // Access the locally stored constant | |
1390 fprintf(fp," virtual intptr_t constant() const {"); | |
1391 fprintf(fp, " return _c0->get_ptrtype()->get_con();"); | |
1392 fprintf(fp, " }\n"); | |
1393 // Generate query to determine if this pointer is an oop | |
1394 fprintf(fp," virtual relocInfo::relocType constant_reloc() const {"); | |
1395 fprintf(fp, " return _c0->get_ptrtype()->reloc();"); | |
1396 fprintf(fp, " }\n"); | |
1397 } | |
1398 else if (!strcmp(oper->ideal_type(_globalNames), "ConNKlass")) { | |
1371 // Access the locally stored constant | 1399 // Access the locally stored constant |
1372 fprintf(fp," virtual intptr_t constant() const {"); | 1400 fprintf(fp," virtual intptr_t constant() const {"); |
1373 fprintf(fp, " return _c0->get_ptrtype()->get_con();"); | 1401 fprintf(fp, " return _c0->get_ptrtype()->get_con();"); |
1374 fprintf(fp, " }\n"); | 1402 fprintf(fp, " }\n"); |
1375 // Generate query to determine if this pointer is an oop | 1403 // Generate query to determine if this pointer is an oop |
1808 case Form::idealI: | 1836 case Form::idealI: |
1809 fprintf(fp," return TypeInt::make(opnd_array(1)->constant());\n"); | 1837 fprintf(fp," return TypeInt::make(opnd_array(1)->constant());\n"); |
1810 break; | 1838 break; |
1811 case Form::idealP: | 1839 case Form::idealP: |
1812 case Form::idealN: | 1840 case Form::idealN: |
1841 case Form::idealNKlass: | |
1813 fprintf(fp," return opnd_array(1)->type();\n"); | 1842 fprintf(fp," return opnd_array(1)->type();\n"); |
1814 break; | 1843 break; |
1815 case Form::idealD: | 1844 case Form::idealD: |
1816 fprintf(fp," return TypeD::make(opnd_array(1)->constantD());\n"); | 1845 fprintf(fp," return TypeD::make(opnd_array(1)->constantD());\n"); |
1817 break; | 1846 break; |