Nashorn equality operators check the types of their operands. The JSType.of() function that it uses does a costly distinction between OBJECT and FUNCTION, but that's unnecessary for the equality algorithm. A new "ofNoFunction" method that does not distinguish OBJECT and FUNCTION types is needed. This is one of recently discovered significant performance bottlenecks in Avatar.