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
9 changes: 4 additions & 5 deletions dev/cpan-reports/cpan-compatibility-fail.dat
Original file line number Diff line number Diff line change
Expand Up @@ -2261,7 +2261,7 @@ ExtUtils::F77 FAIL 3 1 2/3 subtests failed; 1/1 test programs failed 2026-06-11
ExtUtils::H2PM FAIL 16 8 8/16 subtests failed 2026-05-10
ExtUtils::LibBuilder FAIL 3 0 7/3 subtests failed 2026-05-12
ExtUtils::MM_Unix FAIL 1079 976 103/1079 subtests failed; 20/69 test programs failed 2026-06-11
ExtUtils::MakeMaker FAIL 1257 1118 139/1257 subtests failed; 15/69 test programs failed 2026-06-11
ExtUtils::MakeMaker FAIL 1257 1118 139/1257 subtests failed; 15/69 test programs failed 2026-06-11
ExtUtils::MakeMaker::Attributes FAIL 8 8 2026-05-10
ExtUtils::MakeMaker::PPPort FAIL 3 0 3/3 subtests failed 2026-05-17
ExtUtils::ModuleMaker::TT FAIL 12 0 169/12 subtests failed 2026-05-14
Expand Down Expand Up @@ -2367,7 +2367,7 @@ File::PathConvert FAIL 266 264 2/266 subtests failed 2026-04-12
File::PathInfo FAIL 57 57 Missing: Time/Format.pm 2026-05-19
File::PathInfo::Ext FAIL 1 1 2026-05-19
File::Raw FAIL 1 0 1/1 subtests failed 2026-05-11
File::Remove FAIL 218 215 3/218 subtests failed; 2/11 test programs failed 2026-06-10
File::Remove FAIL 218 215 3/218 subtests failed; 2/11 test programs failed 2026-06-11
File::RotateLogs FAIL 1 0 1/1 subtests failed 2026-05-12
File::Rules FAIL 3 0 14/3 subtests failed 2026-04-22
File::Save::Home FAIL 16 0 44/16 subtests failed 2026-04-30
Expand Down Expand Up @@ -3010,7 +3010,7 @@ HTTunnel::Client FAIL Missing: Apache/Test.pm 2026-05-15
Haineko FAIL 1002 1002 Missing: JSON/Syck.pm 2026-05-11
Hardware FAIL Missing: Object/Pad.pm 2026-05-17
Hash::AsObject FAIL 93 93 Missing: diagnostics.pm 2026-04-12
Hash::FieldHash FAIL 132 101 31/132 subtests failed; 14/18 test programs failed 2026-06-11
Hash::FieldHash FAIL 132 101 31/132 subtests failed; 14/18 test programs failed 2026-06-11
Hash::Inflator FAIL 8 7 1/8 subtests failed 2026-05-20
Hash::Merge FAIL 1 0 1/1 subtests failed 2026-05-20
Hash::NoVivify FAIL 2026-05-16
Expand Down Expand Up @@ -3800,7 +3800,7 @@ Module::MultiConf FAIL 18 0 20/18 subtests failed 2026-05-10
Module::Path FAIL 18 11 7/18 subtests failed 2026-04-22
Module::Pluggable::Object FAIL 192 191 1/192 subtests failed; 1/45 test programs failed 2026-06-11
Module::Refresh FAIL 16 14 2/16 subtests failed 2026-05-17
Module::ScanDeps FAIL 161 156 5/161 subtests failed; 3/21 test programs failed 2026-06-03
Module::ScanDeps FAIL 161 156 5/161 subtests failed; 3/21 test programs failed 2026-06-11
Module::ScanDeps::Static FAIL 2026-04-21
Module::Setup FAIL 1 0 1/1 subtests failed 2026-05-18
Module::Signature FAIL 2 2 Missing: IPC/Run.pm 2026-04-12
Expand Down Expand Up @@ -4213,7 +4213,6 @@ Noose FAIL 19 9 10/19 subtests failed 2026-05-11
Norma FAIL 12 12 Missing: Norma/ORM/Test/DB.pm 2026-05-12
Notifications FAIL 17 0 18/17 subtests failed 2026-05-15
NpsSDK::Configuration FAIL Unknown test outcome 2026-05-17
Number::Format FAIL 10 10 2026-04-22
Number::FormatEng FAIL 140 139 1/140 subtests failed 2026-05-05
Number::Phone FAIL 1373 1335 38/1373 subtests failed 2026-05-12
Number::Phone::JP FAIL 199 0 66169/199 subtests failed 2026-05-12
Expand Down
10 changes: 7 additions & 3 deletions dev/cpan-reports/cpan-compatibility-pass.dat
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ HTTP::ClickHouse::Base PASS 7 7 2026-05-16 75a25eb21
HTTP::ClientDetect::Language PASS 79 79 2026-05-18 bd327bb57
HTTP::Cookies PASS 122 122 2026-06-11 959012866
HTTP::Cookies::ChromeMacOS PASS 1 1 2026-05-18 b5536d190
HTTP::Cookies::Guess PASS 5 5 2026-05-18 bd327bb57
HTTP::Cookies::Guess PASS 5 5 2026-06-11 bd9132057
HTTP::Cookies::PhantomJS PASS 1490 1490 2026-05-16 d8a8a9f34
HTTP::Cookies::w3m PASS 3 3 2026-05-09 d7916b01c
HTTP::DetectUserAgent PASS 152 152 2026-05-17 bd327bb57
Expand Down Expand Up @@ -1360,6 +1360,7 @@ IM::Engine::Incoming::IRC PASS 4 4 2026-05-16 d8a8a9f34
IM::Engine::Plugin::State PASS 12 12 2026-05-16 75a25eb21
IMDB::BaseClass PASS 2 2 2026-05-11 2b8886eec
IMDB::TitlePage::Extract PASS 1 1 2026-05-12 93dfa497b
IO::All PASS 368 368 2026-06-11 bd9132057
IO::All::FTP PASS 8 8 2026-05-17 d8a8a9f34
IO::Async PASS 1134 1134 2026-05-12 b5c01ce1c
IO::Async::Loop PASS 1134 1134 2026-05-11 b5c01ce1c
Expand Down Expand Up @@ -1588,6 +1589,7 @@ LocalConf::Parser PASS 1 1 2026-05-13 3fe76ed3b
Locale::BR PASS 2879 2879 2026-05-14 3fe76ed3b
Locale::Currency::Format PASS 28 28 2026-05-19 b5536d190
Locale::Framework PASS 5 5 2026-05-12 b5c01ce1c
Locale::Maketext PASS 180 180 2026-06-11 bd9132057
Locale::SubCountry PASS 15 15 2026-05-17 d8a8a9f34
Locale::TextDomain::UTF8 PASS 1 1 2026-05-18 bd327bb57
Locale::Tie PASS 1 1 2026-05-18 bd327bb57
Expand Down Expand Up @@ -1741,6 +1743,7 @@ Module::CoreList PASS 102 102 2026-05-20 b5536d190
Module::Depends PASS 20 20 2026-05-10 1e95a0902
Module::Depends::Intrusive PASS 20 20 2026-05-13 3fe76ed3b
Module::Faker::Dist PASS 34 34 2026-05-19 b5536d190
Module::Install PASS 547 547 2026-06-11 bd9132057
Module::Install::AutoManifest PASS 1 1 2026-05-09 d7916b01c
Module::Install::RTx PASS 1 1 2026-05-09 d7916b01c
Module::Install::Repository PASS 1 1 2026-05-18 bd327bb57
Expand Down Expand Up @@ -1856,7 +1859,7 @@ MooseX::Meta::Method::Transactional PASS 17 17 2026-05-11 2b8886eec
MooseX::Meta::TypeConstraint::Mooish PASS 42 42 2026-05-18 b5536d190
MooseX::MungeHas PASS 45 45 2026-05-12 b5c01ce1c
MooseX::NestedAttributesConstructor PASS 2 2 2026-05-10 1e95a0902
MooseX::NonMoose PASS 177 177 2026-06-03 d0f827461
MooseX::NonMoose PASS 177 177 2026-06-11 bd9132057
MooseX::NotRequired PASS 22 22 2026-05-18 bd327bb57
MooseX::OneArgNew PASS 20 20 2026-05-16 d8a8a9f34
MooseX::POE PASS 249 249 2026-05-12 312b4f902
Expand Down Expand Up @@ -1994,6 +1997,7 @@ Netconf PASS 1 1 2026-05-16 75a25eb21
Nullius PASS 25 25 2026-05-17 bd327bb57
Number::Bytes::Human PASS 223 223 2026-05-11 1e95a0902
Number::Compare PASS 24 24 2026-06-10 959012866
Number::Format PASS 171 171 2026-06-11 bd9132057
Number::Format::Metric PASS 2 2 2026-05-08 24f4fb162
Number::Phone::Normalize PASS 126 126 2026-05-12 b5c01ce1c
NumericCodes PASS 9 9 2026-05-18 bd327bb57
Expand Down Expand Up @@ -2628,7 +2632,7 @@ Template::Plugin::Class PASS 2 2 2026-04-21 73edc8aba
Template::Plugin::Comma PASS 28 28 2026-05-11 b5c01ce1c
Template::Plugin::HTML::SuperForm PASS 1 1 2026-05-12 312b4f902
Template::Plugin::JSON::Escape PASS 14 14 2026-05-15 3fe76ed3b
Template::Plugin::Number::Format PASS 29 29 2026-05-11 b5c01ce1c
Template::Plugin::Number::Format PASS 29 29 2026-06-11 bd9132057
Template::Plugin::Page PASS 51 51 2026-05-16 75a25eb21
Template::Plugin::VMethods PASS 12 12 2026-05-16 75a25eb21
Template::Provider::Encoding PASS 30 30 2026-05-16 75a25eb21
Expand Down
2 changes: 1 addition & 1 deletion dev/cpan-reports/cpan-compatibility-skip.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CGI SKIP 2026-06-11 distroprefs
CGI::Cookie SKIP 2026-06-10 distroprefs
CGI::Simple SKIP 2026-06-11 distroprefs
CGI::Simple::Cookie SKIP 2026-06-10 distroprefs
Class::Load::XS SKIP 2026-06-11 bundled
Class::Load::XS SKIP 2026-06-11 bundled
Cwd SKIP 2026-06-11 bundled
Digest::MD2 SKIP 2026-06-09 bundled
File::Slurp SKIP 2026-06-11 distroprefs
Expand Down
25 changes: 14 additions & 11 deletions dev/cpan-reports/cpan-compatibility.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CPAN Module Compatibility Report for PerlOnJava

