PHP Class Zephir\Cache\FunctionCache

Calls in Zephir implement monomorphic and polymorphic caches to improve performance. Method/Functions lookups are cached in a standard first-level method lookup cache. The concept of inline caching is based on the empirical observation that the objects that occur at a particular call site are often of the same type Internal functions are considered monomorphic since they do not change across execution. Final and private methods are also monomorphic because of their own nature. Due to the Ahead-Of-Time (AOT) compilation approach provided by Zephir, is not possible to implement inline caches, however is possible to add barriers/guards to take advantage of profile guided optimizations (PGO) and branch prediction. This implementation is based on the work of Hölzle, Chambers and Ungar [1]. [1] http://www.cs.ucsb.edu/~urs/oocsb/papers/ecoop91.pdf
Exibir arquivo Open project: phalcon/zephir

Protected Properties

Property Type Description
$cache
$gatherer

Public Methods

Method Description
__construct ( Zephir\Passes\CallGathererPass $gatherer = null ) FunctionCache constructor
get ( string $functionName, Zephir\CompilationContext $compilationContext, Call $call, boolean $exists ) : string Retrieves/Creates a function cache for a function call

Method Details

__construct() public method

FunctionCache constructor
public __construct ( Zephir\Passes\CallGathererPass $gatherer = null )
$gatherer Zephir\Passes\CallGathererPass

get() public method

Retrieves/Creates a function cache for a function call
public get ( string $functionName, Zephir\CompilationContext $compilationContext, Call $call, boolean $exists ) : string
$functionName string
$compilationContext Zephir\CompilationContext
$call Zephir\Call
$exists boolean
return string

Property Details

$cache protected_oe property

protected $cache

$gatherer protected_oe property

protected $gatherer