> A debugger can do anything. You can't outthink a debugger
Yes that's what we're saying. So you deoptimise when someone starts debugging.
> and shouldn't try
You'd get extremely slow code with this approach!
> Speculation is when you guess and need to have a guard in case the guess is wrong.
Yes, you're guessing that nobody will attach a debugger and you're guarding that no debugger has been attached. That guard is usually implicit.
> They're describing a situation where it can't be wrong and you wouldn't need to speculate.
It can be wrong... if someone's using a debugger. So you need to speculate that they aren't using a debugger.
I wrote a PhD about using speculation and deoptimisation to solve the problem of people debugging optimised code.