|
@@ -347,7 +347,7 @@ class builder jc name jsig = object(self)
|
|
|
code#dup;
|
|
|
code#aconst_null haxe_empty_constructor_sig;
|
|
|
self#invokespecial path "<init>" (method_sig [haxe_empty_constructor_sig] None);
|
|
|
- if not no_value then self#set_top_initialized (object_path_sig path);
|
|
|
+ if not no_value then self#replace_top (object_path_sig path);
|
|
|
if not no_value then code#dup;
|
|
|
let jsigs = f () in
|
|
|
self#invokevirtual path "new" (method_sig jsigs None);
|
|
@@ -355,7 +355,7 @@ class builder jc name jsig = object(self)
|
|
|
if not no_value then code#dup;
|
|
|
let jsigs = f () in
|
|
|
self#invokespecial path "<init>" (method_sig jsigs None);
|
|
|
- if not no_value then self#set_top_initialized (object_path_sig path)
|
|
|
+ if not no_value then self#replace_top (object_path_sig path)
|
|
|
|
|
|
(** Loads the default value corresponding to a given signature. **)
|
|
|
method load_default_value = function
|
|
@@ -490,8 +490,7 @@ class builder jc name jsig = object(self)
|
|
|
in
|
|
|
let rec unboxed_to_int () = match code#get_stack#top with
|
|
|
| TBool | TByte | TShort | TChar | TInt ->
|
|
|
- ignore(code#get_stack#pop);
|
|
|
- code#get_stack#push TInt;
|
|
|
+ self#replace_top TInt;
|
|
|
| TLong ->
|
|
|
code#l2i;
|
|
|
| TFloat ->
|
|
@@ -611,8 +610,7 @@ class builder jc name jsig = object(self)
|
|
|
code#l2i;
|
|
|
code#i2c;
|
|
|
| TBool,TInt ->
|
|
|
- ignore(code#get_stack#pop);
|
|
|
- code#get_stack#push TBool;
|
|
|
+ self#replace_top TBool;
|
|
|
| TObject(path1,_),TObject(path2,_) when path1 = path2 ->
|
|
|
()
|
|
|
| TObject((["java";"lang"],"String"),_),_ when allow_to_string ->
|
|
@@ -623,8 +621,7 @@ class builder jc name jsig = object(self)
|
|
|
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
|
|
|
+ self#replace_top object_sig
|
|
|
end else
|
|
|
code#checkcast path1
|
|
|
| TMethod _,TMethod _ ->
|
|
@@ -1002,9 +999,8 @@ class builder jc name jsig = object(self)
|
|
|
in
|
|
|
locals <- loop [] locals
|
|
|
|
|
|
- method set_top_initialized jsig =
|
|
|
- ignore(code#get_stack#pop);
|
|
|
- code#get_stack#push jsig
|
|
|
+ method replace_top jsig =
|
|
|
+ code#get_stack#replace jsig
|
|
|
|
|
|
(** This function has to be called once all arguments are declared. *)
|
|
|
method finalize_arguments =
|