Simple
H&P would not release the 3.9 Source Code
H&P esentially only project managed 3.9
The core 3.9 developers now work on 4.0 as well.
These people used their 3.9 code.
So I imagine it a mixture of 3.1 & 3.9 and some clever reverse enginneering / reimplentation if necessary.