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 template <typename L, typename R> int saturated_add(L a, R b); 131 132 public: 133 void check_is_loaded() const { assert(is_loaded(), "not loaded"); } 134 135 // Basic method information. 136 ciFlags flags() const { check_is_loaded(); return _flags; } 137 ciSymbol* name() const { return _name; } 138 ciInstanceKlass* holder() const { return _holder; } 139 ciMethodData* method_data(); 140 ciMethodData* method_data_or_null(); 141 142 // Signature information. 143 ciSignature* signature() const { return _signature; } 144 ciType* return_type() const { return _signature->return_type(); } 145 int arg_size_no_receiver() const { return _signature->size(); } 146 // Can only be used on loaded ciMethods 147 int arg_size() const { 148 check_is_loaded(); 149 return _signature->size() + (_flags.is_static() ? 0 : 1); 150 } 151 // Report the number of elements on stack when invoking the current method. |