org.mozilla.javascript.regexp.NativeRegExp at line 1891 does:
ScriptRuntime.addInstructionCount(cx, 5);
this will trigger a call to observeInstructionCount even if instructionThreshold is 0.
To reproduce, create a Context class which overrides observeInstructionCount and use regexps. observeInstructionCount will be called even though setInstructionObserverThreshold has not been called