fix(joinir): Correct JsonShapeToMap function name and add Phase 33-5 test whitelist

Changes:
1. **Naming fix**: JsonShapeParser → JsonShapeToMap
   - Updated function name in whitelist to match actual static box name
   - Affected: JsonShapeToMap._read_value_from_pair/1 (lang/src/runtime/meta/json_shape_parser.hako)

2. **Phase 33-5 test whitelist**: Added Stage1JsonScannerTestBox.* pattern
   - Enables A/B testing for Stage-B if/else patterns
   - Test verified: Route A (if_phi) and Route B (Select) both RC=0 

Testing:
- Route A (NYASH_JOINIR_IF_SELECT=0): RC 0 ✓
- Route B (NYASH_JOINIR_IF_SELECT=1): RC 0 ✓
- Pattern: simple if/else return (Stage1JsonScannerBox.value_start_after_key_pos/2 style)

Phase 33-5: Stage-B if/Select A/B testing実施完了

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-11-27 05:39:29 +09:00
parent 4fd013d9c7
commit 2d30277e97

View File

@ -51,7 +51,7 @@ use crate::mir::{BasicBlockId, MirFunction};
/// Scope:
/// - Only applies to whitelisted functions:
/// - IfSelectTest.* (Phase 33-2/33-3)
/// - JsonShapeParser._read_value_from_pair/1 (Phase 33-4 Stage-1)
/// - JsonShapeToMap._read_value_from_pair/1 (Phase 33-4 Stage-1)
/// - Stage1JsonScannerBox.value_start_after_key_pos/2 (Phase 33-4 Stage-B)
/// - Requires NYASH_JOINIR_IF_SELECT=1 environment variable
/// - Falls back to traditional if_phi on pattern mismatch
@ -67,9 +67,10 @@ pub fn try_lower_if_to_joinir(
return None;
}
// Phase 33-4: 関数名ガード拡張(IfSelectTest + Stage-1/Stage-B 候補)
// Phase 33-4/33-5: 関数名ガード拡張(テスト + Stage-1/Stage-B 候補)
let is_allowed = func.signature.name.starts_with("IfSelectTest.")
|| func.signature.name == "JsonShapeParser._read_value_from_pair/1"
|| func.signature.name.starts_with("Stage1JsonScannerTestBox.") // Phase 33-5 test
|| func.signature.name == "JsonShapeToMap._read_value_from_pair/1"
|| func.signature.name == "Stage1JsonScannerBox.value_start_after_key_pos/2";
if !is_allowed {