< prev index next >

src/hotspot/share/opto/parse.hpp

Print this page

428   // Must this parse be aborted?
429   bool failing()                { return C->failing(); }
430 
431   Block* rpo_at(int rpo) {
432     assert(0 <= rpo && rpo < _block_count, "oob");
433     return &_blocks[rpo];
434   }
435   Block* start_block() {
436     return rpo_at(flow()->start_block()->rpo());
437   }
438   // Can return null if the flow pass did not complete a block.
439   Block* successor_for_bci(int bci) {
440     return block()->successor_for_bci(bci);
441   }
442 
443  private:
444   // Create a JVMS & map for the initial state of this method.
445   SafePointNode* create_entry_map();
446 
447   // OSR helpers
448   Node *fetch_interpreter_state(int index, BasicType bt, Node *local_addrs, Node *local_addrs_base);
449   Node* check_interpreter_type(Node* l, const Type* type, SafePointNode* &bad_type_exit);
450   void  load_interpreter_state(Node* osr_buf);
451 
452   // Functions for managing basic blocks:
453   void init_blocks();
454   void load_state_from(Block* b);
455   void store_state_to(Block* b) { b->record_state(this); }
456 
457   // Parse all the basic blocks.
458   void do_all_blocks();
459 
460   // Parse the current basic block
461   void do_one_block();
462 
463   // Raise an error if we get a bad ciTypeFlow CFG.
464   void handle_missing_successor(int bci);
465 
466   // first actions (before BCI 0)
467   void do_method_entry();
468 

474   void ensure_phis_everywhere();
475 
476   // Merge the current mapping into the basic block starting at bci
477   void merge(          int target_bci);
478   // Same as plain merge, except that it allocates a new path number.
479   void merge_new_path( int target_bci);
480   // Merge the current mapping into an exception handler.
481   void merge_exception(int target_bci);
482   // Helper: Merge the current mapping into the given basic block
483   void merge_common(Block* target, int pnum);
484   // Helper functions for merging individual cells.
485   PhiNode *ensure_phi(       int idx, bool nocreate = false);
486   PhiNode *ensure_memory_phi(int idx, bool nocreate = false);
487   // Helper to merge the current memory state into the given basic block
488   void merge_memory_edges(MergeMemNode* n, int pnum, bool nophi);
489 
490   // Parse this bytecode, and alter the Parsers JVM->Node mapping
491   void do_one_bytecode();
492 
493   // helper function to generate array store check
494   void array_store_check();
495   // Helper function to generate array load
496   void array_load(BasicType etype);
497   // Helper function to generate array store
498   void array_store(BasicType etype);
499   // Helper function to compute array addressing
500   Node* array_addressing(BasicType type, int vals, const Type*& elemtype);

501 
502   void clinit_deopt();
503 
504   void rtm_deopt();
505 
506   // Pass current map to exits
507   void return_current(Node* value);
508 
509   // Register finalizers on return from Object.<init>
510   void call_register_finalizer();
511 
512   // Insert a compiler safepoint into the graph
513   void add_safepoint();
514 
515   // Insert a compiler safepoint into the graph, if there is a back-branch.
516   void maybe_add_safepoint(int target_bci) {
517     if (target_bci <= bci()) {
518       add_safepoint();
519     }
520   }

529 
530   // Helper functions for type checking bytecodes:
531   void  do_checkcast();
532   void  do_instanceof();
533 
534   // Helper functions for shifting & arithmetic
535   void modf();
536   void modd();
537   void l2f();
538 
539   // implementation of _get* and _put* bytecodes
540   void do_getstatic() { do_field_access(true,  false); }
541   void do_getfield () { do_field_access(true,  true); }
542   void do_putstatic() { do_field_access(false, false); }
543   void do_putfield () { do_field_access(false, true); }
544 
545   // common code for making initial checks and forming addresses
546   void do_field_access(bool is_get, bool is_field);
547 
548   // common code for actually performing the load or store
549   void do_get_xxx(Node* obj, ciField* field, bool is_field);
550   void do_put_xxx(Node* obj, ciField* field, bool is_field);
551 


