68 const char *NameList::iter() { |
68 const char *NameList::iter() { |
69 if (_justReset) {_justReset=false; return (_iter < _cur ? _names[_iter] : NULL);} |
69 if (_justReset) {_justReset=false; return (_iter < _cur ? _names[_iter] : NULL);} |
70 else return (_iter <_cur-1 ? _names[++_iter] : NULL); |
70 else return (_iter <_cur-1 ? _names[++_iter] : NULL); |
71 } |
71 } |
72 const char *NameList::current() { return (_iter < _cur ? _names[_iter] : NULL); } |
72 const char *NameList::current() { return (_iter < _cur ? _names[_iter] : NULL); } |
|
73 const char *NameList::peek(int skip) { return (_iter + skip < _cur ? _names[_iter + skip] : NULL); } |
73 |
74 |
74 // Return 'true' if current entry is signal |
75 // Return 'true' if current entry is signal |
75 bool NameList::current_is_signal() { |
76 bool NameList::current_is_signal() { |
76 const char *entry = current(); |
77 const char *entry = current(); |
77 return is_signal(entry); |
78 return is_signal(entry); |
246 } |
247 } |
247 |
248 |
248 // True if 'opType', an ideal name, loads or stores. |
249 // True if 'opType', an ideal name, loads or stores. |
249 Form::DataType Form::is_load_from_memory(const char *opType) const { |
250 Form::DataType Form::is_load_from_memory(const char *opType) const { |
250 if( strcmp(opType,"LoadB")==0 ) return Form::idealB; |
251 if( strcmp(opType,"LoadB")==0 ) return Form::idealB; |
|
252 if( strcmp(opType,"LoadUB")==0 ) return Form::idealB; |
251 if( strcmp(opType,"LoadUS")==0 ) return Form::idealC; |
253 if( strcmp(opType,"LoadUS")==0 ) return Form::idealC; |
252 if( strcmp(opType,"LoadD")==0 ) return Form::idealD; |
254 if( strcmp(opType,"LoadD")==0 ) return Form::idealD; |
253 if( strcmp(opType,"LoadD_unaligned")==0 ) return Form::idealD; |
255 if( strcmp(opType,"LoadD_unaligned")==0 ) return Form::idealD; |
254 if( strcmp(opType,"LoadF")==0 ) return Form::idealF; |
256 if( strcmp(opType,"LoadF")==0 ) return Form::idealF; |
255 if( strcmp(opType,"LoadI")==0 ) return Form::idealI; |
257 if( strcmp(opType,"LoadI")==0 ) return Form::idealI; |
|
258 if( strcmp(opType,"LoadUI2L")==0 ) return Form::idealI; |
256 if( strcmp(opType,"LoadKlass")==0 ) return Form::idealP; |
259 if( strcmp(opType,"LoadKlass")==0 ) return Form::idealP; |
257 if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealN; |
260 if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealN; |
258 if( strcmp(opType,"LoadL")==0 ) return Form::idealL; |
261 if( strcmp(opType,"LoadL")==0 ) return Form::idealL; |
259 if( strcmp(opType,"LoadL_unaligned")==0 ) return Form::idealL; |
262 if( strcmp(opType,"LoadL_unaligned")==0 ) return Form::idealL; |
260 if( strcmp(opType,"LoadPLocked")==0 ) return Form::idealP; |
263 if( strcmp(opType,"LoadPLocked")==0 ) return Form::idealP; |
368 assert( false, "NotImplemented"); |
371 assert( false, "NotImplemented"); |
369 return false; |
372 return false; |
370 } |
373 } |
371 |
374 |
372 // Print out the dictionary contents as key-value pairs |
375 // Print out the dictionary contents as key-value pairs |
373 static void dumpkey (const void* key) { fprintf(stdout, "%s", key); } |
376 static void dumpkey (const void* key) { fprintf(stdout, "%s", (char*) key); } |
374 static void dumpform(const void* form) { fflush(stdout); ((Form*)form)->dump(); } |
377 static void dumpform(const void* form) { fflush(stdout); ((Form*)form)->dump(); } |
375 |
378 |
376 void FormDict::dump() { |
379 void FormDict::dump() { |
377 _form.print(dumpkey, dumpform); |
380 _form.print(dumpkey, dumpform); |
378 } |
381 } |