Package com.google.javascript.jscomp
Class J2clPropertyInlinerPass
- java.lang.Object
-
- com.google.javascript.jscomp.J2clPropertyInlinerPass
-
- All Implemented Interfaces:
CompilerPass
public class J2clPropertyInlinerPass extends java.lang.Object implements CompilerPass
This pass targets J2CL output. It looks for static get and set methods defined within a class that match the signature of J2CL static fields and inlines them at their call sites. This is done for performance reasons since getter and setter accesses are slower than regular field accesses.This will be done by looking at all property accesses and determining if they have a corresponding get or set method on the property qualifiers definition. Some caveats:
- Avoid inlining if the property is set using compound assignments.
- Avoid inlining if the property is incremented using ++ or --
-
-
Constructor Summary
Constructors Constructor Description J2clPropertyInlinerPass(AbstractCompiler compiler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
process(Node externs, Node root)
Process the JS with root node root.
-
-
-
Constructor Detail
-
J2clPropertyInlinerPass
public J2clPropertyInlinerPass(AbstractCompiler compiler)
-
-
Method Detail
-
process
public void process(Node externs, Node root)
Description copied from interface:CompilerPass
Process the JS with root node root. Can modify the contents of each Node tree- Specified by:
process
in interfaceCompilerPass
- Parameters:
externs
- Top of external JS treeroot
- Top of JS tree
-
-