commit | 39f0cc85c21f9e1f0f78d78824044d1d7c7b34d5 | [log] [tgz] |
---|---|---|
author | Shawn Pearce <sop@google.com> | Thu Mar 12 17:18:55 2015 -0700 |
committer | Shawn Pearce <sop@google.com> | Thu Mar 12 17:18:55 2015 -0700 |
tree | 5ae31a78b20760a6691ef279fd0ffa14d6efe7a2 | |
parent | 6ac9bc974598d5463b824d2fbe52d35080f21f2a [diff] |
Inline is{Integer,Double,Symbol,List,...} with instanceof Most places that type-test a Term immediately downcast if the type test is successful. The Java JIT is used to seeing "x instanceof Foo" before "((Foo) x)" and can optimize the type-test and downcast logic in machine code to only check the type once. Take advantage of that by swapping out the isXxx() methods on Term for proper instanceof checks in the Java code. Flip the logic for $cut around to be more like human written code where the common success path is the term is the correct type and can be immediately downcast. JITs expect this flow as it happens so often in Java source, and $cut happens often in the Prolog meta interpreter. Change-Id: I4ba34cab751b6060a3b1cc1adbf75ed0019b36fd
A fork of Mutsunori BANBARA‘s PrologCafe to support Gerrit Code Review’s customizable project rules.
To bootstrap Buck and SWI-Prolog >= 6.6.4 must be installed and then build the runtime and compiler with:
buck build all
To package for Maven into the local ~/.m2/repository
directory:
buck build install
To publish to the gerrit-maven storage bucket:
buck build deploy