Mercurial > hg > graal-compiler
comparison src/share/vm/adlc/dfa.cpp @ 475:284d0af00d53
6771309: debugging AD files is difficult without #line directives in generated code
Summary: more and better #line and #define directives in the generated code; ADLC itself accepts #line directives
Reviewed-by: never, kvn
author | jrose |
---|---|
date | Tue, 09 Dec 2008 12:41:26 -0800 |
parents | a61af66fc99e |
children | 0fbdb4381b99 dbbe28fc66b5 |
comparison
equal
deleted
inserted
replaced
474:7a018855d2f0 | 475:284d0af00d53 |
---|---|
456 Expr::check_buffers(); | 456 Expr::check_buffers(); |
457 } | 457 } |
458 | 458 |
459 | 459 |
460 class dfa_shared_preds { | 460 class dfa_shared_preds { |
461 enum { count = 2 }; | 461 enum { count = 4 }; |
462 | 462 |
463 static bool _found[count]; | 463 static bool _found[count]; |
464 static const char* _type [count]; | 464 static const char* _type [count]; |
465 static const char* _var [count]; | 465 static const char* _var [count]; |
466 static const char* _pred [count]; | 466 static const char* _pred [count]; |
477 // Check previous character and recurse if needed | 477 // Check previous character and recurse if needed |
478 char *prev = shared - 1; | 478 char *prev = shared - 1; |
479 char c = *prev; | 479 char c = *prev; |
480 switch( c ) { | 480 switch( c ) { |
481 case ' ': | 481 case ' ': |
482 case '\n': | |
482 return dfa_shared_preds::valid_loc(pred, prev); | 483 return dfa_shared_preds::valid_loc(pred, prev); |
483 case '!': | 484 case '!': |
484 case '(': | 485 case '(': |
485 case '<': | 486 case '<': |
486 case '=': | 487 case '=': |
488 return true; | |
489 case '"': // such as: #line 10 "myfile.ad"\n mypredicate | |
487 return true; | 490 return true; |
488 case '|': | 491 case '|': |
489 if( prev != pred && *(prev-1) == '|' ) return true; | 492 if( prev != pred && *(prev-1) == '|' ) return true; |
490 case '&': | 493 case '&': |
491 if( prev != pred && *(prev-1) == '&' ) return true; | 494 if( prev != pred && *(prev-1) == '&' ) return true; |
562 } | 565 } |
563 } | 566 } |
564 } | 567 } |
565 }; | 568 }; |
566 // shared predicates, _var and _pred entry should be the same length | 569 // shared predicates, _var and _pred entry should be the same length |
567 bool dfa_shared_preds::_found[dfa_shared_preds::count] = { false, false }; | 570 bool dfa_shared_preds::_found[dfa_shared_preds::count] |
568 const char* dfa_shared_preds::_type[dfa_shared_preds::count] = { "int", "bool" }; | 571 = { false, false, false, false }; |
569 const char* dfa_shared_preds::_var [dfa_shared_preds::count] = { "_n_get_int__", "Compile__current____select_24_bit_instr__" }; | 572 const char* dfa_shared_preds::_type[dfa_shared_preds::count] |
570 const char* dfa_shared_preds::_pred[dfa_shared_preds::count] = { "n->get_int()", "Compile::current()->select_24_bit_instr()" }; | 573 = { "int", "jlong", "intptr_t", "bool" }; |
574 const char* dfa_shared_preds::_var [dfa_shared_preds::count] | |
575 = { "_n_get_int__", "_n_get_long__", "_n_get_intptr_t__", "Compile__current____select_24_bit_instr__" }; | |
576 const char* dfa_shared_preds::_pred[dfa_shared_preds::count] | |
577 = { "n->get_int()", "n->get_long()", "n->get_intptr_t()", "Compile::current()->select_24_bit_instr()" }; | |
571 | 578 |
572 | 579 |
573 void ArchDesc::gen_dfa_state_body(FILE* fp, Dict &minimize, ProductionState &status, Dict &operands_chained_from, int i) { | 580 void ArchDesc::gen_dfa_state_body(FILE* fp, Dict &minimize, ProductionState &status, Dict &operands_chained_from, int i) { |
574 // Start the body of each Op_XXX sub-dfa with a clean state. | 581 // Start the body of each Op_XXX sub-dfa with a clean state. |
575 status.initialize(); | 582 status.initialize(); |