|
@@ -458,7 +458,7 @@ struct
|
|
|
|
|
|
let hash_cache = ref None in
|
|
let hash_cache = ref None in
|
|
|
|
|
|
- let call_hashcode = { local with
|
|
|
|
|
|
+ (* let call_hashcode = { local with
|
|
eexpr = TCall({ local with
|
|
eexpr = TCall({ local with
|
|
eexpr = TField(local, FDynamic "hashCode");
|
|
eexpr = TField(local, FDynamic "hashCode");
|
|
etype = TFun([], basic.tint);
|
|
etype = TFun([], basic.tint);
|
|
@@ -472,6 +472,13 @@ struct
|
|
mk (TConst (TInt (Int32.of_int 0))) basic.tint local.epos,
|
|
mk (TConst (TInt (Int32.of_int 0))) basic.tint local.epos,
|
|
Some call_hashcode
|
|
Some call_hashcode
|
|
)
|
|
)
|
|
|
|
+ } in *)
|
|
|
|
+ let local_hashcode = ref { local with
|
|
|
|
+ eexpr = TCall({ local with
|
|
|
|
+ eexpr = TField(local, FDynamic "hashCode");
|
|
|
|
+ etype = TFun([], basic.tint);
|
|
|
|
+ }, []);
|
|
|
|
+ etype = basic.tint
|
|
} in
|
|
} in
|
|
|
|
|
|
let get_hash_cache () =
|
|
let get_hash_cache () =
|
|
@@ -587,7 +594,9 @@ struct
|
|
(el, e)
|
|
(el, e)
|
|
in
|
|
in
|
|
|
|
|
|
- let switch = { eswitch with
|
|
|
|
|
|
+ let is_not_null_check = mk (TBinop (OpNotEq, local, { local with eexpr = TConst TNull })) basic.tbool local.epos in
|
|
|
|
+ let if_not_null e = { e with eexpr = TIf (is_not_null_check, e, None) } in
|
|
|
|
+ let switch = if_not_null { eswitch with
|
|
eexpr = TSwitch(!local_hashcode, List.map change_case (reorder_cases ecases []), None);
|
|
eexpr = TSwitch(!local_hashcode, List.map change_case (reorder_cases ecases []), None);
|
|
} in
|
|
} in
|
|
(if !has_case then begin
|
|
(if !has_case then begin
|