class_body
{ "{"
field_declaration
modifiers
private "private"
final "final"
type_identifier "AbstractCompiler"
variable_declarator
identifier "compiler"
; ";"
field_declaration
modifiers
private "private"
final "final"
generic_type
type_identifier "Supplier"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "safeNameIdSupplier"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "allowDecomposition"
; ";"
field_declaration
modifiers
private "private"
generic_type
type_identifier "Set"
type_arguments
< "<"
type_identifier "String"
> ">"
variable_declarator
identifier "knownConstants"
= "="
method_invocation
identifier "Sets"
. "."
identifier "newHashSet"
argument_list
( "("
) ")"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "assumeStrictThis"
; ";"
field_declaration
modifiers
private "private"
final "final"
boolean_type "boolean"
variable_declarator
identifier "assumeMinimumCapture"
; ";"
block_comment "/**\n * @param allowDecomposition Whether an effort should "...
constructor_declaration (+99 nodes collapsed)
block_comment "/** The type of inlining to perform. */"
enum_declaration
enum "enum"
identifier "InliningMode"
enum_body
{ "{"
block_comment "/**\n * Directly replace the call expression. Only functi"...
enum_constant
identifier "DIRECT"
, ","
block_comment "/**\n * Replaces the call expression with a block of stat"...
enum_constant
identifier "BLOCK"
} "}"
block_comment "/** Holds a reference to the call node of a function call */"
class_declaration (+75 nodes collapsed)
block_comment "/**\n * In order to estimate the cost of lining, we make th"...
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "NAME_COST_ESTIMATE"
= "="
field_access
identifier "InlineCostEstimator"
. "."
identifier "ESTIMATED_IDENTIFIER_COST"
; ";"
block_comment "/** The cost of a argument separator (a comma). */"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "COMMA_COST"
= "="
decimal_integer_literal "1"
; ";"
block_comment "/** The cost of the parentheses needed to make a call.*/"
field_declaration
modifiers
private "private"
static "static"
final "final"
integral_type
int "int"
variable_declarator
identifier "PAREN_COST"
= "="
decimal_integer_literal "2"
; ";"
block_comment "/**\n * @param fnName The name of this function. This eithe"...
method_declaration (+300 nodes collapsed)
block_comment "/**\n * @param t The traversal use to reach the call site."...
method_declaration (+213 nodes collapsed)
block_comment "/**\n * Only \".call\" calls and direct calls to functions ar"...
method_declaration (+135 nodes collapsed)
block_comment "/**\n * Inline a function into the call site.\n */"
method_declaration (+89 nodes collapsed)
block_comment "/**\n * Inline a function that fulfills the requirements of"...
method_declaration (+226 nodes collapsed)
block_comment "/**\n * Supported call site types.\n */"
enum_declaration (+340 nodes collapsed)
block_comment "/**\n * Determine which, if any, of the supported types the"...
method_declaration (+326 nodes collapsed)
method_declaration (+25 nodes collapsed)
block_comment "/**\n * If required, rewrite the statement containing the c"...
method_declaration (+36 nodes collapsed)
block_comment "/**\n * Inline a function which fulfills the requirements o"...
method_declaration (+458 nodes collapsed)
block_comment "/**\n * Checks if the given function matches the criteria f"...
method_declaration (+115 nodes collapsed)
enum_declaration
enum "enum"
identifier "CanInlineResult"
enum_body
{ "{"
enum_constant
identifier "YES"
, ","
enum_constant
identifier "AFTER_PREPARATION"
, ","
enum_constant
identifier "NO"
} "}"
block_comment "/**\n * Determines whether a function can be inlined at a p"...
method_declaration (+175 nodes collapsed)
block_comment "/**\n * Determines whether a function can be inlined at a p"...
method_declaration (+420 nodes collapsed)
block_comment "/**\n * Determines whether a function can be inlined at a p"...
method_declaration
modifiers
private "private"
type_identifier "CanInlineResult"
identifier "canInlineReferenceDirectly"
formal_parameters
( "("
formal_parameter
type_identifier "Node"
identifier "callNode"
, ","
formal_parameter
type_identifier "Node"
identifier "fnNode"
) ")"
block
{ "{"
if_statement (+23 nodes collapsed)
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "block"
= "="
method_invocation
identifier "fnNode"
. "."
identifier "getLastChild"
argument_list
( "("
) ")"
; ";"
line_comment "// CALL NODE: [ NAME, ARG1, ARG2, ... ]"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "cArg"
= "="
method_invocation
method_invocation
identifier "callNode"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
line_comment "// Functions called via 'call' and 'apply' have a this-objec"...
line_comment "// the first parameter, but this is not part of the called f"...
line_comment "// parameter list."
if_statement (+106 nodes collapsed)
line_comment "// FUNCTION NODE -> LP NODE: [ ARG1, ARG2, ... ]"
local_variable_declaration
type_identifier "Node"
variable_declarator
identifier "fnParam"
= "="
method_invocation
method_invocation
identifier "NodeUtil"
. "."
identifier "getFunctionParameters"
argument_list
( "("
identifier "fnNode"
) ")"
. "."
identifier "getFirstChild"
argument_list
( "("
) ")"
; ";"
while_statement
while "while"
parenthesized_expression
( "("
binary_expression
binary_expression
identifier "cArg"
!= "!="
null_literal "null"
|| "||"
binary_expression
identifier "fnParam"
!= "!="
null_literal "null"
) ")"
block
{ "{"
line_comment "// For each named parameter check if a mutable argument use "...
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "fnParam"
!= "!="
null_literal "null"
) ")"
block
{ "{"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "cArg"
!= "!="
null_literal "null"
) ")"
block
{ "{"
line_comment "// Check for arguments that are evaluated more than once."
line_comment "// Note: Unlike block inlining, there it is not possible tha"...
line_comment "// parameter reference will be in a loop."
if_statement (+46 nodes collapsed)
} "}"
line_comment "// Move to the next name."
expression_statement
assignment_expression
identifier "fnParam"
= "="
method_invocation
identifier "fnParam"
. "."
identifier "getNext"
argument_list
( "("
) ")"
; ";"
} "}"
line_comment "// For every call argument check for side-effects, even if t"...
line_comment "// isn't a named parameter to match."
if_statement (+49 nodes collapsed)
} "}"
return_statement
return "return"
field_access
identifier "CanInlineResult"
. "."
identifier "YES"
; ";"
} "}"
block_comment "/**\n * Determine if inlining the function is likely to red"...
method_declaration (+338 nodes collapsed)
block_comment "/**\n * @return Whether inlining will lower cost.\n */"
method_declaration (+170 nodes collapsed)
block_comment "/**\n * Gets an estimate of the cost in characters of makin"...
method_declaration (+125 nodes collapsed)
block_comment "/**\n * @return The difference between the function definit"...
method_declaration (+343 nodes collapsed)
block_comment "/**\n * Store the names of known constants to be used when "...
method_declaration (+49 nodes collapsed)
} "}"