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
68 files changed
tree: 5ae31a78b20760a6691ef279fd0ffa14d6efe7a2
  1. .settings/
  2. bin/
  3. examples/
  4. java/
  5. src/
  6. .buckconfig
  7. .classpath
  8. .gitignore
  9. .gitmodules
  10. .project
  11. bootstrap.defs
  12. BUCK
  13. fake_pom_install.xml
  14. LICENSE
  15. LICENSE.EPL
  16. LICENSE.GPL
  17. README.md
README.md

Prolog Cafe

A fork of Mutsunori BANBARA‘s PrologCafe to support Gerrit Code Review’s customizable project rules.

Build

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