forked from ircmaxell/php-compiler
-
Notifications
You must be signed in to change notification settings - Fork 1
Language: JIT support for non-void function return types #55
Copy link
Copy link
Closed
Labels
area:compilerCompiler / CFG / JITCompiler / CFG / JITenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language featuresPhase 2 – language features
Description
Activity
Metadata
Metadata
Assignees
Labels
area:compilerCompiler / CFG / JITCompiler / CFG / JITenhancementNew feature or requestNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimSpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language featuresPhase 2 – language features
Category
languageProblem
User-defined functions with non-void return types (
: string,: ?int, etc.) must compile in JIT and AOT, not only VM.docs/capabilities-syntax.mdstill lists Method return types: JIT = no (#55).MiniWebApp Router helpers, template functions, and self-host
lib/code rely on typed returns:php-src reference
Zend/zend_compile.c—zend_compile_return, return type enforcementZend/zend_execute.c—ZEND_RETURN,ZEND_RETURN_VALUEZend/zend_type.c— return type validationRepro (today)
Zend / VM target: prints
ok. JIT gap: confirm whetherbin/jit.phpprintsok, fatals, or segfaults; this issue closes when JIT + AOT match VM.AOT slice:
Scope (this repo)
lib/Compiler.phpTYPE_RETURNvalue operand for user functionslib/VM.phplib/JIT.php,lib/JIT.preOpCode::TYPE_RETURNLLVMretwith boxed__value__*per typelib/AOT/script/capability-syntax.phptest/compliance/cases/function_return_*.phptv1 types:
void,string,int,bool,float,array,?Tfor same. Defer:object, union/intersection returns.Done when
okfor: stringreturn (no LogicException / segfault)@group llvm) on return types abovedocs/capabilities-syntax.md— method return types JIT = yes (subset documented)examples/003-MiniWebAppJIT project gate unblocked where blocked only by returns (Testing: JIT smoke for phpc build --project on 003-MiniWebApp #587)Verification
Dependencies
Links