Skip to content

Commit

Permalink
[jvm] avoid some more checkcast ops to Object
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Aug 9, 2020
1 parent b4eea57 commit de65a4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/generators/jvm/jvmMethod.ml
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,15 @@ class builder jc name jsig = object(self)
| TObject((["java";"lang"],"String"),_),_ when allow_to_string ->
self#expect_reference_type;
self#invokestatic (["haxe";"jvm"],"Jvm") "toString" (method_sig [object_sig] (Some string_sig))
| TObject(path1,_),TObject(path2,_) ->
if path1 = object_path then begin
| TObject(path1,_),t2 ->
if is_unboxed t2 then
self#expect_reference_type
else if path1 = object_path then begin
(* We should never need a checkcast to Object, but we should adjust the stack so stack maps are wide enough *)
ignore(code#get_stack#pop);
code#get_stack#push object_sig
end else
code#checkcast path1;
| TObject(path,_),TTypeParameter _ ->
code#checkcast path
code#checkcast path1
| TMethod _,TMethod _ ->
()
| TMethod _,_ ->
Expand Down

0 comments on commit de65a4d

Please sign in to comment.