9749e6bd54
Sets up the translator analyze pass to create a Tracelet for the callee at every statically-known FCall. If the callee has an appropriate shape (in this diff, it must be a function consisting of "return $this->foo" for a declared property), we can inline it in HHIR. Restructures the IR relating to frames some so we can eliminate the stores relating to ActRec in this simple case (see the comments in dce.cpp and hhbctranslator.cpp for details). Includes partial support for inlining callees with locals, but it's disabled for now because they will keep the frame live.
32 linhas
543 B
PHP
32 linhas
543 B
PHP
<?php
|
|
|
|
class NonExistProp {
|
|
private $x;
|
|
public function __construct() { $x = "str"; }
|
|
public function unsetIt() {
|
|
unset($this->x);
|
|
}
|
|
public function getX() {
|
|
return $this->x;
|
|
}
|
|
}
|
|
|
|
// TODO: this will need a hopt to enable throw
|
|
function thrower() {
|
|
//var_dump(debug_backtrace());
|
|
throw new Exception("Yo");
|
|
}
|
|
|
|
function test7() {
|
|
set_error_handler('thrower');
|
|
try {
|
|
$obj = new NonExistProp();
|
|
$obj->unsetIt();
|
|
$k = new Dtor();
|
|
echo $obj->getX();
|
|
echo "\n";
|
|
} catch (Exception $x) {}
|
|
}
|
|
|
|
test7();
|