109 110 const char* type_string() { return "ciMethod"; } 111 112 void print_impl(outputStream* st); 113 114 void load_code(); 115 116 bool ensure_method_data(const methodHandle& h_m); 117 118 void code_at_put(int bci, Bytecodes::Code code) { 119 Bytecodes::check(code); 120 assert(0 <= bci && bci < code_size(), "valid bci"); 121 address bcp = _code + bci; 122 *bcp = code; 123 } 124 125 // Check bytecode and profile data collected are compatible 126 void assert_virtual_call_type_ok(int bci); 127 void assert_call_type_ok(int bci); 128 129 public: 130 void check_is_loaded() const { assert(is_loaded(), "not loaded"); } 131 132 // Basic method information. 133 ciFlags flags() const { check_is_loaded(); return _flags; } 134 ciSymbol* name() const { return _name; } 135 ciInstanceKlass* holder() const { return _holder; } 136 ciMethodData* method_data(); 137 ciMethodData* method_data_or_null(); 138 139 // Signature information. 140 ciSignature* signature() const { return _signature; } 141 ciType* return_type() const { return _signature->return_type(); } 142 int arg_size_no_receiver() const { return _signature->size(); } 143 // Can only be used on loaded ciMethods 144 int arg_size() const { 145 check_is_loaded(); 146 return _signature->size() + (_flags.is_static() ? 0 : 1); 147 } 148 // Report the number of elements on stack when invoking the current method. | 109 110 const char* type_string() { return "ciMethod"; } 111 112 void print_impl(outputStream* st); 113 114 void load_code(); 115 116 bool ensure_method_data(const methodHandle& h_m); 117 118 void code_at_put(int bci, Bytecodes::Code code) { 119 Bytecodes::check(code); 120 assert(0 <= bci && bci < code_size(), "valid bci"); 121 address bcp = _code + bci; 122 *bcp = code; 123 } 124 125 // Check bytecode and profile data collected are compatible 126 void assert_virtual_call_type_ok(int bci); 127 void assert_call_type_ok(int bci); 128 129 // Update profile counters with saturating addition 130 int saturated_add_int(int a, int b); 131 public: 132 void check_is_loaded() const { assert(is_loaded(), "not loaded"); } 133 134 // Basic method information. 135 ciFlags flags() const { check_is_loaded(); return _flags; } 136 ciSymbol* name() const { return _name; } 137 ciInstanceKlass* holder() const { return _holder; } 138 ciMethodData* method_data(); 139 ciMethodData* method_data_or_null(); 140 141 // Signature information. 142 ciSignature* signature() const { return _signature; } 143 ciType* return_type() const { return _signature->return_type(); } 144 int arg_size_no_receiver() const { return _signature->size(); } 145 // Can only be used on loaded ciMethods 146 int arg_size() const { 147 check_is_loaded(); 148 return _signature->size() + (_flags.is_static() ? 0 : 1); 149 } 150 // Report the number of elements on stack when invoking the current method. |