angler-fishThe Vulnerability History Project

SANDBOX-BPF: Initial version of the updated code generator.

      New code generator that is more generic and can automatically reorder
instructions to meet the constraints of BPF programs.

Previously, we were very careful to emit instructions in just the
right order so that there would only ever be forward jumps. As we add
more features to our BPF programs, this code is getting fragile.

So, instead, we now use standard compiler techniques; we first build a
graph of all the instructions, then we split them into basic blocks,
we perform some basic optimizations (at the moment, this is just the
merging of common tails of instructions), we sort the basic blocks
topologically, and then we reassemble all the blocks into a BPF
program.

There should be no functional change, but this code is the
pre-requisite for upcoming changes.


BUG=130662
TEST=sandbox_linux_unittests

Review URL: https://chromiumcodereview.appspot.com/10690011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162924 0039d316-1c4b-4281-b951-d872f2087c98
    
commit 772c04797682f3936e8323dbd04c311268ee01fe
-6
+1 -1
-16
-51
-657
-147
-445
-1
-63
+115 -49
+12 -11
+4 -1
+14 -14
+7 -7
expand_less