Explorar o código

inlined Std.is for class/interfaces (x40 speedup)

Nicolas Cannasse %!s(int64=12) %!d(string=hai) anos
pai
achega
68c66e4ebd
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      genswf9.ml

+ 5 - 0
genswf9.ml

@@ -1374,6 +1374,11 @@ and gen_call ctx retval e el r =
 		gen_expr ctx true e;
 		gen_expr ctx true t;
 		write ctx (HOp A3OIs)
+	| TField (_,FStatic ({ cl_path = [],"Std" },{ cf_name = "is" })),[e;{ eexpr = TTypeExpr (TClassDecl _) } as t] ->
+		(* fast inlining of Std.is with known values *)
+		gen_expr ctx true e;
+		gen_expr ctx true t;
+		write ctx (HOp A3OIs)
 	| TLocal { v_name = "__as__" }, [e;t] ->
 		gen_expr ctx true e;
 		gen_expr ctx true t;