예제 #1
0
파일: hello-world.php 프로젝트: sskblr/hhvm
function hello()
{
    hh\asm('
    String "Hello World"
    RetC
  ');
}
예제 #2
0
파일: param.php 프로젝트: sskblr/hhvm
function my_is_int($x)
{
    hh\asm('
    IsTypeL $x Int
    RetC
  ');
}
예제 #3
0
파일: mixed.php 프로젝트: sskblr/hhvm
function f($x)
{
    $y = $x * 100;
    var_dump(hh\asm('
    CGetL $x
    CGetL $y
    Add
    SetL $z
    PopC
    # we dont leave anything on the eval stack,
    # so the emitter should push null
  '));
    return $z;
}
예제 #4
0
파일: if.php 프로젝트: sskblr/hhvm
function salut($hello)
{
    var_dump(hh\asm('
    CGetL $hello
    JmpZ goodbye
    String "Hello\\n"
    Jmp done
goodbye:
    String "Goodbye\\n"
done:
    Print
    PopC
    Int 42
  '));
}