|
@@ -139,10 +139,9 @@ let jump ctx cond =
|
|
)
|
|
)
|
|
|
|
|
|
let jump_back ctx =
|
|
let jump_back ctx =
|
|
- let j = jump ctx J3Always in
|
|
|
|
let p = ctx.infos.ipos in
|
|
let p = ctx.infos.ipos in
|
|
write ctx HLabel;
|
|
write ctx HLabel;
|
|
- j , (fun cond ->
|
|
|
|
|
|
+ (fun cond ->
|
|
let delta = p - ctx.infos.ipos in
|
|
let delta = p - ctx.infos.ipos in
|
|
write ctx (HJump (cond,delta))
|
|
write ctx (HJump (cond,delta))
|
|
)
|
|
)
|
|
@@ -279,7 +278,7 @@ let coerce ctx t =
|
|
| KUInt -> HToUInt
|
|
| KUInt -> HToUInt
|
|
| KFloat -> HToNumber
|
|
| KFloat -> HToNumber
|
|
| KBool -> HToBool
|
|
| KBool -> HToBool
|
|
- | KType t -> HAsType t
|
|
|
|
|
|
+ | KType t -> HCast t
|
|
| KDynamic -> HAsAny
|
|
| KDynamic -> HAsAny
|
|
)
|
|
)
|
|
|
|
|
|
@@ -727,9 +726,8 @@ let rec gen_expr_content ctx retval e =
|
|
let jstart = (match flag with NormalWhile -> (fun()->()) | DoWhile -> jump ctx J3Always) in
|
|
let jstart = (match flag with NormalWhile -> (fun()->()) | DoWhile -> jump ctx J3Always) in
|
|
let end_loop = begin_loop ctx in
|
|
let end_loop = begin_loop ctx in
|
|
let branch = begin_branch ctx in
|
|
let branch = begin_branch ctx in
|
|
- let continue_pos = ctx.infos.ipos + 1 in
|
|
|
|
- let here, loop = jump_back ctx in
|
|
|
|
- here();
|
|
|
|
|
|
+ let continue_pos = ctx.infos.ipos in
|
|
|
|
+ let loop = jump_back ctx in
|
|
let jend = jump_expr ctx econd false in
|
|
let jend = jump_expr ctx econd false in
|
|
jstart();
|
|
jstart();
|
|
gen_expr ctx false e;
|
|
gen_expr ctx false e;
|
|
@@ -790,9 +788,8 @@ let rec gen_expr_content ctx retval e =
|
|
let b = open_block ctx [e] retval in
|
|
let b = open_block ctx [e] retval in
|
|
define_local ctx v t [e];
|
|
define_local ctx v t [e];
|
|
let end_loop = begin_loop ctx in
|
|
let end_loop = begin_loop ctx in
|
|
- let continue_pos = ctx.infos.ipos + 1 in
|
|
|
|
- let here, start = jump_back ctx in
|
|
|
|
- here();
|
|
|
|
|
|
+ let continue_pos = ctx.infos.ipos in
|
|
|
|
+ let start = jump_back ctx in
|
|
write ctx (HReg r.rid);
|
|
write ctx (HReg r.rid);
|
|
write ctx (HCallProperty (ident "hasNext",0));
|
|
write ctx (HCallProperty (ident "hasNext",0));
|
|
let jend = jump ctx J3False in
|
|
let jend = jump ctx J3False in
|
|
@@ -958,7 +955,8 @@ and gen_call ctx retval e el =
|
|
set_reg ctx racc;
|
|
set_reg ctx racc;
|
|
gen_expr ctx true e2;
|
|
gen_expr ctx true e2;
|
|
set_reg ctx rtmp;
|
|
set_reg ctx rtmp;
|
|
- let start, loop = jump_back ctx in
|
|
|
|
|
|
+ let start = jump ctx J3Always in
|
|
|
|
+ let loop = jump_back ctx in
|
|
write ctx (HReg racc.rid);
|
|
write ctx (HReg racc.rid);
|
|
write ctx (HReg rtmp.rid);
|
|
write ctx (HReg rtmp.rid);
|
|
write ctx (HReg rcounter.rid);
|
|
write ctx (HReg rcounter.rid);
|