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
17 changes: 10 additions & 7 deletions test/unit/ParseStrRuntimeShrinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,26 @@ public function testParseStrJitHelperDelegatesToParseStrEngine(): void
$this->assertStringContainsString('phpc_native_ht_set_string_key', $native);
$this->assertFileExists($this->repoRoot.'/lib/JIT/Builtin/ParseStrNativeOpsJit.php');

// User-script refresh routes via ParseStrNativeJitHelper PHP bridge (#14217).
// User-script refresh: init-safe delimited LLVM on libc C strings (#18832, #18841).
$userScript = (string) file_get_contents($this->repoRoot.'/lib/JIT/Builtin/SuperglobalRefreshUserScriptLlvm.php');
$this->assertStringContainsString('ParseStrRuntime::ensureUserScriptLinked', $userScript);
$this->assertStringContainsString('__compiler_parse_str', $userScript);
$this->assertStringContainsString('ParseStrUserScriptDelimitedJit::ensureSubhelpers', $userScript);
$this->assertStringContainsString('__phpc_parse_str_parse_delimited_pairs', $userScript);
$parseStrRuntime = (string) file_get_contents($this->repoRoot.'/lib/JIT/Builtin/ParseStrRuntime.php');
$this->assertStringContainsString('USER_SCRIPT_PARSE_INTO_NATIVE', $parseStrRuntime);
$this->assertStringContainsString('JitVmHelperLink::ensureCompiled', $parseStrRuntime);
$this->assertStringNotContainsString('ParseStrUserScriptDelimitedJit', $parseStrRuntime);
$this->assertFileDoesNotExist($this->repoRoot.'/lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php');
$this->assertFileExists($this->repoRoot.'/lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php');
$this->assertFileDoesNotExist($this->repoRoot.'/lib/JIT/Builtin/ParseStrNativeLlvm.php');
$this->assertFileExists($this->repoRoot.'/lib/JIT/Builtin/MultipartRuntime.php');
$this->assertFileDoesNotExist($this->repoRoot.'/lib/JIT/Builtin/StringMultipartStandaloneLlvm.php');
$this->assertFileExists($this->repoRoot.'/lib/Web/MultipartNativeJitHelper.php');
}

public function testParseStrUserScriptDelimitedJitDeleted(): void
public function testParseStrUserScriptDelimitedJitPresentForRefresh(): void
{
$this->assertFileDoesNotExist($this->repoRoot.'/lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php');
$source = (string) file_get_contents($this->repoRoot.'/lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php');
$this->assertStringContainsString('__phpc_parse_str_parse_delimited_pairs', $source);
$this->assertStringContainsString('ensureSubhelpers', $source);
}

public function testParseStrRuntimeRoutesUserScriptThroughNativeJitHelper(): void
Expand All @@ -86,8 +88,9 @@ public function testParseStrRuntimeRoutesUserScriptThroughNativeJitHelper(): voi
$this->assertStringContainsString('implementUserScriptParseBridge', $source);
$this->assertStringContainsString('USER_SCRIPT_PARSE_INTO_NATIVE', $source);
$this->assertStringContainsString('USER_SCRIPT_PARSE_COOKIE_INTO_NATIVE', $source);
$this->assertStringNotContainsString('ParseStrUserScriptDelimitedJit', $source);
$this->assertStringNotContainsString('emitUserScriptDelimitedParse', $source);
$delimited = (string) file_get_contents($this->repoRoot.'/lib/JIT/Builtin/ParseStrUserScriptDelimitedJit.php');
$this->assertStringContainsString('emitParseDelimitedPairs', $delimited);
}

public function testSpineBundleIncludesParseStrPhpJitPath(): void
Expand Down
5 changes: 2 additions & 3 deletions test/unit/SuperglobalRefreshRuntimeShrinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ public function testUserScriptRefreshRoutesThroughParseStrRuntimeBridge(): void
$this->assertStringContainsString('MultipartRuntime::ensureUserScriptLinked', $source);
$this->assertStringContainsString('EnvironMirrorUserScriptLlvm', $source);
$this->assertStringContainsString('ensurePrerequisites', $source);
$this->assertStringContainsString('__compiler_parse_str', $source);
$this->assertStringContainsString('__phpc_parse_str_parse_delimited_pairs', $source);
$this->assertStringContainsString('__compiler_multipart_populate_post_body', $source);
$this->assertStringContainsString('__compiler_parse_cookie_header', $source);
$this->assertStringContainsString('ParseStrUserScriptDelimitedJit::ensureSubhelpers', $source);
$this->assertStringNotContainsString('StringGetenvAll::ensureLinked', $source);
$this->assertStringNotContainsString('GetenvJitHelper::fillAllEnvironmentHashtable', $source);
$this->assertStringNotContainsString('ParseStrNativeLlvm::ensureSubhelpers', $source);
$this->assertStringContainsString('ParseStrUserScriptDelimitedJit::ensureSubhelpers', $source);
}
}