Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/bootstrap-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ These `LogicException` messages indicate CFG ops or expressions not yet lowered:
| `lib/JIT/NullsafeHelper.php` | 0 | 1 |
| `lib/JIT/OperandName.php` | 0 | 1 |
| `lib/JIT/Result.php` | 0 | 3 |
| `lib/JIT/ScopeBuiltinHelper.php` | 0 | 1 |
| `lib/JIT/StringOffsetHelper.php` | 0 | 1 |
| `lib/JIT/SuperglobalInit.php` | 0 | 3 |
| `lib/JIT/ValueEchoHelper.php` | 0 | 1 |
Expand Down Expand Up @@ -1959,6 +1960,11 @@ These `LogicException` messages indicate CFG ops or expressions not yet lowered:
- new Func\JIT (line 49)
- 4 class method(s) — PHPCfg Op\Stmt\ClassMethod not lowered in Compiler

### `lib/JIT/ScopeBuiltinHelper.php`

**Warnings** (review for bootstrap subset):
- 8 class method(s) — PHPCfg Op\Stmt\ClassMethod not lowered in Compiler

### `lib/JIT/StringOffsetHelper.php`

**Warnings** (review for bootstrap subset):
Expand Down
1 change: 1 addition & 0 deletions docs/bootstrap-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@
"lib/JIT/OperandName.php",
"lib/JIT/Result.php",
"lib/JIT/Scope.php",
"lib/JIT/ScopeBuiltinHelper.php",
"lib/JIT/StringOffsetHelper.php",
"lib/JIT/SuperglobalInit.php",
"lib/JIT/ValueEchoHelper.php",
Expand Down
4 changes: 2 additions & 2 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Auto-generated by `script/capability-matrix.php`. Do not edit by hand.
| `boolval` | yes | yes | yes | standard | AOT PHPT |
| `ceil` | yes | yes | yes | standard | |
| `chr` | yes | yes | yes | standard | |
| `compact` | yes | no | no | standard | not implemented for JIT in this compiler build |
| `compact` | yes | yes | yes | standard | |
| `cos` | yes | yes | yes | standard | |
| `count` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
| `date` | yes | yes | yes | standard | |
Expand All @@ -40,7 +40,7 @@ Auto-generated by `script/capability-matrix.php`. Do not edit by hand.
| `dirname` | yes | yes | yes | standard | AOT PHPT |
| `exp` | yes | yes | yes | standard | |
| `explode` | yes | yes | yes | standard | doc: VM only; JIT PHPT; AOT PHPT |
| `extract` | yes | no | no | standard | not implemented for JIT in this compiler build |
| `extract` | yes | yes | yes | standard | |
| `fclose` | yes | no | no | standard | doc: VM only; not implemented for JIT in this compiler build |
| `file_exists` | yes | yes | yes | standard | JIT PHPT |
| `file_get_contents` | yes | yes | yes | standard | JIT PHPT; AOT PHPT |
Expand Down
7 changes: 6 additions & 1 deletion ext/standard/compact_.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPCompiler\Frame;
use PHPCompiler\Func\Internal;
use PHPCompiler\JIT\Context;
use PHPCompiler\JIT\ScopeBuiltinHelper;
use PHPCompiler\JIT\Variable as JITVariable;
use PHPLLVM\Value;

Expand All @@ -33,6 +34,10 @@ public function execute(Frame $frame): void

public function call(Context $context, JITVariable ...$args): Value
{
throw new \LogicException('compact() is not implemented for JIT in this compiler build');
if (0 === \count($args)) {
throw new \LogicException('compact() requires at least one argument in this compiler build');
}

return ScopeBuiltinHelper::compact($context, ...$args);
}
}
9 changes: 7 additions & 2 deletions ext/standard/extract_.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use PHPCompiler\Frame;
use PHPCompiler\Func\Internal;
use PHPCompiler\JIT\Context;
use PHPCompiler\JIT\ScopeBuiltinHelper;
use PHPCompiler\JIT\Variable as JITVariable;
use PHPLLVM\Value;

Expand All @@ -28,7 +29,11 @@ public function execute(Frame $frame): void

public function call(Context $context, JITVariable ...$args): Value
{
// LLVM scope import for dynamic string keys is tracked in issue #275 (VM path is complete).
throw new \LogicException('extract() is not implemented for JIT in this compiler build');
if (\count($args) < 1 || \count($args) > 2) {
throw new \LogicException('extract() requires one or two arguments in this compiler build');
}
$flags = 2 === \count($args) ? $args[1] : null;

return ScopeBuiltinHelper::extract($context, $args[0], $flags);
}
}
Loading