552   // implementation of object creation bytecodes
553   void do_new();
554   void do_newarray(BasicType elemtype);
555   void do_anewarray();
556   void do_multianewarray();
557   Node* expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions, int nargs);
558 
559   // implementation of jsr/ret
560   void do_jsr();
561   void do_ret();
562 
563   float   dynamic_branch_prediction(float &cnt, BoolTest::mask btest, Node* test);
564   float   branch_prediction(float &cnt, BoolTest::mask btest, int target_bci, Node* test);
565   bool    seems_never_taken(float prob) const;
566   bool    path_is_suitable_for_uncommon_trap(float prob) const;
567 
568   void    do_ifnull(BoolTest::mask btest, Node* c);
569   void    do_if(BoolTest::mask btest, Node* c);





570   int     repush_if_args();
571   void    adjust_map_after_if(BoolTest::mask btest, Node* c, float prob, Block* path);
572   void    sharpen_type_after_if(BoolTest::mask btest,
573                                 Node* con, const Type* tcon,
574                                 Node* val, const Type* tval);
575   void    maybe_add_predicate_after_if(Block* path);
576   IfNode* jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask, float prob, float cnt);
577   void    jump_if_true_fork(IfNode *ifNode, int dest_bci_if_true, bool unc);
578   void    jump_if_false_fork(IfNode *ifNode, int dest_bci_if_false, bool unc);
579   void    jump_if_always_fork(int dest_bci_if_true, bool unc);
580 
581   friend class SwitchRange;
582   void    do_tableswitch();
583   void    do_lookupswitch();
584   void    jump_switch_ranges(Node* a, SwitchRange* lo, SwitchRange* hi, int depth = 0);
585   bool    create_jump_tables(Node* a, SwitchRange* lo, SwitchRange* hi);
586   void    linear_search_switch_ranges(Node* key_val, SwitchRange*& lo, SwitchRange*& hi);
587 
588   // helper function for call statistics
589   void count_compiled_calls(bool at_method_entry, bool is_inline) PRODUCT_RETURN;
590 
591   Node_Notes* make_node_notes(Node_Notes* caller_nn);

428   // Must this parse be aborted?
429   bool failing()                { return C->failing(); }
430 
431   Block* rpo_at(int rpo) {
432     assert(0 <= rpo && rpo < _block_count, "oob");
433     return &_blocks[rpo];
434   }
435   Block* start_block() {
436     return rpo_at(flow()->start_block()->rpo());
437   }
438   // Can return null if the flow pass did not complete a block.
439   Block* successor_for_bci(int bci) {
440     return block()->successor_for_bci(bci);
441   }
442 
443  private:
444   // Create a JVMS & map for the initial state of this method.
445   SafePointNode* create_entry_map();
446 
447   // OSR helpers
448   Node* fetch_interpreter_state(int index, const Type* type, Node* local_addrs, Node* local_addrs_base);
449   Node* check_interpreter_type(Node* l, const Type* type, SafePointNode* &bad_type_exit);
450   void  load_interpreter_state(Node* osr_buf);
451 
452   // Functions for managing basic blocks:
453   void init_blocks();
454   void load_state_from(Block* b);
455   void store_state_to(Block* b) { b->record_state(this); }
456 
457   // Parse all the basic blocks.
458   void do_all_blocks();
459 
460   // Parse the current basic block
461   void do_one_block();
462 
463   // Raise an error if we get a bad ciTypeFlow CFG.
464   void handle_missing_successor(int bci);
465 
466   // first actions (before BCI 0)
467   void do_method_entry();
468 

474   void ensure_phis_everywhere();
475 
476   // Merge the current mapping into the basic block starting at bci
477   void merge(          int target_bci);
478   // Same as plain merge, except that it allocates a new path number.
479   void merge_new_path( int target_bci);
480   // Merge the current mapping into an exception handler.
481   void merge_exception(int target_bci);
482   // Helper: Merge the current mapping into the given basic block
483   void merge_common(Block* target, int pnum);
484   // Helper functions for merging individual cells.
485   PhiNode *ensure_phi(       int idx, bool nocreate = false);
486   PhiNode *ensure_memory_phi(int idx, bool nocreate = false);
487   // Helper to merge the current memory state into the given basic block
488   void merge_memory_edges(MergeMemNode* n, int pnum, bool nophi);
489 
490   // Parse this bytecode, and alter the Parsers JVM->Node mapping
491   void do_one_bytecode();
492 
493   // helper function to generate array store check
494   Node* array_store_check(Node*& adr, const Type*& elemtype);
495   // Helper function to generate array load
496   void array_load(BasicType etype);
497   // Helper function to generate array store
498   void array_store(BasicType etype);
499   // Helper function to compute array addressing
500   Node* array_addressing(BasicType type, int vals, const Type*& elemtype);
501   Node* record_profile_for_speculation_at_array_load(Node* ld);
502 
503   void clinit_deopt();
504 
505   void rtm_deopt();
506 
507   // Pass current map to exits
508   void return_current(Node* value);
509 
510   // Register finalizers on return from Object.<init>
511   void call_register_finalizer();
512 
513   // Insert a compiler safepoint into the graph
514   void add_safepoint();
515 
516   // Insert a compiler safepoint into the graph, if there is a back-branch.
517   void maybe_add_safepoint(int target_bci) {
518     if (target_bci <= bci()) {
519       add_safepoint();
520     }
521   }

