Browse Source

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

Nicolas Cannasse 12 years ago
parent
commit
68c66e4ebd
1 changed files with 5 additions and 0 deletions
  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;