|
@@ -144,7 +144,7 @@ type context =
|
|
mutable ctx_do_safe_point : bool;
|
|
mutable ctx_do_safe_point : bool;
|
|
mutable ctx_real_this_ptr : bool;
|
|
mutable ctx_real_this_ptr : bool;
|
|
mutable ctx_dynamic_this_ptr : bool;
|
|
mutable ctx_dynamic_this_ptr : bool;
|
|
- mutable ctx_push_src_pos : bool;
|
|
|
|
|
|
+ mutable ctx_push_src_pos : string;
|
|
mutable ctx_static_id_curr : int;
|
|
mutable ctx_static_id_curr : int;
|
|
mutable ctx_static_id_used : int;
|
|
mutable ctx_static_id_used : int;
|
|
mutable ctx_static_id_depth : int;
|
|
mutable ctx_static_id_depth : int;
|
|
@@ -164,7 +164,7 @@ let new_context common_ctx writer debug =
|
|
ctx_assigning = false;
|
|
ctx_assigning = false;
|
|
ctx_debug = debug;
|
|
ctx_debug = debug;
|
|
ctx_debug_type = debug;
|
|
ctx_debug_type = debug;
|
|
- ctx_push_src_pos = false;
|
|
|
|
|
|
+ ctx_push_src_pos = "";
|
|
ctx_return_from_block = false;
|
|
ctx_return_from_block = false;
|
|
ctx_return_from_internal_node = false;
|
|
ctx_return_from_internal_node = false;
|
|
ctx_do_safe_point = false;
|
|
ctx_do_safe_point = false;
|
|
@@ -988,7 +988,7 @@ and gen_expression ctx retval expression =
|
|
let do_safe_point = ctx.ctx_do_safe_point in
|
|
let do_safe_point = ctx.ctx_do_safe_point in
|
|
ctx.ctx_do_safe_point <- false;
|
|
ctx.ctx_do_safe_point <- false;
|
|
let push_src_pos = ctx.ctx_push_src_pos in
|
|
let push_src_pos = ctx.ctx_push_src_pos in
|
|
- ctx.ctx_push_src_pos <- false;
|
|
|
|
|
|
+ ctx.ctx_push_src_pos <- "";
|
|
|
|
|
|
(* Annotate source code with debug - can get a bit verbose. Mainly for debugging code gen,
|
|
(* Annotate source code with debug - can get a bit verbose. Mainly for debugging code gen,
|
|
rather than the run time *)
|
|
rather than the run time *)
|
|
@@ -1179,7 +1179,7 @@ and gen_expression ctx retval expression =
|
|
end else begin
|
|
end else begin
|
|
writer#begin_block;
|
|
writer#begin_block;
|
|
if (do_safe_point) then output_i "__SAFE_POINT\n";
|
|
if (do_safe_point) then output_i "__SAFE_POINT\n";
|
|
- if (push_src_pos) then output_i "HX_SOURCE_PUSH\n";
|
|
|
|
|
|
+ if (push_src_pos<>"") then output_i ("HX_SOURCE_PUSH(\"" ^ push_src_pos ^ "\")\n");
|
|
(* Save old values, and equalize for new input ... *)
|
|
(* Save old values, and equalize for new input ... *)
|
|
let pop_names = push_anon_names ctx in
|
|
let pop_names = push_anon_names ctx in
|
|
let remaining = ref (List.length expr_list) in
|
|
let remaining = ref (List.length expr_list) in
|
|
@@ -1644,6 +1644,7 @@ let gen_field ctx class_def class_name ptr_name is_static is_external is_interfa
|
|
let nargs = string_of_int (List.length function_def.tf_args) in
|
|
let nargs = string_of_int (List.length function_def.tf_args) in
|
|
let is_void = (type_string function_def.tf_type ) = "Void" in
|
|
let is_void = (type_string function_def.tf_type ) = "Void" in
|
|
let ret = if is_void then "(void)" else "return " in
|
|
let ret = if is_void then "(void)" else "return " in
|
|
|
|
+ let src_name = class_name ^ "::" ^ field.cf_name in
|
|
|
|
|
|
if (not (is_dynamic_method field)) then begin
|
|
if (not (is_dynamic_method field)) then begin
|
|
(* The actual function definition *)
|
|
(* The actual function definition *)
|
|
@@ -1657,13 +1658,13 @@ let gen_field ctx class_def class_name ptr_name is_static is_external is_interfa
|
|
if (has_default_values function_def.tf_args) then begin
|
|
if (has_default_values function_def.tf_args) then begin
|
|
ctx.ctx_writer#begin_block;
|
|
ctx.ctx_writer#begin_block;
|
|
generate_default_values ctx function_def.tf_args "__o_";
|
|
generate_default_values ctx function_def.tf_args "__o_";
|
|
- output "\tHX_SOURCE_PUSH;\n";
|
|
|
|
|
|
+ output ("\tHX_SOURCE_PUSH(\"" ^ src_name ^ "\");\n");
|
|
gen_expression ctx false function_def.tf_expr;
|
|
gen_expression ctx false function_def.tf_expr;
|
|
if (is_void) then output "return null();\n";
|
|
if (is_void) then output "return null();\n";
|
|
ctx.ctx_writer#end_block;
|
|
ctx.ctx_writer#end_block;
|
|
end else begin
|
|
end else begin
|
|
if (is_void) then ctx.ctx_writer#begin_block;
|
|
if (is_void) then ctx.ctx_writer#begin_block;
|
|
- ctx.ctx_push_src_pos <- true;
|
|
|
|
|
|
+ ctx.ctx_push_src_pos <- src_name;
|
|
gen_expression ctx false (to_block function_def.tf_expr);
|
|
gen_expression ctx false (to_block function_def.tf_expr);
|
|
if (is_void) then begin
|
|
if (is_void) then begin
|
|
output "return null();\n";
|
|
output "return null();\n";
|
|
@@ -1684,7 +1685,7 @@ let gen_field ctx class_def class_name ptr_name is_static is_external is_interfa
|
|
output ("HX_BEGIN_DEFAULT_FUNC(" ^ func_name ^ "," ^ class_name ^ ")\n");
|
|
output ("HX_BEGIN_DEFAULT_FUNC(" ^ func_name ^ "," ^ class_name ^ ")\n");
|
|
output return_type;
|
|
output return_type;
|
|
output (" run(" ^ (gen_arg_list function_def.tf_args "") ^ ")");
|
|
output (" run(" ^ (gen_arg_list function_def.tf_args "") ^ ")");
|
|
- ctx.ctx_push_src_pos <- true;
|
|
|
|
|
|
+ ctx.ctx_push_src_pos <- src_name;
|
|
if (is_void) then begin
|
|
if (is_void) then begin
|
|
ctx.ctx_writer#begin_block;
|
|
ctx.ctx_writer#begin_block;
|
|
gen_expression ctx false function_def.tf_expr;
|
|
gen_expression ctx false function_def.tf_expr;
|