> Auto-generated by `dev/tools/cpan_random_tester.pl` on 2026-06-11 11:59:26
> Auto-generated by `dev/tools/cpan_random_tester.pl` on 2026-06-11 16:58:21
>
> Modules are randomly selected from the full CPAN index and tested
> with `./jcpan -t`. Dependencies are tested too; every module that
Expand All @@ -10,9 +10,9 @@

| Metric | Count |
|--------|-------|
| **Modules Tested** | 10345 |
| **Pass** | 3342 (32.3%) |
| **Fail** | 6973 |
| **Modules Tested** | 10348 |
| **Pass** | 3346 (32.3%) |
| **Fail** | 6972 |
| **Skipped** | 30 |

## Modules That Pass All Tests
Expand Down Expand Up @@ -1288,7 +1288,7 @@
| HTTP::ClientDetect::Language | 79 | 2026-05-18 | bd327bb57 |
| HTTP::Cookies | 122 | 2026-06-11 | 959012866 |
| HTTP::Cookies::ChromeMacOS | 1 | 2026-05-18 | b5536d190 |
| HTTP::Cookies::Guess | 5 | 2026-05-18 | bd327bb57 |
| HTTP::Cookies::Guess | 5 | 2026-06-11 | bd9132057 |
| HTTP::Cookies::PhantomJS | 1490 | 2026-05-16 | d8a8a9f34 |
| HTTP::Cookies::w3m | 3 | 2026-05-09 | d7916b01c |
| HTTP::DetectUserAgent | 152 | 2026-05-17 | bd327bb57 |
Expand Down Expand Up @@ -1381,6 +1381,7 @@
| IM::Engine::Plugin::State | 12 | 2026-05-16 | 75a25eb21 |
| IMDB::BaseClass | 2 | 2026-05-11 | 2b8886eec |
| IMDB::TitlePage::Extract | 1 | 2026-05-12 | 93dfa497b |
| IO::All | 368 | 2026-06-11 | bd9132057 |
| IO::All::FTP | 8 | 2026-05-17 | d8a8a9f34 |
| IO::Async | 1134 | 2026-05-12 | b5c01ce1c |
| IO::Async::Loop | 1134 | 2026-05-11 | b5c01ce1c |
Expand Down Expand Up @@ -1609,6 +1610,7 @@
| Locale::BR | 2879 | 2026-05-14 | 3fe76ed3b |
| Locale::Currency::Format | 28 | 2026-05-19 | b5536d190 |
| Locale::Framework | 5 | 2026-05-12 | b5c01ce1c |
| Locale::Maketext | 180 | 2026-06-11 | bd9132057 |
| Locale::SubCountry | 15 | 2026-05-17 | d8a8a9f34 |
| Locale::TextDomain::UTF8 | 1 | 2026-05-18 | bd327bb57 |
| Locale::Tie | 1 | 2026-05-18 | bd327bb57 |
Expand Down Expand Up @@ -1762,6 +1764,7 @@
| Module::Depends | 20 | 2026-05-10 | 1e95a0902 |
| Module::Depends::Intrusive | 20 | 2026-05-13 | 3fe76ed3b |
| Module::Faker::Dist | 34 | 2026-05-19 | b5536d190 |
| Module::Install | 547 | 2026-06-11 | bd9132057 |
| Module::Install::AutoManifest | 1 | 2026-05-09 | d7916b01c |
| Module::Install::RTx | 1 | 2026-05-09 | d7916b01c |
| Module::Install::Repository | 1 | 2026-05-18 | bd327bb57 |
Expand Down Expand Up @@ -1877,7 +1880,7 @@
| MooseX::Meta::TypeConstraint::Mooish | 42 | 2026-05-18 | b5536d190 |
| MooseX::MungeHas | 45 | 2026-05-12 | b5c01ce1c |
| MooseX::NestedAttributesConstructor | 2 | 2026-05-10 | 1e95a0902 |
| MooseX::NonMoose | 177 | 2026-06-03 | d0f827461 |
| MooseX::NonMoose | 177 | 2026-06-11 | bd9132057 |
| MooseX::NotRequired | 22 | 2026-05-18 | bd327bb57 |
| MooseX::OneArgNew | 20 | 2026-05-16 | d8a8a9f34 |
| MooseX::POE | 249 | 2026-05-12 | 312b4f902 |
Expand Down Expand Up @@ -2015,6 +2018,7 @@
| Nullius | 25 | 2026-05-17 | bd327bb57 |
| Number::Bytes::Human | 223 | 2026-05-11 | 1e95a0902 |
| Number::Compare | 24 | 2026-06-10 | 959012866 |
| Number::Format | 171 | 2026-06-11 | bd9132057 |
| Number::Format::Metric | 2 | 2026-05-08 | 24f4fb162 |
| Number::Phone::Normalize | 126 | 2026-05-12 | b5c01ce1c |
| NumericCodes | 9 | 2026-05-18 | bd327bb57 |
Expand Down Expand Up @@ -2649,7 +2653,7 @@
| Template::Plugin::Comma | 28 | 2026-05-11 | b5c01ce1c |
| Template::Plugin::HTML::SuperForm | 1 | 2026-05-12 | 312b4f902 |
| Template::Plugin::JSON::Escape | 14 | 2026-05-15 | 3fe76ed3b |
| Template::Plugin::Number::Format | 29 | 2026-05-11 | b5c01ce1c |
| Template::Plugin::Number::Format | 29 | 2026-06-11 | bd9132057 |
| Template::Plugin::Page | 51 | 2026-05-16 | 75a25eb21 |
| Template::Plugin::VMethods | 12 | 2026-05-16 | 75a25eb21 |
| Template::Provider::Encoding | 30 | 2026-05-16 | 75a25eb21 |
Expand Down Expand Up @@ -5955,7 +5959,7 @@
| YAMLTest | 1/1 | Syntax error | 2026-05-10 |
| constant::lexical | | Syntax error | 2026-05-17 |

