Sanity check region descriptors
commitf108e43c5e7dd278d76020fc681cd21d04800386
authorGuilherme Ottoni <ottoni@fb.com>
Fri, 29 Aug 2014 16:27:25 +0000 (29 09:27 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Fri, 29 Aug 2014 16:30:27 +0000 (29 09:30 -0700)
tree2d7cf73db209cf4c77d28e366befcaabf6671edf
parent7fa3bc2fc88b8e1cc23ffa4ad0cd5a367557c4aa
Sanity check region descriptors

Summary: Before trying to translate a region, checks if it is well-formed, which entails the following properties:

 1) The region has at least one block.

 2) Each block in the region has a different id.

 3) All arcs involve blocks within the region.

 4) For each arc, the bytecode offset of the dst block must possibly follow the execution of the src block.

 5) Each block contains at most one successor corresponding to a given SrcKey.

 6) The region doesn't contains any loops, unless JitLoops is enabled.

 7) All blocks are reachable from the entry block.

Reviewed By: @alexmalyshev

Differential Revision: D1521900
hphp/runtime/vm/hhbc.cpp
hphp/runtime/vm/hhbc.h
hphp/runtime/vm/jit/region-hot-trace.cpp
hphp/runtime/vm/jit/region-selection.cpp
hphp/runtime/vm/jit/region-selection.h
hphp/runtime/vm/jit/translator.cpp
hphp/runtime/vm/srckey.h