Forráskód Böngészése

[java] use native arrays for wrapped captured variables

Dan Korostelev 10 éve
szülő
commit
b3deea245b
1 módosított fájl, 4 hozzáadás és 4 törlés
  1. 4 4
      filters.ml

+ 4 - 4
filters.ml

@@ -326,11 +326,11 @@ let captured_vars com e =
 	let t = com.basic in
 	let t = com.basic in
 
 
 	let impl = match com.platform with
 	let impl = match com.platform with
-	(* optimized version for C# - use native .net arrays *)
-	| Cs ->
+	(* optimized version for C#/Java - use native arrays *)
+	| Cs | Java ->
 		let cnativearray =
 		let cnativearray =
 			match (List.find (fun md -> match md with
 			match (List.find (fun md -> match md with
-					| TClassDecl ({ cl_path = ["cs"],"NativeArray" }) -> true
+					| TClassDecl ({ cl_path = ["cs" | "java"],"NativeArray" }) -> true
 					| _ -> false
 					| _ -> false
 				) com.types)
 				) com.types)
 			with TClassDecl cl -> cl | _ -> assert false
 			with TClassDecl cl -> cl | _ -> assert false
@@ -343,7 +343,7 @@ let captured_vars com e =
 				let earg = match ve with
 				let earg = match ve with
 					| None ->
 					| None ->
 						let t = match v.v_type with TInst (_, [t]) -> t | _ -> assert false in
 						let t = match v.v_type with TInst (_, [t]) -> t | _ -> assert false in
-						mk (TConst TNull) t p (* gencs will do the right thing for the non-nullable types *)
+						mk (TConst TNull) t p (* generator will do the right thing for the non-nullable types *)
 					| Some e -> e
 					| Some e -> e
 				in
 				in
 				{ (Optimizer.mk_untyped_call "__array__" p [earg]) with etype = v.v_type }
 				{ (Optimizer.mk_untyped_call "__array__" p [earg]) with etype = v.v_type }