530 
531   // Helper functions for type checking bytecodes:
532   void  do_checkcast();
533   void  do_instanceof();
534 
535   // Helper functions for shifting & arithmetic
536   void modf();
537   void modd();
538   void l2f();
539 
540   // implementation of _get* and _put* bytecodes
541   void do_getstatic() { do_field_access(true,  false); }
542   void do_getfield () { do_field_access(true,  true); }
543   void do_putstatic() { do_field_access(false, false); }
544   void do_putfield () { do_field_access(false, true); }
545 
546   // common code for making initial checks and forming addresses
547   void do_field_access(bool is_get, bool is_field);
548 
549   // common code for actually performing the load or store
550   void do_get_xxx(Node* obj, ciField* field);
551   void do_put_xxx(Node* obj, ciField* field, bool is_field);
552 
553   ciType* improve_abstract_inline_type_klass(ciType* field_klass);
554 
555   // implementation of object creation bytecodes
556   void do_new();
557   void do_newarray(BasicType elemtype);
558   void do_newarray();
559   void do_multianewarray();
560   Node* expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions, int nargs);
561 
562   // implementation of jsr/ret
563   void do_jsr();
564   void do_ret();
565 
566   float   dynamic_branch_prediction(float &cnt, BoolTest::mask btest, Node* test);
567   float   branch_prediction(float &cnt, BoolTest::mask btest, int target_bci, Node* test);
568   bool    seems_never_taken(float prob) const;
569   bool    path_is_suitable_for_uncommon_trap(float prob) const;
570 
571   void    do_ifnull(BoolTest::mask btest, Node* c);
572   void    do_if(BoolTest::mask btest, Node* c, bool can_trap = true, bool new_path = false, Node** ctrl_taken = nullptr);
573   void    do_acmp(BoolTest::mask btest, Node* left, Node* right);
574   void    acmp_always_null_input(Node* input, const TypeOopPtr* tinput, BoolTest::mask btest, Node* eq_region);
575   void    acmp_known_non_inline_type_input(Node* input, const TypeOopPtr* tinput, ProfilePtrKind input_ptr, ciKlass* input_type, BoolTest::mask btest, Node* eq_region);
576   Node*   acmp_null_check(Node* input, const TypeOopPtr* tinput, ProfilePtrKind input_ptr, Node*& null_ctl);
577   void    acmp_unknown_non_inline_type_input(Node* input, const TypeOopPtr* tinput, ProfilePtrKind input_ptr, BoolTest::mask btest, Node* eq_region);
578   int     repush_if_args();
579   void    adjust_map_after_if(BoolTest::mask btest, Node* c, float prob, Block* path, bool can_trap = true);
580   void    sharpen_type_after_if(BoolTest::mask btest,
581                                 Node* con, const Type* tcon,
582                                 Node* val, const Type* tval);
583   void    maybe_add_predicate_after_if(Block* path);
584   IfNode* jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask, float prob, float cnt);
585   void    jump_if_true_fork(IfNode *ifNode, int dest_bci_if_true, bool unc);
586   void    jump_if_false_fork(IfNode *ifNode, int dest_bci_if_false, bool unc);
587   void    jump_if_always_fork(int dest_bci_if_true, bool unc);
588 
589   friend class SwitchRange;
590   void    do_tableswitch();
591   void    do_lookupswitch();
592   void    jump_switch_ranges(Node* a, SwitchRange* lo, SwitchRange* hi, int depth = 0);
593   bool    create_jump_tables(Node* a, SwitchRange* lo, SwitchRange* hi);
594   void    linear_search_switch_ranges(Node* key_val, SwitchRange*& lo, SwitchRange*& hi);
595 
596   // helper function for call statistics
597   void count_compiled_calls(bool at_method_entry, bool is_inline) PRODUCT_RETURN;
598 
599   Node_Notes* make_node_notes(Node_Notes* caller_nn);
< prev index next >