Not sure about the dog whistle. It could be irritating (seeen dogs irritated by it). I might opt for just a normal whistle.
Throwing a rock at a bear is a bad idea, IMO, it is likely to get its attention and potentially in not a good way.
Anything that has a potential to aggrevate the bear has potential to make it charge...that is what you wish to avoid. Clonking it on the head with a golf ball sized rock in a good location could easily come off as agression and that may work, but if the bear is hungry and this angers it, you are now in a worse position than you started. Too risky IMO.
Defending yourself with rocks, poles, knives, guns, etc should be left until the bear is coming at you. Otherwise make noise, look big and back off. Do not make eye contact with any wild animal or unfamiliar large dog.
In general if black bear once charging or close, fight. If brown, play dead.