PHP 클래스 Zephir\Passes\LocalContextPass

This pass tries to check whether variables only do exist in the local context of the method block or if they're used externally which will unallow variables to be placed in the stack This pass also tracks the number of initializations a variable may have, this allows to mark variables as read-only after their last initialization. The number of mutations is relative, since assignments inside cycles/loops may perform a n-number of mutations
파일 보기 프로젝트 열기: phalcon/zephir 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$lastCallLine
$lastUnsetLine
$mutations
$uses
$variables

공개 메소드들

메소드 설명
declareVariables ( array $statement )
getLastCallLine ( ) : integer Returns the line where the latest call in the method was made
getLastUnsetLine ( ) : integer Returns the line where the latest unset operation was made
getLastVariableUseLine ( string $variable ) : integer Returns the latest line where a variable was read
getNumberOfMutations ( string $variable ) : integer Returns the number of assignment instructions that mutated a variable
increaseMutations ( string $variable ) Increase the number of mutations a variable has inside a statement block
markLastUse ( string $variable, array $node ) Marks the latest use/read of a variable
markVariableNoLocal ( string $variable ) Marks a variable to mandatory be stored in the heap
pass ( Zephir\StatementsBlock $block ) Do the compilation pass
passArray ( array $expression )
passCall ( array $expression )
passExpression ( array $expression )
passLetStatement ( array $statement )
passNew ( array $expression )
passStatementBlock ( array $statements )
shouldBeLocal ( string $variable ) : boolean Asks the local context information whether a variable can be stored in the stack instead of the heap

메소드 상세

declareVariables() 공개 메소드

public declareVariables ( array $statement )
$statement array

getLastCallLine() 공개 메소드

Returns the line where the latest call in the method was made
public getLastCallLine ( ) : integer
리턴 integer

getLastUnsetLine() 공개 메소드

Returns the line where the latest unset operation was made
public getLastUnsetLine ( ) : integer
리턴 integer

getLastVariableUseLine() 공개 메소드

Returns the latest line where a variable was read
public getLastVariableUseLine ( string $variable ) : integer
$variable string
리턴 integer

getNumberOfMutations() 공개 메소드

Returns the number of assignment instructions that mutated a variable
public getNumberOfMutations ( string $variable ) : integer
$variable string
리턴 integer

increaseMutations() 공개 메소드

Increase the number of mutations a variable has inside a statement block
public increaseMutations ( string $variable )
$variable string

markLastUse() 공개 메소드

Marks the latest use/read of a variable
public markLastUse ( string $variable, array $node )
$variable string
$node array

markVariableNoLocal() 공개 메소드

Marks a variable to mandatory be stored in the heap
public markVariableNoLocal ( string $variable )
$variable string

pass() 공개 메소드

Do the compilation pass
public pass ( Zephir\StatementsBlock $block )
$block Zephir\StatementsBlock

passArray() 공개 메소드

public passArray ( array $expression )
$expression array

passCall() 공개 메소드

public passCall ( array $expression )
$expression array

passExpression() 공개 메소드

public passExpression ( array $expression )
$expression array

passLetStatement() 공개 메소드

public passLetStatement ( array $statement )
$statement array

passNew() 공개 메소드

public passNew ( array $expression )
$expression array

passStatementBlock() 공개 메소드

public passStatementBlock ( array $statements )
$statements array

shouldBeLocal() 공개 메소드

Asks the local context information whether a variable can be stored in the stack instead of the heap
public shouldBeLocal ( string $variable ) : boolean
$variable string
리턴 boolean

프로퍼티 상세

$lastCallLine 보호되어 있는 프로퍼티

protected $lastCallLine

$lastUnsetLine 보호되어 있는 프로퍼티

protected $lastUnsetLine

$mutations 보호되어 있는 프로퍼티

protected $mutations

$uses 보호되어 있는 프로퍼티

protected $uses

$variables 보호되어 있는 프로퍼티

protected $variables