feat: Add VM instruction statistics and fix plugin TLV debugging

Major changes:
- Add --vm-stats and --vm-stats-json CLI flags for VM instruction profiling
- Implement instruction counting by opcode type with JSON output support
- Add enhanced TLV debug logging with NYASH_DEBUG_PLUGIN=1 environment variable
- Fix missing fields in CliConfig and ASTNode::BoxDeclaration for test compatibility
- Improve plugin method call error messages with argument count/type details

This enables MIR→VM conversion health checks and supports the Phase 8.6 VM optimization goals.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-23 03:40:17 +09:00
parent 4760921e91
commit dd09e81018
7 changed files with 200 additions and 50 deletions

View File

@ -71,6 +71,8 @@ fn test_mir_phase7_basic_nowait_await() {
let ast = ASTNode::BoxDeclaration {
name: "Main".to_string(),
fields: vec![],
public_fields: vec![],
private_fields: vec![],
methods: main_methods,
constructors: HashMap::new(),
init_fields: vec![],
@ -228,6 +230,8 @@ fn test_mir_phase7_multiple_nowait_await() {
let ast = ASTNode::BoxDeclaration {
name: "Main".to_string(),
fields: vec![],
public_fields: vec![],
private_fields: vec![],
methods: main_methods,
constructors: HashMap::new(),
init_fields: vec![],
@ -348,6 +352,8 @@ fn test_mir_phase7_nested_await() {
let ast = ASTNode::BoxDeclaration {
name: "Main".to_string(),
fields: vec![],
public_fields: vec![],
private_fields: vec![],
methods: main_methods,
constructors: HashMap::new(),
init_fields: vec![],
@ -384,4 +390,4 @@ fn test_mir_phase7_nested_await() {
// Should return 10 (5 * 2)
assert_eq!(final_value.to_string_box().value, "10");
}
}