### Test Failures (4343 modules)
### Test Failures (4342 modules)

| Module | Pass/Total | Error | Date |
|--------|-----------|-------|------|
Expand Down Expand Up @@ -7385,7 +7389,7 @@
| File::PathConvert | 264/266 | 2/266 subtests failed | 2026-04-12 |
| File::PathInfo::Ext | 1/1 | | 2026-05-19 |
| File::Raw | 0/1 | 1/1 subtests failed | 2026-05-11 |
| File::Remove | 215/218 | 3/218 subtests failed; 2/11 test programs failed | 2026-06-10 |
| File::Remove | 215/218 | 3/218 subtests failed; 2/11 test programs failed | 2026-06-11 |
| File::RotateLogs | 0/1 | 1/1 subtests failed | 2026-05-12 |
| File::Rules | 0/3 | 14/3 subtests failed | 2026-04-22 |
| File::Save::Home | 0/16 | 44/16 subtests failed | 2026-04-30 |
Expand Down Expand Up @@ -8302,7 +8306,7 @@
| Module::Path | 11/18 | 7/18 subtests failed | 2026-04-22 |
| Module::Pluggable::Object | 191/192 | 1/192 subtests failed; 1/45 test programs failed | 2026-06-11 |
| Module::Refresh | 14/16 | 2/16 subtests failed | 2026-05-17 |
| Module::ScanDeps | 156/161 | 5/161 subtests failed; 3/21 test programs failed | 2026-06-03 |
| Module::ScanDeps | 156/161 | 5/161 subtests failed; 3/21 test programs failed | 2026-06-11 |
| Module::Setup | 0/1 | 1/1 subtests failed | 2026-05-18 |
| Module::Spy | 2/4 | 2/4 subtests failed | 2026-05-19 |
| Module::Starter | 30/33 | 3/33 subtests failed | 2026-05-18 |
Expand Down Expand Up @@ -8585,7 +8589,6 @@
| Nodejs::Util | 1/2 | 1/2 subtests failed | 2026-05-08 |
| Noose | 9/19 | 10/19 subtests failed | 2026-05-11 |
| Notifications | 0/17 | 18/17 subtests failed | 2026-05-15 |
| Number::Format | 10/10 | | 2026-04-22 |
| Number::FormatEng | 139/140 | 1/140 subtests failed | 2026-05-05 |
| Number::Phone | 1335/1373 | 38/1373 subtests failed | 2026-05-12 |
| Number::Phone::JP | 0/199 | 66169/199 subtests failed | 2026-05-12 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,10 @@ public void visit(IdentifierNode node) {
// Barewords ending with :: are package name constants, always allowed
// e.g., Tie::RefHash:: is equivalent to "Tie::RefHash"
if (varName.endsWith("::")) {
if (currentCallContext == RuntimeContextType.VOID) {
lastResultReg = -1;
return;
}
String packageName = varName.substring(0, varName.length() - 2);
int rd = allocateOutputRegister();
emit(Opcodes.LOAD_STRING);
Expand All @@ -1633,6 +1637,10 @@ public void visit(IdentifierNode node) {
}
String normalizedBarewordName = NameNormalizer.normalizeVariableName(varName, getCurrentPackage());
if (GlobalVariable.hasGlobalPseudoConstant(normalizedBarewordName)) {
if (currentCallContext == RuntimeContextType.VOID) {
lastResultReg = -1;
return;
}
int rd = allocateOutputRegister();
int nameIdx = addToStringPool(normalizedBarewordName);
emit(Opcodes.LOAD_GLOBAL_SCALAR);
Expand All @@ -1645,6 +1653,10 @@ public void visit(IdentifierNode node) {
if (getEffectiveSymbolTable().isStrictOptionEnabled(Strict.HINT_STRICT_SUBS)) {
throwCompilerException("Bareword \"" + varName + "\" not allowed while \"strict subs\" in use");
}
if (currentCallContext == RuntimeContextType.VOID) {
lastResultReg = -1;
return;
}
// Not strict - treat bareword as string literal
int rd = allocateOutputRegister();
emit(Opcodes.LOAD_STRING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,14 @@ public static RuntimeList execute(InterpretedCode code, RuntimeArray args, int c
}
}

case Opcodes.RETURN_SCOPE_CLEANUP -> {
int reg = bytecode[pc++];
RuntimeBase slot = registers[reg];
if (slot instanceof RuntimeScalar rs) {
MortalList.deferDecrementIfNotCaptured(rs);
}
}

case Opcodes.SCOPE_EXIT_CLEANUP_HASH -> {
// Scope-exit cleanup for a my-hash register.
//
Expand Down Expand Up @@ -422,6 +430,14 @@ public static RuntimeList execute(InterpretedCode code, RuntimeArray args, int c
}
}

case Opcodes.RETURN_SCOPE_CLEANUP_HASH -> {
int reg = bytecode[pc++];
RuntimeBase slot = registers[reg];
if (slot instanceof RuntimeHash rh) {
MortalList.scopeExitCleanupHash(rh);
}
}

case Opcodes.SCOPE_EXIT_CLEANUP_ARRAY -> {
// Scope-exit cleanup for a my-array register.
//
Expand Down Expand Up @@ -459,6 +475,14 @@ public static RuntimeList execute(InterpretedCode code, RuntimeArray args, int c
}
}

case Opcodes.RETURN_SCOPE_CLEANUP_ARRAY -> {
int reg = bytecode[pc++];
RuntimeBase slot = registers[reg];
if (slot instanceof RuntimeArray ra) {
MortalList.scopeExitCleanupArray(ra);
}
}

case Opcodes.RETURN -> {
// Return from subroutine: return rd
int retReg = bytecode[pc++];
Expand Down
17 changes: 6 additions & 11 deletions src/main/java/org/perlonjava/backend/bytecode/CompileOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1047,27 +1047,22 @@ public static void visitOperator(BytecodeCompiler bytecodeCompiler, OperatorNode
break;
}

// Emit scope exit cleanup for all my-scalars, my-hashes, and my-arrays
// in the subroutine scope (scope 0). Explicit 'return' bypasses the
// normal scope exit cleanup at block end, so we must do it here.
// Skip the exprReg (return value register) — SCOPE_EXIT_CLEANUP nulls
// the register, which would destroy the return value if it's a my-variable.
// Explicit 'return' bypasses the normal block-end cleanup.
// Use return-specific cleanup opcodes so the returned register remains
// readable by RETURN while lexical owner counts are still released.
java.util.List<Integer> scalarIdxs = bytecodeCompiler.symbolTable.getMyScalarIndicesInScope(0);
for (int idx : scalarIdxs) {
if (idx == exprReg) continue;
bytecodeCompiler.emit(Opcodes.SCOPE_EXIT_CLEANUP);
bytecodeCompiler.emit(Opcodes.RETURN_SCOPE_CLEANUP);
bytecodeCompiler.emitReg(idx);
}
java.util.List<Integer> hashIdxs = bytecodeCompiler.symbolTable.getMyHashIndicesInScope(0);
for (int idx : hashIdxs) {
if (idx == exprReg) continue;
bytecodeCompiler.emit(Opcodes.SCOPE_EXIT_CLEANUP_HASH);
bytecodeCompiler.emit(Opcodes.RETURN_SCOPE_CLEANUP_HASH);
bytecodeCompiler.emitReg(idx);
}
java.util.List<Integer> arrayIdxs = bytecodeCompiler.symbolTable.getMyArrayIndicesInScope(0);
for (int idx : arrayIdxs) {
if (idx == exprReg) continue;
bytecodeCompiler.emit(Opcodes.SCOPE_EXIT_CLEANUP_ARRAY);
bytecodeCompiler.emit(Opcodes.RETURN_SCOPE_CLEANUP_ARRAY);
bytecodeCompiler.emitReg(idx);
}

Expand Down
Loading
Loading