+ /*
+ * Note: this filter runs unconditionally and uses a custom algorithm to
+ * detect data regions that probably contain x86 code.
+ *
+ * 'closest_target_usage' tracks the most recent position that has a
+ * good chance of being an x86 instruction. When the filter detects a
+ * likely x86 instruction, it updates this variable and considers the
+ * next 1023 bytes of data as valid for x86 translations.
+ *
+ * If part of the data does not, in fact, contain x86 machine code, then
+ * 'closest_target_usage' will, very likely, eventually fall more than
+ * 1023 bytes behind the current position. This results in x86
+ * translations being disabled until the next likely x86 instruction is
+ * detected.
+ *
+ * Translations on relative call (e8 opcode) instructions are slightly
+ * more restricted. They require that the most recent likely x86
+ * instruction was in the last 511 bytes, rather than the last 1023
+ * bytes.
+ *
+ * To identify "likely x86 instructions", the algorithm attempts to
+ * track the position of the most recent potential relative-addressing
+ * instruction that referenced each possible memory address. If it
+ * finds two references to the same memory address within a 65535 byte
+ * window, the second reference is flagged as a likely x86 instruction.
+ * Since the instructions considered for translation necessarily use
+ * relative addressing, the algorithm does a tentative translation into
+ * absolute addresses. In addition, so that memory addresses can be
+ * looked up in an array of reasonable size (in this code,
+ * 'last_target_usages'), only the low-order 2 bytes of each address are
+ * considered significant.
+ */
+