Browse Source

[java/cs] Avoid boxing with Runtime.compare expressions on dynamic field access

Closes #4047
Cauê Waneck 8 years ago
parent
commit
46601e4805
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/generators/gencs.ml
  2. 1 1
      src/generators/genjava.ml

+ 1 - 1
src/generators/gencs.ml

@@ -3014,7 +3014,7 @@ let generate con =
 				| TBinop (Ast.OpLt, e1, e2)
 				| TBinop (Ast.OpLt, e1, e2)
 				| TBinop (Ast.OpLte, e1, e2)
 				| TBinop (Ast.OpLte, e1, e2)
 				| TBinop (Ast.OpGte, e1, e2)
 				| TBinop (Ast.OpGte, e1, e2)
-				| TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2 || is_string e1.etype || is_string e2.etype
+				| TBinop (Ast.OpGt, e1, e2) -> is_dynamic e.etype || is_dynamic e1.etype || is_dynamic e2.etype || is_string e1.etype || is_string e2.etype
 				| TBinop (_, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2
 				| TBinop (_, e1, e2) -> is_dynamic e.etype || is_dynamic_expr e1 || is_dynamic_expr e2
 				| TUnop (_, _, e1) -> is_dynamic_expr e1 || is_null_expr e1 (* we will see if the expression is Null<T> also, as the unwrap from Unop will be the same *)
 				| TUnop (_, _, e1) -> is_dynamic_expr e1 || is_null_expr e1 (* we will see if the expression is Null<T> also, as the unwrap from Unop will be the same *)
 				| _ -> false)
 				| _ -> false)

+ 1 - 1
src/generators/genjava.ml

@@ -2488,7 +2488,7 @@ let generate con =
 			| TBinop (Ast.OpLt, e1, e2)
 			| TBinop (Ast.OpLt, e1, e2)
 			| TBinop (Ast.OpLte, e1, e2)
 			| TBinop (Ast.OpLte, e1, e2)
 			| TBinop (Ast.OpGte, e1, e2)
 			| TBinop (Ast.OpGte, e1, e2)
-			| TBinop (Ast.OpGt, e1, e2) -> is_dynamic_op e.etype || is_dynamic_expr is_dynamic_op e1 || is_dynamic_expr is_dynamic_op e2 || is_string e1.etype || is_string e2.etype
+			| TBinop (Ast.OpGt, e1, e2) -> is_dynamic_op e.etype || is_dynamic_op e1.etype || is_dynamic_op e2.etype || is_string e1.etype || is_string e2.etype
 			| TBinop (_, e1, e2) -> is_dynamic_op e.etype || is_dynamic_expr is_dynamic_op e1 || is_dynamic_expr is_dynamic_op e2
 			| TBinop (_, e1, e2) -> is_dynamic_op e.etype || is_dynamic_expr is_dynamic_op e1 || is_dynamic_expr is_dynamic_op e2
 			| TUnop (_, _, e1) ->
 			| TUnop (_, _, e1) ->
 				is_dynamic_expr is_dynamic_op e1
 				is_dynamic_expr is_dynamic_op e1