Full Code of douchuan/jvm for AI

master 5678df31a13e cached
349 files
710.7 KB
196.7k tokens
1780 symbols
1 requests
Download .txt
Showing preview only (795K chars total). Download the full file or copy to clipboard to get everything.
Repository: douchuan/jvm
Branch: master
Commit: 5678df31a13e
Files: 349
Total size: 710.7 KB

Directory structure:
gitextract_9nbsz2bv/

├── .gitignore
├── Cargo.toml
├── LICENSE
├── README.md
├── crates/
│   ├── class-parser/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── class.rs
│   │       ├── lib.rs
│   │       └── signature.rs
│   ├── class-verification/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── checker.rs
│   │       └── lib.rs
│   ├── classfile/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── attributes.rs
│   │       ├── classfile.rs
│   │       ├── constant_pool.rs
│   │       ├── consts.rs
│   │       ├── field_info.rs
│   │       ├── flags.rs
│   │       ├── lib.rs
│   │       ├── method_info.rs
│   │       ├── opcode.rs
│   │       ├── signature.rs
│   │       └── version.rs
│   └── vm/
│       ├── Cargo.toml
│       ├── README.md
│       └── src/
│           ├── lib.rs
│           ├── native/
│           │   ├── common/
│           │   │   ├── check_format.rs
│           │   │   ├── mod.rs
│           │   │   └── reflect.rs
│           │   ├── java_io_FileDescriptor.rs
│           │   ├── java_io_FileInputStream.rs
│           │   ├── java_io_FileOutputStream.rs
│           │   ├── java_io_UnixFileSystem.rs
│           │   ├── java_lang_Class.rs
│           │   ├── java_lang_ClassLoader.rs
│           │   ├── java_lang_Double.rs
│           │   ├── java_lang_Float.rs
│           │   ├── java_lang_Object.rs
│           │   ├── java_lang_Runtime.rs
│           │   ├── java_lang_String.rs
│           │   ├── java_lang_System.rs
│           │   ├── java_lang_Thread.rs
│           │   ├── java_lang_Throwable.rs
│           │   ├── java_lang_reflect_Array.rs
│           │   ├── java_lang_reflect_Proxy.rs
│           │   ├── java_security_AccessController.rs
│           │   ├── java_util_concurrent_atomic_AtomicLong.rs
│           │   ├── mod.rs
│           │   ├── sun_misc_Signal.rs
│           │   ├── sun_misc_URLClassPath.rs
│           │   ├── sun_misc_Unsafe.rs
│           │   ├── sun_misc_VM.rs
│           │   ├── sun_nio_cs_StreamEncoder.rs
│           │   ├── sun_reflect_ConstantPool.rs
│           │   ├── sun_reflect_NativeConstructorAccessorImpl.rs
│           │   ├── sun_reflect_NativeMethodAccessorImpl.rs
│           │   └── sun_reflect_Reflection.rs
│           ├── oop/
│           │   ├── ary.rs
│           │   ├── class.rs
│           │   ├── consts.rs
│           │   ├── field.rs
│           │   ├── inst.rs
│           │   ├── mirror.rs
│           │   ├── mod.rs
│           │   ├── reference.rs
│           │   └── values.rs
│           ├── runtime/
│           │   ├── class_loader.rs
│           │   ├── class_path_manager.rs
│           │   ├── cmp.rs
│           │   ├── constant_pool.rs
│           │   ├── consts.rs
│           │   ├── dataarea.rs
│           │   ├── exception.rs
│           │   ├── frame.rs
│           │   ├── init_vm.rs
│           │   ├── interp.rs
│           │   ├── invoke.rs
│           │   ├── local.rs
│           │   ├── method.rs
│           │   ├── mod.rs
│           │   ├── slot.rs
│           │   ├── stack.rs
│           │   ├── sys_dic.rs
│           │   ├── thread/
│           │   │   ├── condvar.rs
│           │   │   ├── java_thread.rs
│           │   │   ├── main.rs
│           │   │   ├── mod.rs
│           │   │   ├── mutex.rs
│           │   │   ├── thread_pool.rs
│           │   │   └── threads.rs
│           │   └── vm.rs
│           ├── types.rs
│           └── util/
│               ├── attributes.rs
│               ├── consts.rs
│               ├── debug.rs
│               ├── macros.rs
│               ├── mod.rs
│               ├── oop.rs
│               └── sys.rs
├── jvm/
│   ├── Cargo.toml
│   ├── README.md
│   ├── r.sh
│   ├── sample/
│   │   └── HelloWorld.java
│   ├── src/
│   │   ├── main.rs
│   │   └── options.rs
│   └── t.sh
├── libjvm/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── invocation.rs
│       ├── lib.rs
│       ├── native.rs
│       ├── private.rs
│       └── util.rs
├── note.txt
└── tools/
    ├── javap/
    │   ├── Cargo.toml
    │   ├── run.sh
    │   ├── src/
    │   │   ├── cmd/
    │   │   │   ├── disassemble.rs
    │   │   │   └── mod.rs
    │   │   ├── main.rs
    │   │   ├── misc/
    │   │   │   ├── class_path_manager.rs
    │   │   │   ├── mod.rs
    │   │   │   └── sys_info.rs
    │   │   ├── sd/
    │   │   │   └── mod.rs
    │   │   ├── strategy.rs
    │   │   ├── template.rs
    │   │   ├── trans/
    │   │   │   ├── access_flag.rs
    │   │   │   ├── class_file.rs
    │   │   │   ├── code.rs
    │   │   │   ├── constant_pool_trans.rs
    │   │   │   ├── field.rs
    │   │   │   ├── instruction/
    │   │   │   │   ├── aaload.rs
    │   │   │   │   ├── aastore.rs
    │   │   │   │   ├── aconst_null.rs
    │   │   │   │   ├── aload.rs
    │   │   │   │   ├── aload_0.rs
    │   │   │   │   ├── aload_1.rs
    │   │   │   │   ├── aload_2.rs
    │   │   │   │   ├── aload_3.rs
    │   │   │   │   ├── anewarray.rs
    │   │   │   │   ├── areturn.rs
    │   │   │   │   ├── arraylength.rs
    │   │   │   │   ├── astore.rs
    │   │   │   │   ├── astore_0.rs
    │   │   │   │   ├── astore_1.rs
    │   │   │   │   ├── astore_2.rs
    │   │   │   │   ├── astore_3.rs
    │   │   │   │   ├── athrow.rs
    │   │   │   │   ├── baload.rs
    │   │   │   │   ├── bastore.rs
    │   │   │   │   ├── bipush.rs
    │   │   │   │   ├── caload.rs
    │   │   │   │   ├── castore.rs
    │   │   │   │   ├── checkcast.rs
    │   │   │   │   ├── d2f.rs
    │   │   │   │   ├── d2i.rs
    │   │   │   │   ├── d2l.rs
    │   │   │   │   ├── dadd.rs
    │   │   │   │   ├── daload.rs
    │   │   │   │   ├── dastore.rs
    │   │   │   │   ├── dcmpg.rs
    │   │   │   │   ├── dcmpl.rs
    │   │   │   │   ├── dconst_0.rs
    │   │   │   │   ├── dconst_1.rs
    │   │   │   │   ├── ddiv.rs
    │   │   │   │   ├── dload.rs
    │   │   │   │   ├── dload_0.rs
    │   │   │   │   ├── dload_1.rs
    │   │   │   │   ├── dload_2.rs
    │   │   │   │   ├── dload_3.rs
    │   │   │   │   ├── dmul.rs
    │   │   │   │   ├── dneg.rs
    │   │   │   │   ├── drem.rs
    │   │   │   │   ├── dreturn.rs
    │   │   │   │   ├── dstore.rs
    │   │   │   │   ├── dstore_0.rs
    │   │   │   │   ├── dstore_1.rs
    │   │   │   │   ├── dstore_2.rs
    │   │   │   │   ├── dstore_3.rs
    │   │   │   │   ├── dsub.rs
    │   │   │   │   ├── dup.rs
    │   │   │   │   ├── dup2.rs
    │   │   │   │   ├── dup2_x1.rs
    │   │   │   │   ├── dup2_x2.rs
    │   │   │   │   ├── dup_x1.rs
    │   │   │   │   ├── dup_x2.rs
    │   │   │   │   ├── f2d.rs
    │   │   │   │   ├── f2i.rs
    │   │   │   │   ├── f2l.rs
    │   │   │   │   ├── fadd.rs
    │   │   │   │   ├── faload.rs
    │   │   │   │   ├── fastore.rs
    │   │   │   │   ├── fcmpg.rs
    │   │   │   │   ├── fcmpl.rs
    │   │   │   │   ├── fconst_0.rs
    │   │   │   │   ├── fconst_1.rs
    │   │   │   │   ├── fconst_2.rs
    │   │   │   │   ├── fdiv.rs
    │   │   │   │   ├── fload.rs
    │   │   │   │   ├── fload_0.rs
    │   │   │   │   ├── fload_1.rs
    │   │   │   │   ├── fload_2.rs
    │   │   │   │   ├── fload_3.rs
    │   │   │   │   ├── fmul.rs
    │   │   │   │   ├── fneg.rs
    │   │   │   │   ├── frem.rs
    │   │   │   │   ├── freturn.rs
    │   │   │   │   ├── fstore.rs
    │   │   │   │   ├── fstore_0.rs
    │   │   │   │   ├── fstore_1.rs
    │   │   │   │   ├── fstore_2.rs
    │   │   │   │   ├── fstore_3.rs
    │   │   │   │   ├── fsub.rs
    │   │   │   │   ├── getfield.rs
    │   │   │   │   ├── getstatic.rs
    │   │   │   │   ├── goto.rs
    │   │   │   │   ├── goto_w.rs
    │   │   │   │   ├── i2b.rs
    │   │   │   │   ├── i2c.rs
    │   │   │   │   ├── i2d.rs
    │   │   │   │   ├── i2f.rs
    │   │   │   │   ├── i2l.rs
    │   │   │   │   ├── i2s.rs
    │   │   │   │   ├── iadd.rs
    │   │   │   │   ├── iaload.rs
    │   │   │   │   ├── iand.rs
    │   │   │   │   ├── iastore.rs
    │   │   │   │   ├── iconst_0.rs
    │   │   │   │   ├── iconst_1.rs
    │   │   │   │   ├── iconst_2.rs
    │   │   │   │   ├── iconst_3.rs
    │   │   │   │   ├── iconst_4.rs
    │   │   │   │   ├── iconst_5.rs
    │   │   │   │   ├── iconst_m1.rs
    │   │   │   │   ├── idiv.rs
    │   │   │   │   ├── if_acmpeq.rs
    │   │   │   │   ├── if_acmpne.rs
    │   │   │   │   ├── if_icmpeq.rs
    │   │   │   │   ├── if_icmpge.rs
    │   │   │   │   ├── if_icmpgt.rs
    │   │   │   │   ├── if_icmple.rs
    │   │   │   │   ├── if_icmplt.rs
    │   │   │   │   ├── if_icmpne.rs
    │   │   │   │   ├── ifeq.rs
    │   │   │   │   ├── ifge.rs
    │   │   │   │   ├── ifgt.rs
    │   │   │   │   ├── ifle.rs
    │   │   │   │   ├── iflt.rs
    │   │   │   │   ├── ifne.rs
    │   │   │   │   ├── ifnonnull.rs
    │   │   │   │   ├── ifnull.rs
    │   │   │   │   ├── iinc.rs
    │   │   │   │   ├── iload.rs
    │   │   │   │   ├── iload_0.rs
    │   │   │   │   ├── iload_1.rs
    │   │   │   │   ├── iload_2.rs
    │   │   │   │   ├── iload_3.rs
    │   │   │   │   ├── imul.rs
    │   │   │   │   ├── ineg.rs
    │   │   │   │   ├── instanceof.rs
    │   │   │   │   ├── invokedynamic.rs
    │   │   │   │   ├── invokeinterface.rs
    │   │   │   │   ├── invokespecial.rs
    │   │   │   │   ├── invokestatic.rs
    │   │   │   │   ├── invokevirtual.rs
    │   │   │   │   ├── ior.rs
    │   │   │   │   ├── irem.rs
    │   │   │   │   ├── ireturn.rs
    │   │   │   │   ├── ishl.rs
    │   │   │   │   ├── ishr.rs
    │   │   │   │   ├── istore.rs
    │   │   │   │   ├── istore_0.rs
    │   │   │   │   ├── istore_1.rs
    │   │   │   │   ├── istore_2.rs
    │   │   │   │   ├── istore_3.rs
    │   │   │   │   ├── isub.rs
    │   │   │   │   ├── iushr.rs
    │   │   │   │   ├── ixor.rs
    │   │   │   │   ├── jsr.rs
    │   │   │   │   ├── jsr_w.rs
    │   │   │   │   ├── l2d.rs
    │   │   │   │   ├── l2f.rs
    │   │   │   │   ├── l2i.rs
    │   │   │   │   ├── ladd.rs
    │   │   │   │   ├── laload.rs
    │   │   │   │   ├── land.rs
    │   │   │   │   ├── lastore.rs
    │   │   │   │   ├── lcmp.rs
    │   │   │   │   ├── lconst_0.rs
    │   │   │   │   ├── lconst_1.rs
    │   │   │   │   ├── ldc.rs
    │   │   │   │   ├── ldc2_w.rs
    │   │   │   │   ├── ldc_w.rs
    │   │   │   │   ├── ldiv.rs
    │   │   │   │   ├── lload.rs
    │   │   │   │   ├── lload_0.rs
    │   │   │   │   ├── lload_1.rs
    │   │   │   │   ├── lload_2.rs
    │   │   │   │   ├── lload_3.rs
    │   │   │   │   ├── lmul.rs
    │   │   │   │   ├── lneg.rs
    │   │   │   │   ├── lookupswitch.rs
    │   │   │   │   ├── lor.rs
    │   │   │   │   ├── lrem.rs
    │   │   │   │   ├── lreturn.rs
    │   │   │   │   ├── lshl.rs
    │   │   │   │   ├── lshr.rs
    │   │   │   │   ├── lstore.rs
    │   │   │   │   ├── lstore_0.rs
    │   │   │   │   ├── lstore_1.rs
    │   │   │   │   ├── lstore_2.rs
    │   │   │   │   ├── lstore_3.rs
    │   │   │   │   ├── lsub.rs
    │   │   │   │   ├── lushr.rs
    │   │   │   │   ├── lxor.rs
    │   │   │   │   ├── mod.rs
    │   │   │   │   ├── monitorenter.rs
    │   │   │   │   ├── monitorexit.rs
    │   │   │   │   ├── multianewarray.rs
    │   │   │   │   ├── new.rs
    │   │   │   │   ├── newarray.rs
    │   │   │   │   ├── nop.rs
    │   │   │   │   ├── pop.rs
    │   │   │   │   ├── pop2.rs
    │   │   │   │   ├── putfield.rs
    │   │   │   │   ├── putstatic.rs
    │   │   │   │   ├── ret.rs
    │   │   │   │   ├── return_void.rs
    │   │   │   │   ├── saload.rs
    │   │   │   │   ├── sastore.rs
    │   │   │   │   ├── sipush.rs
    │   │   │   │   ├── swap.rs
    │   │   │   │   ├── tableswitch.rs
    │   │   │   │   └── wide.rs
    │   │   │   ├── method.rs
    │   │   │   ├── mod.rs
    │   │   │   └── signature_type.rs
    │   │   └── util/
    │   │       ├── mod.rs
    │   │       └── sys.rs
    │   └── test/
    │       ├── AbstractGraphicObject.java
    │       ├── EnumMobile.java
    │       ├── Football.java
    │       ├── HelloWorld.java
    │       ├── Hockey.java
    │       ├── Interface1.java
    │       └── Sports.java
    └── misc/
        ├── instruction.py
        └── native.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
/target
**/*.rs.bk
*.class
.idea


================================================
FILE: Cargo.toml
================================================
[workspace]
members = [
  "jvm",
  "libjvm",
  "crates/classfile",
  "crates/class-parser",
  "crates/vm",
  "tools/javap"
]

#https://doc.rust-lang.org/cargo/reference/profiles.html
[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2021 douchuan and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
Have a great goal is a very important thing, such as Moon Landing.
What is the meaning of this plan? 
That's the process of achieving this goal, the produce of industry and technology.

Sun is a great company, in the era of C++, they created JVM & HotSpot.

Now, we have Rust, a better tool, let’s remake JVM! 

Pay tribute to medical workers at the front! Thank you for your contribution to the fight against the epidemic.


## Roadmap

- Pass test cases in JDK 
- Pass TCK 
- GC (crate)
- JIT / interp (crate)
- class verification (crate)
- After GC built, ready for optimize System.arraycopy (the key of performance)
- WebAssembly, make the JVM work in Browser 
- java options (-version, -server...)

In summary, the roadmap is built on a 3-step progress.
- Pass TCK
- Refactor & Rewrite
- Divide into several crates, build a collection of modular and reusable vm technologies

Well, it's a long term plan, Sun spent 30 years to improve
VM, Oracle continue doing it.

The journey of a thousand miles begins with one first step. Even the sage was once an ordinary human being.

Just Do It.

## Running
```shell
# setup JDK
# setup rust toolchain
# clone this project

# compile sample by javac
cd jvm/sample
javac HelloWorld.java
cd ..

# modify r.sh JAVA_HOME according to your env
# exec sample
cd jvm
bash r.sh
```

================================================
FILE: crates/class-parser/Cargo.toml
================================================
[package]
name = "class-parser"
version = "0.1.0"
authors = ["Dou Chuan <1843657913@qq.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
classfile = { path = "../classfile", version = "0.1.0" }
nom = "5.1.1"


================================================
FILE: crates/class-parser/README.md
================================================
## JVM class parser
This is the `class-parser` crate, which contains parser
of `.class`. 

The binary format parser based on 
[`nom`](https://crates.io/crates/nom).

================================================
FILE: crates/class-parser/src/class.rs
================================================
use classfile::{
    attributes::{self, Tag as AttrTag, TargetInfo, TypeAnnotation},
    constant_pool, AttributeType, ClassFile, ConstantPool, FieldInfo, MethodInfo, Version,
};
use std::sync::Arc;

use nom::{
    call, count, do_parse, named, named_args,
    number::streaming::{be_u16, be_u32, be_u8},
    peek, switch, tag, take, value,
};

named!(
    version<Version>,
    do_parse!(minor: be_u16 >> major: be_u16 >> (Version { minor, major }))
);

named!(
    constant_tag<constant_pool::Tag>,
    do_parse!(tag: be_u8 >> (constant_pool::Tag::from(tag)))
);

// Const generics still not in stable,
// idk how to write this fancier without them D:
// Hope compiler will rewrite this properly
macro_rules! gen_take_exact {
    ($count: expr, $name: ident) => {
        fn $name(input: &[u8]) -> nom::IResult<&[u8], [u8; $count]> {
            let mut output = [0; $count];
            // TODO: Nom error
            assert!(input.len() >= $count);
            for i in 0..$count {
                output[i] = input[i];
            }
            Ok((&input[$count..], output))
        }
    };
}

gen_take_exact!(4, take_exact_4);
gen_take_exact!(8, take_exact_8);

named!(
    cp_entry<constant_pool::Type>,
    do_parse!(
        ct: constant_tag
            >> entry:
                switch!(value!(ct),
                    constant_pool::Tag::Class => do_parse!(
                        name_index: be_u16 >>
                        (constant_pool::Type::Class { name_index })
                    ) |
                    constant_pool::Tag::FieldRef => do_parse!(
                        class_index: be_u16 >>
                        name_and_type_index: be_u16 >>
                        (constant_pool::Type::FieldRef { class_index, name_and_type_index })
                    ) |
                    constant_pool::Tag::MethodRef => do_parse!(
                        class_index: be_u16 >>
                        name_and_type_index: be_u16 >>
                        (constant_pool::Type::MethodRef { class_index, name_and_type_index })
                    ) |
                    constant_pool::Tag::InterfaceMethodRef => do_parse!(
                        class_index: be_u16 >>
                        name_and_type_index: be_u16 >>
                        (constant_pool::Type::InterfaceMethodRef { class_index, name_and_type_index })
                    ) |
                    constant_pool::Tag::String => do_parse!(
                        string_index: be_u16 >>
                        (constant_pool::Type::String { string_index })
                    ) |
                    constant_pool::Tag::Integer => do_parse!(
                        v: take_exact_4 >>
                        (constant_pool::Type::Integer { v })
                    ) |
                    constant_pool::Tag::Float => do_parse!(
                        v: take_exact_4 >>
                        (constant_pool::Type::Float { v })
                    ) |
                    constant_pool::Tag::Long => do_parse!(
                        v: take_exact_8 >>
                        (constant_pool::Type::Long { v })
                    ) |
                    constant_pool::Tag::Double => do_parse!(
                        v: take_exact_8 >>
                        (constant_pool::Type::Double { v })
                    ) |
                    constant_pool::Tag::NameAndType => do_parse!(
                        name_index: be_u16 >>
                        desc_index: be_u16 >>
                        (constant_pool::Type::NameAndType { name_index, desc_index })
                    ) |
                    constant_pool::Tag::Utf8 => do_parse!(
                        length: be_u16 >>
                        bytes: take!(length) >>
                        (constant_pool::Type::Utf8 { bytes: Arc::new(Vec::from(bytes)) })
                    ) |
                    constant_pool::Tag::MethodHandle => do_parse!(
                        ref_kind: be_u8 >>
                        ref_index: be_u16 >>
                        (constant_pool::Type::MethodHandle { ref_kind, ref_index })
                    ) |
                    constant_pool::Tag::MethodType => do_parse!(
                        desc_index: be_u16 >>
                        (constant_pool::Type::MethodType { desc_index })
                    ) |
                    constant_pool::Tag::InvokeDynamic => do_parse!(
                        bootstrap_method_attr_index: be_u16 >>
                        name_and_type_index: be_u16 >>
                        (constant_pool::Type::InvokeDynamic { bootstrap_method_attr_index, name_and_type_index })
                    )
                )
            >> (entry)
    )
);

fn constant_pool(input: &[u8]) -> nom::IResult<&[u8], ConstantPool> {
    let (mut input, count) = be_u16(input)?;

    let mut output = Vec::with_capacity(count as usize);
    output.push(constant_pool::Type::Nop);

    let mut i = 1;
    while i < count {
        let (new_input, constant_type) = cp_entry(input)?;
        input = new_input;

        i += 1;
        output.push(constant_type.clone());

        //spec 4.4.5
        match constant_type {
            constant_pool::Type::Long { .. } | constant_pool::Type::Double { .. } => {
                i += 1;
                output.push(constant_pool::Type::Nop);
            }
            _ => (),
        }
    }

    Ok((input, Arc::new(output)))
}

use attributes::VerificationTypeInfo;
named!(
    verification_type_info<VerificationTypeInfo>,
    do_parse!(
        id: be_u8
            >> inner:
                switch!(value!(id),
                    0 => value!(VerificationTypeInfo::Top) |
                    1 => value!(VerificationTypeInfo::Integer) |
                    2 => value!(VerificationTypeInfo::Float) |
                    3 => value!(VerificationTypeInfo::Long) |
                    4 => value!(VerificationTypeInfo::Double) |
                    5 => value!(VerificationTypeInfo::Null) |
                    6 => value!(VerificationTypeInfo::UninitializedThis) |
                    7 => do_parse!(
                        cpool_index: be_u16 >>
                        (VerificationTypeInfo::Object {cpool_index})
                    ) |
                    8 => do_parse!(
                        offset: be_u16 >>
                        (VerificationTypeInfo::Uninitialized {offset})
                    )
                )
            >> (inner)
    )
);

named!(
    stack_map_frame<attributes::StackMapFrame>,
    do_parse!(
        frame_type: be_u8
            >> inner:
                switch!(value!(frame_type),
                    0..=63 => value!(attributes::StackMapFrame::Same {tag: frame_type, offset_delta: frame_type as u16}) |
                    64..=127 => do_parse!(
                        offset_delta: value!((frame_type-64) as u16) >>
                        type_info: verification_type_info >>
                        (attributes::StackMapFrame::SameLocals1StackItem {
                            tag: frame_type,
                            offset_delta,
                            stack: [type_info],
                        })
                    ) |
                    128..=246 => value!(attributes::StackMapFrame::Reserved(frame_type)) |
                    247 => do_parse!(
                        offset_delta: be_u16 >>
                        type_info: verification_type_info >>
                        (attributes::StackMapFrame::SameLocals1StackItem {
                            tag: frame_type,
                            offset_delta,
                            stack: [type_info],
                        })
                    ) |
                    248..=250 => do_parse!(
                        offset_delta: be_u16 >>
                        (attributes::StackMapFrame::Chop {
                            tag: frame_type,
                            offset_delta,
                        })
                    ) |
                    251 => do_parse!(
                        offset_delta: be_u16 >>
                        (attributes::StackMapFrame::SameExtended {
                            tag: frame_type,
                            offset_delta
                        })
                    ) |
                    252..=254 => do_parse!(
                        offset_delta: be_u16 >>
                        locals_count: value!(frame_type - 251) >>
                        locals: count!(verification_type_info, locals_count as usize) >>
                        (attributes::StackMapFrame::Append {
                            tag: frame_type,
                            offset_delta,
                            locals,
                        })
                    ) |
                    255 => do_parse!(
                        offset_delta: be_u16 >>
                        locals_count: be_u16 >>
                        locals: count!(verification_type_info, locals_count as usize) >>
                        stack_count: be_u16 >>
                        stack: count!(verification_type_info, stack_count as usize) >>
                        (attributes::StackMapFrame::Full {
                            tag: frame_type,
                            offset_delta,
                            locals,
                            stack,
                        })
                    )
                )
            >> (inner)
    )
);

named!(
    inner_class<attributes::InnerClass>,
    do_parse!(
        inner_class_info_index: be_u16
            >> outer_class_info_index: be_u16
            >> inner_name_index: be_u16
            >> inner_class_access_flags: be_u16
            >> (attributes::InnerClass {
                inner_class_info_index,
                outer_class_info_index,
                inner_name_index,
                inner_class_access_flags,
            })
    )
);

named!(
    enclosing_method<attributes::EnclosingMethod>,
    do_parse!(
        class_index: be_u16
            >> method_index: be_u16
            >> (attributes::EnclosingMethod {
                class_index,
                method_index,
            })
    )
);

named!(
    line_number<attributes::LineNumber>,
    do_parse!(start_pc: be_u16 >> number: be_u16 >> (attributes::LineNumber { start_pc, number }))
);

named!(
    local_variable<attributes::LocalVariable>,
    do_parse!(
        start_pc: be_u16
            >> length: be_u16
            >> name_index: be_u16
            >> signature_index: be_u16
            >> index: be_u16
            >> (attributes::LocalVariable {
                start_pc,
                length,
                name_index,
                signature_index,
                index,
            })
    )
);

named!(
    element_value_tag<attributes::ElementValueTag>,
    do_parse!(tag: be_u8 >> (attributes::ElementValueTag::from(tag)))
);

use attributes::{ElementValueTag, ElementValueType};

// I didn't found a way to turn byte/char/double/float/... boilerplate into a macro(
named_args!(element_value_type(cp: ConstantPool)<attributes::ElementValueType>, do_parse!(
    tag: element_value_tag >>
    inner: switch!(value!(tag),
        ElementValueTag::Byte => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Byte {val_index})
        ) |
        ElementValueTag::Char => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Char {val_index})
        ) |
        ElementValueTag::Double => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Double {val_index})
        ) |
        ElementValueTag::Float => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Float {val_index})
        ) |
        ElementValueTag::Byte => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Byte {val_index})
        ) |
        ElementValueTag::Int => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Int {val_index})
        ) |
        ElementValueTag::Long => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Long {val_index})
        ) |
        ElementValueTag::Short => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Short {val_index})
        ) |
        ElementValueTag::Boolean => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::Boolean {val_index})
        ) |
        ElementValueTag::String => do_parse!(
            val_index: be_u16 >>
            (ElementValueType::String {val_index})
        ) |
        ElementValueTag::Enum => do_parse!(
            type_index: be_u16 >>
            val_index: be_u16 >>
            (ElementValueType::Enum {type_index, val_index})
        ) |
        ElementValueTag::Class => do_parse!(
            index: be_u16 >>
            (ElementValueType::Class {index})
        ) |
        ElementValueTag::Annotation => do_parse!(
            value: call!(annotation_entry, cp) >>
            (ElementValueType::Annotation(attributes::AnnotationElementValue {value}))
        ) |
        ElementValueTag::Array => do_parse!(
            array_size: be_u16 >>
            values: count!(call!(element_value_type, cp.clone()), array_size as usize) >>
            (ElementValueType::Array {
                values,
            })
        ) |
        ElementValueTag::Unknown => value!(ElementValueType::Unknown)
    ) >>
    (inner)
));

named_args!(element_value_pair(cp: ConstantPool)<attributes::ElementValuePair>, do_parse!(
    name_index: be_u16 >>
    value: call!(element_value_type, cp) >>
    (attributes::ElementValuePair {name_index, value})
));

named_args!(annotation_entry(cp: ConstantPool)<attributes::AnnotationEntry>, do_parse!(
    type_index: be_u16 >>
    pair_count: be_u16 >>
    pairs: count!(call!(element_value_pair, cp.clone()), pair_count as usize) >>
    type_name: value!(constant_pool::get_utf8(&cp, type_index as usize).clone()) >>
    (attributes::AnnotationEntry {type_name, pairs})
));

named!(
    local_var_target_table<attributes::LocalVarTargetTable>,
    do_parse!(
        start_pc: be_u16
            >> length: be_u16
            >> index: be_u16
            >> (attributes::LocalVarTargetTable {
                start_pc,
                length,
                index
            })
    )
);

named!(
    target_info<TargetInfo>,
    do_parse!(
        target_type: be_u8
            >> inner:
                switch!(value!(target_type),
                    0x00 | 0x01 => do_parse!(
                        type_parameter_index: be_u8 >>
                        (TargetInfo::TypeParameter { type_parameter_index })
                    ) |
                    0x10 => do_parse!(
                        supertype_index: be_u16 >>
                        (TargetInfo::SuperType { supertype_index })
                    ) |
                    0x11 | 0x12 => do_parse!(
                        type_parameter_index: be_u8 >>
                        bound_index: be_u8 >>
                        (TargetInfo::TypeParameterBound {type_parameter_index, bound_index})
                    ) |
                    0x13 | 0x14 | 0x15 => value!(TargetInfo::Empty) |
                    0x16 => do_parse!(
                        formal_parameter_index: be_u8 >>
                        (TargetInfo::FormalParameter {formal_parameter_index})
                    ) |
                    0x17 => do_parse!(
                        throws_type_index: be_u16 >>
                        (TargetInfo::Throws {throws_type_index})
                    ) |
                    0x40 | 0x41 => do_parse!(
                        item_count: be_u16 >>
                        items: count!(local_var_target_table, item_count as usize) >>
                        (TargetInfo::LocalVar {table: items})
                    ) |
                    0x42 => do_parse!(
                        exception_table_index: be_u16 >>
                        (TargetInfo::Catch {exception_table_index})
                    ) |
                    0x43 | 0x44 | 0x45 | 0x46 => do_parse!(
                        offset: be_u16 >>
                        (TargetInfo::Offset {offset})
                    ) |
                    0x47 | 0x48 | 0x49 | 0x4A | 0x4B => do_parse!(
                        offset: be_u16 >>
                        type_argument_index: be_u8 >>
                        (TargetInfo::TypeArgument {offset, type_argument_index})
                    )
                )
            >> (inner)
    )
);

named!(
    type_path<attributes::TypePath>,
    do_parse!(
        type_path_kind: be_u8
            >> type_argument_index: be_u8
            >> (attributes::TypePath {
                type_path_kind,
                type_argument_index,
            })
    )
);

named_args!(type_annotation(cp: ConstantPool)<TypeAnnotation>, do_parse!(
    target_info: target_info >>
    target_path_part_count: be_u8 >>
    target_path: count!(type_path, target_path_part_count as usize) >>
    type_index: be_u16 >>
    pair_count: be_u16 >>
    pairs: count!(call!(element_value_pair, cp.clone()), pair_count as usize) >>
    (attributes::TypeAnnotation {
        target_info,
        target_path,
        type_index,
        pairs,
    })
));

named!(
    bootstrap_method<attributes::BootstrapMethod>,
    do_parse!(
        method_ref: be_u16
            >> arg_count: be_u16
            >> args: count!(be_u16, arg_count as usize)
            >> (attributes::BootstrapMethod { method_ref, args })
    )
);

named!(
    method_parameter<attributes::MethodParameter>,
    do_parse!(
        name_index: be_u16
            >> acc_flags: be_u16
            >> (attributes::MethodParameter {
                name_index,
                acc_flags
            })
    )
);

named!(
    code_exception<attributes::CodeException>,
    do_parse!(
        start_pc: be_u16
            >> end_pc: be_u16
            >> handler_pc: be_u16
            >> catch_type: be_u16
            >> (attributes::CodeException {
                start_pc,
                end_pc,
                handler_pc,
                catch_type
            })
    )
);

named_args!(attr_sized(tag: AttrTag, self_len: usize, cp: ConstantPool)<AttributeType>, switch!(value!(tag),
    AttrTag::ConstantValue => do_parse!(
        constant_value_index: be_u16 >>
        (AttributeType::ConstantValue {constant_value_index})
    ) |
    AttrTag::Code => do_parse!(
        max_stack: be_u16 >>
        max_locals: be_u16 >>
        len: be_u32 >>
        code: take!(len) >> // TODO: Parse code in same time?)
        exception_count: be_u16 >>
        exceptions: count!(code_exception, exception_count as usize) >>
        attrs: call!(attr_type_vec, cp) >>
        (AttributeType::Code(attributes::Code {
            max_stack,
            max_locals,
            code: Arc::new(Vec::from(code)),
            exceptions,
            attrs,
        }))
    ) |
    AttrTag::StackMapTable => do_parse!(
        frame_count: be_u16 >>
        frames: count!(stack_map_frame, frame_count as usize) >>
        (AttributeType::StackMapTable { entries: frames })
    ) |
    AttrTag::Exceptions => do_parse!(
        exception_count: be_u16 >>
        exceptions: count!(be_u16, exception_count as usize) >>
        (AttributeType::Exceptions { exceptions })
    ) |
    AttrTag::InnerClasses => do_parse!(
        class_count: be_u16 >>
        classes: count!(inner_class, class_count as usize) >>
        (AttributeType::InnerClasses { classes })
    ) |
    AttrTag::EnclosingMethod => do_parse!(
        em: enclosing_method >>
        (AttributeType::EnclosingMethod { em })
    ) |
    AttrTag::Synthetic => value!(AttributeType::Synthetic) |
    AttrTag::Signature => do_parse!(
        signature_index: be_u16 >>
        (AttributeType::Signature { signature_index })
    ) |
    AttrTag::SourceFile => do_parse!(
        source_file_index: be_u16 >>
        (AttributeType::SourceFile { source_file_index })
    ) |
    AttrTag::SourceDebugExtension => do_parse!(
        debug_extension: take!(self_len) >>
        (AttributeType::SourceDebugExtension { debug_extension: Arc::new(Vec::from(debug_extension)) })
    ) |
    AttrTag::LineNumberTable => do_parse!(
        line_count: be_u16 >>
        lines: count!(line_number, line_count as usize) >>
        (AttributeType::LineNumberTable { tables: lines })
    ) |
    AttrTag::LocalVariableTable => do_parse!(
        variable_count: be_u16 >>
        variables: count!(local_variable, variable_count as usize) >>
        (AttributeType::LocalVariableTable { tables: variables })
    ) |
    AttrTag::LocalVariableTypeTable => do_parse!(
        variable_count: be_u16 >>
        variables: count!(local_variable, variable_count as usize) >>
        (AttributeType::LocalVariableTypeTable { tables: variables })
    ) |
    AttrTag::Deprecated => value!(AttributeType::Deprecated) |
    AttrTag::RuntimeVisibleAnnotations => do_parse!(
        raw: peek!(take!(self_len)) >>
        annotation_count: be_u16 >>
        annotations: count!(call!(annotation_entry, cp.clone()), annotation_count as usize) >>
        (AttributeType::RuntimeVisibleAnnotations {raw: Arc::new(Vec::from(raw)), annotations})
    ) |
    AttrTag::RuntimeInvisibleAnnotations => do_parse!(
        raw: peek!(take!(self_len)) >>
        annotation_count: be_u16 >>
        annotations: count!(call!(annotation_entry, cp.clone()), annotation_count as usize) >>
        (AttributeType::RuntimeInvisibleAnnotations {raw: Arc::new(Vec::from(raw)), annotations})
    ) |
    AttrTag::RuntimeVisibleParameterAnnotations => do_parse!(
        raw: peek!(take!(self_len)) >>
        annotation_count: be_u16 >>
        annotations: count!(call!(annotation_entry, cp.clone()), annotation_count as usize) >>
        (AttributeType::RuntimeVisibleParameterAnnotations {raw: Arc::new(Vec::from(raw)), annotations})
    ) |
    AttrTag::RuntimeInvisibleParameterAnnotations => do_parse!(
        raw: peek!(take!(self_len)) >>
        annotation_count: be_u16 >>
        annotations: count!(call!(annotation_entry, cp.clone()), annotation_count as usize) >>
        (AttributeType::RuntimeInvisibleParameterAnnotations {raw: Arc::new(Vec::from(raw)), annotations})
    ) |
    AttrTag::RuntimeVisibleTypeAnnotations => do_parse!(
        raw: peek!(take!(self_len)) >>
        annotation_count: be_u16 >>
        annotations: count!(call!(type_annotation, cp.clone()), annotation_count as usize) >>
        (AttributeType::RuntimeVisibleTypeAnnotations {raw: Arc::new(Vec::from(raw)), annotations})
    ) |
    AttrTag::RuntimeInvisibleTypeAnnotations => do_parse!(
        raw: peek!(take!(self_len)) >>
        annotation_count: be_u16 >>
        annotations: count!(call!(type_annotation, cp.clone()), annotation_count as usize) >>
        (AttributeType::RuntimeInvisibleTypeAnnotations {raw: Arc::new(Vec::from(raw)), annotations})
    ) |
    AttrTag::AnnotationDefault => do_parse!(
        raw: peek!(take!(self_len)) >>
        default_value: call!(element_value_type, cp) >>
        (AttributeType::AnnotationDefault {raw: Arc::new(Vec::from(raw)), default_value})
    ) |
    AttrTag::BootstrapMethods => do_parse!(
        method_count: be_u16 >>
        methods: count!(bootstrap_method, method_count as usize) >>
        (AttributeType::BootstrapMethods {n:method_count, methods})
    ) |
    AttrTag::MethodParameters => do_parse!(
        parameter_count: be_u8 >>
        parameters: count!(method_parameter, parameter_count as usize) >>
        (AttributeType::MethodParameters {parameters})
    ) |
    AttrTag::Unknown => do_parse!(
        _data: take!(self_len) >>
        (AttributeType::Unknown)
    )
));

named_args!(attr_tag(cp: ConstantPool)<AttrTag>, do_parse!(
    name_index: be_u16 >>
    name: value!(constant_pool::get_utf8(&cp, name_index as usize)) >>
    inner: value!(AttrTag::from(name.as_slice())) >>
    (inner)
));

named_args!(attr_type(cp: ConstantPool)<AttributeType>, do_parse!(
    tag: call!(attr_tag, cp.clone()) >>
    length: be_u32 >>
    attr: call!(attr_sized, tag, length as usize, cp) >>
    (attr)
));

named_args!(attr_type_vec(cp: ConstantPool)<Vec<AttributeType>>, do_parse!(
    attrs_count: be_u16 >>
    attrs: count!(call!(attr_type, cp.clone()), attrs_count as usize) >>
    (attrs)
));

named_args!(field(cp: ConstantPool)<FieldInfo>, do_parse!(
    acc_flags: be_u16 >>
    name_index: be_u16 >>
    desc_index: be_u16 >>
    attrs: call!(attr_type_vec, cp) >>
    (FieldInfo {
        acc_flags,
        name_index,
        desc_index,
        attrs,
    })
));

named_args!(method_info(cp: ConstantPool)<MethodInfo>, do_parse!(
    acc_flags: be_u16 >>
    name_index: be_u16 >>
    desc_index: be_u16 >>
    attrs: call!(attr_type_vec, cp) >>
    (MethodInfo {
        acc_flags,
        name_index,
        desc_index,
        attrs,
    })
));

named!(
    class_file<ClassFile>,
    do_parse!(
        _magic: tag!(b"\xCA\xFE\xBA\xBE")
            >> version: version
            >> cp: constant_pool
            >> acc_flags: be_u16
            >> this_class: be_u16
            >> super_class: be_u16
            >> interfaces_count: be_u16
            >> interfaces: count!(be_u16, interfaces_count as usize)
            >> fields_count: be_u16
            >> fields: count!(call!(field, cp.clone()), fields_count as usize)
            >> method_count: be_u16
            >> methods: count!(call!(method_info, cp.clone()), method_count as usize)
            >> attrs: call!(attr_type_vec, cp.clone())
            >> (ClassFile {
                version,
                cp: cp.clone(),
                acc_flags,
                this_class,
                super_class,
                interfaces,
                fields,
                methods,
                attrs
            })
    )
);

pub fn parse(input: &[u8]) -> nom::IResult<&[u8], ClassFile> {
    class_file(input)
}


================================================
FILE: crates/class-parser/src/lib.rs
================================================
#![allow(unused)]

mod class;
mod signature;

pub use class::parse as parse_class;
pub use signature::{ClassSignature, FieldSignature, MethodSignature};



================================================
FILE: crates/class-parser/src/signature.rs
================================================
use classfile::BytesRef;
use classfile::SignatureType as Type;

use nom::bytes::complete::{take, take_till};
use nom::character::complete::{char, one_of};
use nom::combinator::{peek, verify};
use nom::error::make_error;
use nom::lib::std::fmt::{Error, Formatter};
use nom::{
    branch::alt,
    bytes::complete::{is_not, tag},
    error::{ErrorKind, ParseError, VerboseError},
    multi::many1,
    sequence::delimited,
    AsBytes, Err, IResult,
};

#[derive(Debug)]
pub struct ClassSignature {
    pub items: Vec<Type>,
}

#[derive(Debug, Clone)]
pub struct MethodSignature {
    /*
    TestNG, org.testng.collections.Maps

    <K:Ljava/lang/Object;V:Ljava/lang/Object;>(Ljava/util/Map<TK;TV;>;)Ljava/util/Map<TK;TV;>;

    public static <K extends java.lang.Object, V extends java.lang.Object> java.util.Map<K, V> newHashMap(java.util.Map<K, V>);
    */
    pub generics: Vec<(BytesRef, Type)>,

    pub args: Vec<Type>,
    pub retype: Type,
}

pub struct FieldSignature {
    pub field_type: Type,
}

impl ClassSignature {
    pub fn new(raw: &[u8]) -> Self {
        let s = unsafe { std::str::from_utf8_unchecked(raw) };
        let (_, cs) = Self::parse(s).unwrap();
        cs
    }

    fn parse(i: &str) -> IResult<&str, ClassSignature> {
        let (i, items) = parse_types(i)?;
        Ok((i, ClassSignature { items }))
    }
}

impl MethodSignature {
    pub fn new(raw: &[u8]) -> Self {
        let s = unsafe { std::str::from_utf8_unchecked(raw) };
        let (_, r) = Self::parse(s).unwrap();
        r
    }

    fn parse(i: &str) -> IResult<&str, MethodSignature> {
        fn arg0(i: &str) -> IResult<&str, MethodSignature> {
            let (i, _) = tag("()")(i)?;
            let (i, retype) = parse_type(i)?;
            Ok((
                i,
                MethodSignature {
                    generics: vec![],
                    args: vec![],
                    retype,
                },
            ))
        }

        fn args(i: &str) -> IResult<&str, MethodSignature> {
            let (i_return, i_args) = delimited(char('('), is_not(")"), char(')'))(i)?;
            let (_, args) = parse_types(i_args)?;
            let (i, retype) = parse_type(i_return)?;
            Ok((
                i,
                MethodSignature {
                    generics: vec![],
                    args,
                    retype,
                },
            ))
        }

        fn generic(i: &str) -> IResult<&str, MethodSignature> {
            let (i, _) = tag("<")(i)?;
            let (i, generics) = many1(generic_declare)(i)?;
            let (i, _) = tag(">")(i)?;
            let (i, mut r) = MethodSignature::parse(i)?;

            r.generics = generics;

            Ok((i, r))
        }

        alt((arg0, args, generic))(i)
    }
}

impl FieldSignature {
    pub fn new(raw: &[u8]) -> Self {
        let s = unsafe { std::str::from_utf8_unchecked(raw) };
        let (_, r) = Self::parse(s).unwrap();
        r
    }

    fn parse(mut i: &str) -> IResult<&str, FieldSignature> {
        let (i, field_type) = parse_type(i)?;
        Ok((i, FieldSignature { field_type }))
    }
}

impl Default for MethodSignature {
    fn default() -> Self {
        Self {
            generics: Vec::new(),
            args: Vec::new(),
            retype: Type::Void,
        }
    }
}

///////////////////////////
//parser
///////////////////////////

fn primitive<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, E> {
    let (i, t) = one_of("BCDFIJSZV")(i)?;
    let t = match t {
        'B' => Type::Byte,
        'C' => Type::Char,
        'D' => Type::Double,
        'F' => Type::Float,
        'I' => Type::Int,
        'J' => Type::Long,
        'S' => Type::Short,
        'Z' => Type::Boolean,
        'V' => Type::Void,
        _ => unreachable!(),
    };

    Ok((i, t))
}

fn object_desc<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&str, BytesRef, E> {
    // should stop when reach ';' or '<'
    //such as:
    //(Lorg/testng/internal/IConfiguration;Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/lang/String;Lorg/testng/internal/annotations/IAnnotationFinder;ZLjava/util/List<Lorg/testng/IInvokedMethodListener;>;)V
    // if only take_till(|c| c == ';'), can't process like:
    //    Lxx/xx/xx<Lxx/xx/xx;>;
    let (_, _) = alt((tag("L"), tag("T")))(input)?;
    let (i, desc) = take_till(|c| c == ';' || c == '<')(input)?;
    let (i, _) = tag(";")(i)?;
    let mut buf = Vec::with_capacity(1 + desc.len() + 1);
    buf.extend_from_slice(desc.as_bytes());
    buf.push(b';');
    let desc = std::sync::Arc::new(buf);
    Ok((i, desc))
}

fn object_generic<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, E> {
    let (i, tag_prefix) = alt((tag("L"), tag("T")))(i)?;
    let (i, container) = take_till(|c| c == '<')(i)?;
    let (mut i, _) = tag("<")(i)?;

    //signature like:
    //Ljava/lang/Class<+Lcom/google/inject/Module;>;
    //<=> 'java.lang.Class<? extends com.google.inject.Module>'
    let mut prefix = None;
    if i.starts_with('+') {
        prefix = Some(b'+');
        let (i2, _) = tag("+")(i)?;
        i = i2;
    }

    let (i, generic_args) = many1(parse_type)(i)?;
    let (i, _) = tag(">")(i)?;
    let (i, _) = tag(";")(i)?;

    //build results
    let mut buf = Vec::with_capacity(1 + container.len() + 1);
    buf.extend_from_slice(tag_prefix.as_bytes());
    buf.extend_from_slice(container.as_bytes());
    buf.push(b';');
    let desc = std::sync::Arc::new(buf);
    Ok((i, Type::Object(desc, Some(generic_args), prefix)))
}

fn object_normal<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, E> {
    let (i, _) = peek(alt((tag("L"), tag("T"))))(i)?;
    let (i, desc) = object_desc(i)?;
    Ok((i, Type::Object(desc, None, None)))
}

fn object<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, E> {
    alt((object_normal, object_generic))(i)
}

fn array<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, E> {
    let (i, _) = peek(tag("["))(i)?;
    let (i, ary_tags) = take_till(|c| c != '[')(i)?;
    let (mut i, t) = peek(take(1u8))(i)?;

    let mut buf = vec![];
    buf.extend_from_slice(ary_tags.as_bytes());
    match t {
        "L" | "T" => {
            let (i2, desc) = object_desc(i)?;
            i = i2;
            buf.extend_from_slice(desc.as_slice());
        }
        v => {
            let (i2, _) = take(1u8)(i)?;
            i = i2;
            buf.extend_from_slice(v.as_bytes())
        }
    }
    let desc = std::sync::Arc::new(buf);
    Ok((i, Type::Array(desc)))
}

fn generic_declare<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, (BytesRef, Type), E> {
    let (i, generic_type) = take_till(|c| c == ':')(i)?;
    let (i, _) = tag(":")(i)?;
    let (i, t) = parse_type(i)?;
    let generic_type = std::sync::Arc::new(Vec::from(generic_type));
    Ok((i, (generic_type, t)))
}

fn parse_type<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, E> {
    alt((primitive, object, array))(i)
}

fn parse_types<'a, E: ParseError<&'a str>>(mut input: &'a str) -> IResult<&str, Vec<Type>, E> {
    let it = std::iter::from_fn(move || {
        match parse_type::<'a, E>(input) {
            // when successful, a nom parser returns a tuple of
            // the remaining input and the output value.
            // So we replace the captured input data with the
            // remaining input, to be parsed on the next call
            Ok((i, o)) => {
                input = i;
                Some(o)
            }
            _ => None,
        }
    });

    let mut args = vec![];
    for v in it {
        args.push(v);
    }

    Ok((input, args))
}

#[cfg(test)]
mod tests {
    use super::ClassSignature;
    use super::FieldSignature;
    use super::MethodSignature;
    use super::Type as SignatureType;
    use std::sync::Arc;

    #[test]
    fn t_method_no_arg() {
        let expected = MethodSignature {
            generics: vec![],
            args: vec![],
            retype: SignatureType::Void,
        };
        let (_, r) = MethodSignature::parse("()V").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn method_primitive() {
        let table = vec![
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Byte],
                    retype: SignatureType::Void,
                },
                "(B)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Char],
                    retype: SignatureType::Void,
                },
                "(C)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Double],
                    retype: SignatureType::Void,
                },
                "(D)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Float],
                    retype: SignatureType::Void,
                },
                "(F)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Int],
                    retype: SignatureType::Void,
                },
                "(I)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Long],
                    retype: SignatureType::Void,
                },
                "(J)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Short],
                    retype: SignatureType::Void,
                },
                "(S)V",
            ),
            (
                MethodSignature {
                    generics: vec![],
                    args: vec![SignatureType::Boolean],
                    retype: SignatureType::Void,
                },
                "(Z)V",
            ),
        ];

        for (expected, desc) in table.iter() {
            let (_, r) = MethodSignature::parse(desc).unwrap();
            assert_eq!(r.args, expected.args);
            assert_eq!(r.retype, expected.retype);
        }
    }

    #[test]
    fn method_array_object() {
        let expected = MethodSignature {
            generics: vec![],
            args: vec![SignatureType::Array(Arc::new(Vec::from(
                "[[Ljava/lang/String;",
            )))],
            retype: SignatureType::Void,
        };
        let (_, r) = MethodSignature::parse("([[Ljava/lang/String;)V").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn method_mix() {
        let expected = MethodSignature {
            generics: vec![],
            args: vec![
                SignatureType::Byte,
                SignatureType::Char,
                SignatureType::Double,
                SignatureType::Float,
                SignatureType::Int,
                SignatureType::Long,
                SignatureType::Short,
                SignatureType::Boolean,
                SignatureType::Object(Arc::new(Vec::from("Ljava/lang/Integer;")), None, None),
            ],
            retype: SignatureType::Object(Arc::new(Vec::from("Ljava/lang/String;")), None, None),
        };
        let (_, r) =
            MethodSignature::parse("(BCDFIJSZLjava/lang/Integer;)Ljava/lang/String;").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn method_arg_generic() {
        let generic_args = vec![SignatureType::Object(
            Arc::new(Vec::from("Ljava/lang/String;")),
            None,
            None,
        )];
        let expected = MethodSignature {
            generics: vec![],
            args: vec![SignatureType::Object(
                Arc::new(Vec::from("Ljava/util/List;")),
                Some(generic_args),
                None,
            )],
            retype: SignatureType::Void,
        };
        let (_, r) = MethodSignature::parse("(Ljava/util/List<Ljava/lang/String;>;)V").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);

        let expected = MethodSignature {
            generics: vec![],
            args: vec![
                SignatureType::Object(
                    Arc::new(Vec::from("Lorg/testng/internal/IConfiguration;")),
                    None,
                    None,
                ),
                SignatureType::Object(Arc::new(Vec::from("Lorg/testng/ISuite;")), None, None),
                SignatureType::Object(Arc::new(Vec::from("Lorg/testng/xml/XmlTest;")), None, None),
                SignatureType::Object(Arc::new(Vec::from("Ljava/lang/String;")), None, None),
                SignatureType::Object(
                    Arc::new(Vec::from(
                        "Lorg/testng/internal/annotations/IAnnotationFinder;",
                    )),
                    None,
                    None,
                ),
                SignatureType::Boolean,
                SignatureType::Object(
                    Arc::new(Vec::from("Ljava/util/List;")),
                    Some(vec![SignatureType::Object(
                        Arc::new(Vec::from("Lorg/testng/IInvokedMethodListener;")),
                        None,
                        None,
                    )]),
                    None,
                ),
            ],
            retype: SignatureType::Void,
        };
        let (_, r) = MethodSignature::parse("(Lorg/testng/internal/IConfiguration;Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/lang/String;Lorg/testng/internal/annotations/IAnnotationFinder;ZLjava/util/List<Lorg/testng/IInvokedMethodListener;>;)V").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn generic1() {
        let expected = MethodSignature {
            generics: vec![],
            args: vec![
                SignatureType::Object(Arc::new(Vec::from("TK;")), None, None),
                SignatureType::Object(Arc::new(Vec::from("TV;")), None, None),
            ],
            retype: SignatureType::Void,
        };
        let (_, r) = MethodSignature::parse("(TK;TV;)V").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    //'T' tag in args
    #[test]
    fn generic2() {
        let expected = MethodSignature {
            generics: vec![],
            args: vec![SignatureType::Object(
                Arc::new(Vec::from("TK;")),
                None,
                None,
            )],
            retype: SignatureType::Object(
                Arc::new(Vec::from("Ljava/util/Set;")),
                Some(vec![SignatureType::Object(
                    Arc::new(Vec::from("TV;")),
                    None,
                    None,
                )]),
                None,
            ),
        };
        let (_, r) = MethodSignature::parse("(TK;)Ljava/util/Set<TV;>;").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn generic_nest1() {
        let expected = MethodSignature {
            generics: vec![],
            args: vec![],
            retype: SignatureType::Object(
                Arc::new(Vec::from("Ljava/util/Set;")),
                Some(vec![SignatureType::Object(
                    Arc::new(Vec::from("Ljava/util/Map$Entry;")),
                    Some(vec![
                        SignatureType::Object(Arc::new(Vec::from("TK;")), None, None),
                        SignatureType::Object(
                            Arc::new(Vec::from("Ljava/util/Set;")),
                            Some(vec![SignatureType::Object(
                                Arc::new(Vec::from("TV;")),
                                None,
                                None,
                            )]),
                            None,
                        ),
                    ]),
                    None,
                )]),
                None,
            ),
        };
        let (_, r) = MethodSignature::parse(
            "()Ljava/util/Set<Ljava/util/Map$Entry<TK;Ljava/util/Set<TV;>;>;>;",
        )
        .unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn generic_method() {
        let expected = MethodSignature {
            generics: vec![
                (
                    Arc::new(Vec::from("K")),
                    SignatureType::Object(Arc::new(Vec::from("Ljava/lang/Object;")), None, None),
                ),
                (
                    Arc::new(Vec::from("V")),
                    SignatureType::Object(Arc::new(Vec::from("Ljava/lang/Object;")), None, None),
                ),
            ],
            args: vec![SignatureType::Object(
                Arc::new(Vec::from("Ljava/util/Map;")),
                Some(vec![
                    SignatureType::Object(Arc::new(Vec::from("TK;")), None, None),
                    SignatureType::Object(Arc::new(Vec::from("TV;")), None, None),
                ]),
                None,
            )],
            retype: SignatureType::Object(
                Arc::new(Vec::from("Ljava/util/Map;")),
                Some(vec![
                    SignatureType::Object(Arc::new(Vec::from("TK;")), None, None),
                    SignatureType::Object(Arc::new(Vec::from("TV;")), None, None),
                ]),
                None,
            ),
        };
        let (_, r) = MethodSignature::parse("<K:Ljava/lang/Object;V:Ljava/lang/Object;>(Ljava/util/Map<TK;TV;>;)Ljava/util/Map<TK;TV;>;").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn method_return_generic() {
        let generic_args = vec![SignatureType::Object(
            Arc::new(Vec::from("Lorg/testng/ITestNGListener;")),
            None,
            None,
        )];
        let expected = MethodSignature {
            generics: vec![],
            args: vec![],
            retype: SignatureType::Object(
                Arc::new(Vec::from("Ljava/util/List;")),
                Some(generic_args),
                None,
            ),
        };
        let (_, r) =
            MethodSignature::parse("()Ljava/util/List<Lorg/testng/ITestNGListener;>;").unwrap();
        assert_eq!(r.args, expected.args);
        assert_eq!(r.retype, expected.retype);
    }

    #[test]
    fn field() {
        macro_rules! setup_test {
            ($desc: expr, $tp: expr) => {
                let (_, sig) = FieldSignature::parse($desc).unwrap();
                assert_eq!(sig.field_type, $tp);
            };
        }

        setup_test!("B", SignatureType::Byte);
        setup_test!("C", SignatureType::Char);
        setup_test!("D", SignatureType::Double);
        setup_test!("F", SignatureType::Float);
        setup_test!("I", SignatureType::Int);
        setup_test!("J", SignatureType::Long);

        let v = Vec::from("Ljava/lang/Object;");
        let v = Arc::new(v);
        setup_test!("Ljava/lang/Object;", SignatureType::Object(v, None, None));
        setup_test!("S", SignatureType::Short);
        setup_test!("Z", SignatureType::Boolean);

        let v = Vec::from("[Ljava/lang/Object;");
        let v = Arc::new(v);
        setup_test!("[Ljava/lang/Object;", SignatureType::Array(v));

        let v = Vec::from("[[[D");
        let v = Arc::new(v);
        setup_test!("[[[D", SignatureType::Array(v));
    }

    #[test]
    fn t_class_signature() {
        let (_, cs) = ClassSignature::parse("Ljava/lang/Object;Lorg/testng/ITestContext;Lorg/testng/internal/ITestResultNotifier;Lorg/testng/internal/thread/graph/IThreadWorkerFactory<Lorg/testng/ITestNGMethod;>;").unwrap();
        let expected = ClassSignature {
            items: vec![
                SignatureType::Object(Arc::new(Vec::from("Ljava/lang/Object;")), None, None),
                SignatureType::Object(Arc::new(Vec::from("Lorg/testng/ITestContext;")), None, None),
                SignatureType::Object(
                    Arc::new(Vec::from("Lorg/testng/internal/ITestResultNotifier;")),
                    None,
                    None,
                ),
                SignatureType::Object(
                    Arc::new(Vec::from(
                        "Lorg/testng/internal/thread/graph/IThreadWorkerFactory;",
                    )),
                    Some(vec![SignatureType::Object(
                        Arc::new(Vec::from("Lorg/testng/ITestNGMethod;")),
                        None,
                        None,
                    )]),
                    None,
                ),
            ],
        };
        assert_eq!(cs.items, expected.items);
    }
}


================================================
FILE: crates/class-verification/Cargo.toml
================================================
[package]
name = "class-verification"
version = "0.1.0"
authors = ["Dou Chuan <1843657913@qq.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]


================================================
FILE: crates/class-verification/src/checker.rs
================================================
use crate::types::ConstantPool;

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum Err {
    InvalidCpClassNameIdx,
    InvalidCpFieldRefClsIdx,
    InvalidCpFieldRefNameAndTypeIdx,
    InvalidCpMethodRefClsIdx,
    InvalidCpMethodRefNameAndTypeIdx,
    InvalidCpInterfaceMethodRefClsIdx,
    InvalidCpInterfaceMethodRefNameAndTypeIdx,
    InvalidCpStrStrIdx,
    InvalidCpNameAndTypeNameIdx,
    InvalidCpNameAndTypeDescIdx,
    InvalidCpMethodHandleRefKind,
    InvalidCpMethodHandleRefIdx,
    InvalidCpMethodTypeDescIdx,
    InvalidCpInvokeDynBootstrapMethodAttrIdx,
    InvalidCpInvokeDynNameAndTypeIdx,
    InvalidFieldAccFlags,
    InvalidFieldNameIdx,
    InvalidFieldDescIdx,
    InvalidMethodAccFlags,
    InvalidMethodNameIdx,
    InvalidMethodDescIdx,
}

pub type CheckResult = Result<(), Err>;

pub trait Checker {
    fn check(&self, cp: &ConstantPool) -> CheckResult;
}


================================================
FILE: crates/class-verification/src/lib.rs
================================================


================================================
FILE: crates/classfile/Cargo.toml
================================================
[package]
name = "classfile"
version = "0.1.0"
authors = ["Dou Chuan <1843657913@qq.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
description = "Types for the class file format of the Java Virtual Machine."

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
log = "0.4.0"
lazy_static = "1.4.0"


================================================
FILE: crates/classfile/README.md
================================================
## JVM class file
This is the `classfile` crate, which contains definition of
class file format of Java Virtual Machine.
The spec based on `Java SE 8 Edition`.

================================================
FILE: crates/classfile/src/attributes.rs
================================================
use crate::{BytesRef, U1, U2, U4};
use std::sync::Arc;

#[derive(Debug, Clone)]
pub enum Type {
    ConstantValue {
        constant_value_index: U2,
    },
    Code(Code),
    StackMapTable {
        entries: Vec<StackMapFrame>,
    },
    Exceptions {
        exceptions: Vec<U2>,
    },
    InnerClasses {
        classes: Vec<InnerClass>,
    },
    EnclosingMethod {
        em: EnclosingMethod,
    },
    Synthetic,
    Signature {
        signature_index: U2,
    },
    SourceFile {
        source_file_index: U2,
    },
    SourceDebugExtension {
        debug_extension: BytesRef,
    },
    LineNumberTable {
        tables: Vec<LineNumber>,
    },
    LocalVariableTable {
        tables: Vec<LocalVariable>,
    },
    LocalVariableTypeTable {
        tables: Vec<LocalVariable>,
    },
    Deprecated,
    RuntimeVisibleAnnotations {
        raw: BytesRef,
        annotations: Vec<AnnotationEntry>,
    },
    RuntimeInvisibleAnnotations {
        raw: BytesRef,
        annotations: Vec<AnnotationEntry>,
    },
    RuntimeVisibleParameterAnnotations {
        raw: BytesRef,
        annotations: Vec<AnnotationEntry>,
    },
    RuntimeInvisibleParameterAnnotations {
        raw: BytesRef,
        annotations: Vec<AnnotationEntry>,
    },
    RuntimeVisibleTypeAnnotations {
        raw: BytesRef,
        annotations: Vec<TypeAnnotation>,
    },
    RuntimeInvisibleTypeAnnotations {
        raw: BytesRef,
        annotations: Vec<TypeAnnotation>,
    },
    AnnotationDefault {
        raw: BytesRef,
        default_value: ElementValueType,
    },
    BootstrapMethods {
        n: U2,
        methods: Vec<BootstrapMethod>,
    },
    MethodParameters {
        parameters: Vec<MethodParameter>,
    },
    Unknown,
}

#[derive(Clone, Copy)]
pub enum Tag {
    ConstantValue,
    Code,
    StackMapTable,
    Exceptions,
    InnerClasses,
    EnclosingMethod,
    Synthetic,
    Signature,
    SourceFile,
    SourceDebugExtension,
    LineNumberTable,
    LocalVariableTable,
    LocalVariableTypeTable,
    Deprecated,
    RuntimeVisibleAnnotations,
    RuntimeInvisibleAnnotations,
    RuntimeVisibleParameterAnnotations,
    RuntimeInvisibleParameterAnnotations,
    RuntimeVisibleTypeAnnotations,
    RuntimeInvisibleTypeAnnotations,
    AnnotationDefault,
    BootstrapMethods,
    MethodParameters,
    Unknown,
}

impl From<&[u8]> for Tag {
    fn from(raw: &[u8]) -> Self {
        match raw {
            b"ConstantValue" => Tag::ConstantValue,
            b"Code" => Tag::Code,
            b"StackMapTable" => Tag::StackMapTable,
            b"Exceptions" => Tag::Exceptions,
            b"InnerClasses" => Tag::InnerClasses,
            b"EnclosingMethod" => Tag::EnclosingMethod,
            b"Synthetic" => Tag::Synthetic,
            b"Signature" => Tag::Signature,
            b"SourceFile" => Tag::SourceFile,
            b"SourceDebugExtension" => Tag::SourceDebugExtension,
            b"LineNumberTable" => Tag::LineNumberTable,
            b"LocalVariableTable" => Tag::LocalVariableTable,
            b"LocalVariableTypeTable" => Tag::LocalVariableTypeTable,
            b"Deprecated" => Tag::Deprecated,
            b"RuntimeVisibleAnnotations" => Tag::RuntimeVisibleAnnotations,
            b"RuntimeInvisibleAnnotations" => Tag::RuntimeInvisibleAnnotations,
            b"RuntimeVisibleParameterAnnotations" => Tag::RuntimeVisibleParameterAnnotations,
            b"RuntimeInvisibleParameterAnnotations" => Tag::RuntimeInvisibleParameterAnnotations,
            b"RuntimeVisibleTypeAnnotations" => Tag::RuntimeVisibleTypeAnnotations,
            b"RuntimeInvisibleTypeAnnotations" => Tag::RuntimeInvisibleTypeAnnotations,
            b"AnnotationDefault" => Tag::AnnotationDefault,
            b"BootstrapMethods" => Tag::BootstrapMethods,
            b"MethodParameters" => Tag::MethodParameters,
            _ => {
                info!("Unknown attr {}", unsafe {
                    std::str::from_utf8_unchecked(raw)
                });
                // error!("Unknown attr {}", String::from_utf8_lossy(raw));
                Tag::Unknown
            }
        }
    }
}

#[derive(Debug, Clone)]
pub struct Code {
    pub max_stack: U2,
    pub max_locals: U2,
    pub code: Arc<Vec<U1>>,
    pub exceptions: Vec<CodeException>,
    pub attrs: Vec<Type>,
}

#[derive(Debug, Clone)]
pub struct CodeException {
    pub start_pc: U2,
    pub end_pc: U2,
    pub handler_pc: U2,
    pub catch_type: U2,
}

impl CodeException {
    pub fn contains(&self, pc: U2) -> bool {
        (self.start_pc..self.end_pc + 1).contains(&pc)
    }

    pub fn is_finally(&self) -> bool {
        self.catch_type == 0
    }
}

#[derive(Debug, Clone)]
pub struct AttributeInfo {
    pub name_index: U2,
    pub length: U4,
    pub info: Vec<U1>,
}

pub enum NestedClassAccessPropertyFlag {
    AccPublic,
    AccPrivate,
    AccProtected,
    AccStatic,
    AccFinal,
    AccInterface,
    AccAbstract,
    AccSynthetic,
    AccAnnotation,
    AccEnum,
}

#[derive(Debug, Copy, Clone)]
pub struct InnerClass {
    pub inner_class_info_index: U2,
    pub outer_class_info_index: U2,
    pub inner_name_index: U2,
    pub inner_class_access_flags: U2,
}

#[derive(Debug, Copy, Clone)]
pub struct LineNumber {
    pub start_pc: U2,
    pub number: U2,
}

#[derive(Debug, Copy, Clone)]
pub struct LocalVariable {
    pub start_pc: U2,
    pub length: U2,
    pub name_index: U2,
    pub signature_index: U2,
    pub index: U2,
}

#[derive(Debug, Clone, Copy)]
pub enum ElementValueTag {
    Byte,
    Char,
    Double,
    Float,
    Int,
    Long,
    Short,
    Boolean,
    String,
    Enum,
    Class,
    Annotation,
    Array,
    Unknown,
}

impl From<u8> for ElementValueTag {
    fn from(v: u8) -> Self {
        match v {
            b'B' => ElementValueTag::Byte,
            b'C' => ElementValueTag::Char,
            b'D' => ElementValueTag::Double,
            b'F' => ElementValueTag::Float,
            b'I' => ElementValueTag::Int,
            b'J' => ElementValueTag::Long,
            b'S' => ElementValueTag::Short,
            b'Z' => ElementValueTag::Boolean,
            b's' => ElementValueTag::String,
            b'e' => ElementValueTag::Enum,
            b'c' => ElementValueTag::Class,
            b'@' => ElementValueTag::Annotation,
            b'[' => ElementValueTag::Array,
            _ => ElementValueTag::Unknown,
        }
    }
}

#[derive(Debug, Clone)]
pub enum ElementValueType {
    Byte { val_index: U2 },
    Char { val_index: U2 },
    Double { val_index: U2 },
    Float { val_index: U2 },
    Int { val_index: U2 },
    Long { val_index: U2 },
    Short { val_index: U2 },
    Boolean { val_index: U2 },
    String { val_index: U2 },
    Enum { type_index: U2, val_index: U2 },
    Class { index: U2 },
    Annotation(AnnotationElementValue),
    Array { values: Vec<ElementValueType> },
    Unknown,
}

#[derive(Debug, Clone)]
pub struct AnnotationElementValue {
    pub value: AnnotationEntry,
}

#[derive(Debug, Clone)]
pub struct ElementValuePair {
    pub name_index: U2,
    pub value: ElementValueType,
}

#[derive(Debug, Clone)]
pub struct AnnotationEntry {
    pub type_name: BytesRef,
    pub pairs: Vec<ElementValuePair>,
}

#[derive(Debug, Clone)]
pub struct BootstrapMethod {
    pub method_ref: U2,
    pub args: Vec<U2>,
}

#[derive(Debug)]
pub enum MethodParameterAccessFlag {
    AccFinal = 0x0010,
    AccSynthetic = 0x1000,
    AccMandated = 0x8000,
}

#[derive(Debug, Copy, Clone)]
pub struct MethodParameter {
    pub name_index: U2,
    pub acc_flags: U2,
}

#[derive(Debug, Clone)]
pub enum VerificationTypeInfo {
    Top,
    Integer,
    Float,
    Long,
    Double,
    Null,
    UninitializedThis,
    Object { cpool_index: U2 },
    Uninitialized { offset: U2 },
}

#[derive(Debug, Clone)]
pub enum StackMapFrame {
    Same {
        tag: U1,
        offset_delta: U2,
    },
    SameLocals1StackItem {
        tag: U1,
        offset_delta: U2,
        stack: [VerificationTypeInfo; 1],
    },
    SameLocals1StackItemExtended {
        tag: U1,
        offset_delta: U2,
        stack: [VerificationTypeInfo; 1],
    },
    Chop {
        tag: U1,
        offset_delta: U2,
    },
    SameExtended {
        tag: U1,
        offset_delta: U2,
    },
    Append {
        tag: U1,
        offset_delta: U2,
        locals: Vec<VerificationTypeInfo>,
    },
    Full {
        tag: U1,
        offset_delta: U2,
        locals: Vec<VerificationTypeInfo>,
        stack: Vec<VerificationTypeInfo>,
    },
    Reserved(U1),
}

#[derive(Debug, Clone)]
pub struct TypeAnnotation {
    pub target_info: TargetInfo,
    pub target_path: Vec<TypePath>,
    pub type_index: U2,
    pub pairs: Vec<ElementValuePair>,
}

#[derive(Debug, Clone)]
pub enum TargetInfo {
    TypeParameter {
        type_parameter_index: U1,
    },
    SuperType {
        supertype_index: U2,
    },
    TypeParameterBound {
        type_parameter_index: U1,
        bound_index: U1,
    },
    Empty,
    FormalParameter {
        formal_parameter_index: U1,
    },
    Throws {
        throws_type_index: U2,
    },
    LocalVar {
        table: Vec<LocalVarTargetTable>,
    },
    Catch {
        exception_table_index: U2,
    },
    Offset {
        offset: U2,
    },
    TypeArgument {
        offset: U2,
        type_argument_index: U1,
    },
}

#[derive(Debug, Clone)]
pub struct LocalVarTargetTable {
    pub start_pc: U2,
    pub length: U2,
    pub index: U2,
}

#[derive(Debug, Clone)]
pub struct TypePath {
    pub type_path_kind: U1,
    pub type_argument_index: U1,
}

#[derive(Debug, Clone)]
pub struct EnclosingMethod {
    pub class_index: U2,
    pub method_index: U2,
}


================================================
FILE: crates/classfile/src/classfile.rs
================================================
use crate::attributes::InnerClass;
use crate::{attributes::Type, field_info::FieldInfo, method_info::MethodInfo, version::Version};
use crate::{ConstantPool, U2};

#[derive(Debug)]
pub struct ClassFile {
    pub version: Version,
    pub cp: ConstantPool,
    pub acc_flags: U2,
    pub this_class: U2,
    pub super_class: U2,
    pub interfaces: Vec<U2>,
    pub fields: Vec<FieldInfo>,
    pub methods: Vec<MethodInfo>,
    pub attrs: Vec<Type>,
}

impl ClassFile {
    pub fn inner_classes(&self) -> Option<Vec<InnerClass>> {
        for it in self.attrs.iter() {
            if let Type::InnerClasses { classes } = it {
                return Some(classes.clone());
            }
        }

        None
    }

    pub fn signature(&self) -> Option<usize> {
        for it in self.attrs.iter() {
            if let Type::Signature { signature_index } = it {
                return Some(*signature_index as usize);
            }
        }

        None
    }
}


================================================
FILE: crates/classfile/src/constant_pool.rs
================================================
use crate::consts::{
    CONSTANT_INTERFACE_METHOD_REF_TAG, CONSTANT_METHOD_REF_TAG, METHOD_NAME_CLINIT,
    METHOD_NAME_INIT,
};
use crate::{BytesRef, ConstantPool};
use fmt::Debug;
use std::fmt;
use std::sync::Arc;

pub fn get_class_name(cp: &ConstantPool, idx: usize) -> &BytesRef {
    match cp.get(idx) {
        Some(Type::Class { name_index }) => get_utf8(cp, *name_index as usize),
        _ => unreachable!(),
    }
}

pub fn get_field_ref(cp: &ConstantPool, idx: usize) -> (u16, u16) {
    match cp.get(idx) {
        Some(Type::FieldRef {
            class_index,
            name_and_type_index,
        }) => (*class_index, *name_and_type_index),
        _ => unreachable!(),
    }
}

pub fn get_method_ref(cp: &ConstantPool, idx: usize) -> (u8, u16, u16) {
    match cp.get(idx) {
        Some(Type::MethodRef {
            class_index,
            name_and_type_index,
        }) => (CONSTANT_METHOD_REF_TAG, *class_index, *name_and_type_index),
        Some(Type::InterfaceMethodRef {
            class_index,
            name_and_type_index,
        }) => (
            CONSTANT_INTERFACE_METHOD_REF_TAG,
            *class_index,
            *name_and_type_index,
        ),
        _ => unreachable!(),
    }
}

pub fn get_name_and_type(cp: &ConstantPool, idx: usize) -> (&BytesRef, &BytesRef) {
    match cp.get(idx) {
        Some(Type::NameAndType {
            name_index,
            desc_index,
        }) => (
            get_utf8(cp, *name_index as usize),
            get_utf8(cp, *desc_index as usize),
        ),
        _ => unreachable!(),
    }
}

pub fn get_utf8(cp: &ConstantPool, idx: usize) -> &BytesRef {
    match cp.get(idx) {
        Some(Type::Utf8 { bytes }) => bytes,
        _ => unreachable!(),
    }
}

pub fn get_string(cp: &ConstantPool, idx: usize) -> String {
    match cp.get(idx) {
        Some(Type::String { string_index }) => {
            let v = get_utf8(cp, *string_index as usize);
            let raw = construct_string_raw(v.as_slice());
            String::from_utf16_lossy(raw.as_slice())
        }
        _ => unreachable!(),
    }
}

pub fn construct_string_raw(bs: &[u8]) -> Vec<u16> {
    let length = bs.len();
    let mut buffer: Vec<u16> = Vec::with_capacity(length);
    let mut pos = 0;
    while pos < length {
        if bs[pos] & 0x80 == 0 {
            let v = bs[pos] as u16;
            buffer.push(v);
            pos += 1;
        } else if bs[pos] & 0xE0 == 0xC0 && (bs[pos + 1] & 0xC0) == 0x80 {
            let x = bs[pos] as u16;
            let y = bs[pos + 1] as u16;
            let v = ((x & 0x1f) << 6) + (y & 0x3f);
            buffer.push(v);
            pos += 2;
        } else if bs[pos] & 0xF0 == 0xE0
            && (bs[pos + 1] & 0xC0) == 0x80
            && (bs[pos + 2] & 0xC0) == 0x80
        {
            let x = bs[pos] as u16;
            let y = bs[pos + 1] as u16;
            let z = bs[pos + 2] as u16;
            let v = ((x & 0xf) << 12) + ((y & 0x3f) << 6) + (z & 0x3f);
            buffer.push(v);
            pos += 3;
        } else if bs[pos] == 0xED
            && (bs[pos + 1] & 0xF0 == 0xA0)
            && (bs[pos + 2] & 0xC0 == 0x80)
            && (bs[pos + 3] == 0xED)
            && (bs[pos + 4] & 0xF0 == 0xB0)
            && (bs[pos + 5] & 0xC0 == 0x80)
        {
            let v = bs[pos + 1] as u32;
            let w = bs[pos + 2] as u32;
            let y = bs[pos + 4] as u32;
            let z = bs[pos + 5] as u32;
            let vv =
                0x10000 + ((v & 0x0f) << 16) + ((w & 0x3f) << 10) + ((y & 0x0f) << 6) + (z & 0x3f);
            buffer.push(vv as u16);

            pos += 6;
        } else {
            unreachable!()
        }
    }

    buffer
}

#[derive(Debug, Clone)]
pub enum Type {
    Nop,
    Class {
        name_index: u16,
    },
    FieldRef {
        class_index: u16,
        name_and_type_index: u16,
    },
    MethodRef {
        class_index: u16,
        name_and_type_index: u16,
    },
    InterfaceMethodRef {
        class_index: u16,
        name_and_type_index: u16,
    },
    String {
        string_index: u16,
    },
    Integer {
        v: [u8; 4],
    },
    Float {
        v: [u8; 4],
    },
    Long {
        v: [u8; 8],
    },
    Double {
        v: [u8; 8],
    },
    NameAndType {
        name_index: u16,
        desc_index: u16,
    },
    Utf8 {
        bytes: BytesRef,
    },
    MethodHandle {
        ref_kind: u8,
        ref_index: u16,
    },
    MethodType {
        desc_index: u16,
    },
    InvokeDynamic {
        bootstrap_method_attr_index: u16,
        name_and_type_index: u16,
    },
    Unknown,
}

#[derive(Debug, Clone, Copy)]
pub enum Tag {
    Class,
    FieldRef,
    MethodRef,
    InterfaceMethodRef,
    String,
    Integer,
    Float,
    Long,
    Double,
    NameAndType,
    Utf8,
    MethodHandle,
    MethodType,
    InvokeDynamic,
}

impl From<u8> for Tag {
    fn from(tag: u8) -> Self {
        match tag {
            7 => Tag::Class,
            9 => Tag::FieldRef,
            10 => Tag::MethodRef,
            11 => Tag::InterfaceMethodRef,
            8 => Tag::String,
            3 => Tag::Integer,
            4 => Tag::Float,
            5 => Tag::Long,
            6 => Tag::Double,
            12 => Tag::NameAndType,
            1 => Tag::Utf8,
            15 => Tag::MethodHandle,
            16 => Tag::MethodType,
            18 => Tag::InvokeDynamic,
            _ => unreachable!(),
        }
    }
}

impl Type {
    pub fn as_cp_item<'a, 'b>(&'a self, cp: &'b ConstantPool) -> ConstantPoolItem<'a, 'b> {
        ConstantPoolItem { cp, item: self }
    }
}

pub struct ConstantPoolItem<'item, 'cp> {
    cp: &'cp ConstantPool,
    item: &'item Type,
}

impl Debug for ConstantPoolItem<'_, '_> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.item {
            Type::Nop => f.debug_struct("Nop").finish(),
            Type::Class { name_index } => f
                .debug_struct("Class")
                .field("name_index", name_index)
                .field(
                    "name",
                    &self
                        .cp
                        .get(*name_index as usize)
                        .map(|t| t.as_cp_item(self.cp)),
                )
                .finish(),
            Type::Utf8 { bytes } => f
                .debug_struct("Utf8")
                .field("string", &std::str::from_utf8(bytes))
                .finish(),
            _ => write!(f, "TODO debug for: {:?}", self.item),
        }
    }
}


================================================
FILE: crates/classfile/src/consts.rs
================================================
use crate::U4;

pub const MAGIC: U4 = 0xCAFEBABE;

pub const METHOD_NAME_INIT: &[u8] = b"<init>";
pub const METHOD_NAME_CLINIT: &[u8] = b"<clinit>";

pub const MAX_CP_ENTRIES: u16 = 65535;
pub const MAX_FIELDS_NUM: u16 = 65535;
pub const MAX_METHODS_NUM: u16 = 65535;
pub const MAX_DIRECT_SUPER_INTERFACES_NUM: u16 = 65535;
pub const MAX_LOCAL_VARS_NUM: u16 = 65535;
pub const MAX_OP_STACKS_SIZE: u16 = 65535;
pub const MAX_METHOD_PARAMS_NUM: u16 = 255;
pub const MAX_CONST_STR_LEN: u16 = 65535;
pub const MAX_ARRAY_DIMENSIONS: u16 = 255;

pub const J_OBJECT: &[u8] = b"java/lang/Object";
pub const J_CLONEABLE: &[u8] = b"java/lang/Cloneable";
pub const J_SERIALIZABLE: &[u8] = b"java/io/Serializable";
pub const J_CLASS: &[u8] = b"java/lang/Class";
pub const J_STRING: &[u8] = b"java/lang/String";
pub const J_THREAD: &[u8] = b"java/lang/Thread";
pub const J_THREAD_GROUP: &[u8] = b"java/lang/ThreadGroup";
pub const J_SYSTEM: &[u8] = b"java/lang/System";

pub const J_INPUT_STREAM: &[u8] = b"java/io/InputStream";
pub const J_PRINT_STREAM: &[u8] = b"java/io/PrintStream";
pub const J_SECURITY_MANAGER: &[u8] = b"java/lang/SecurityManager";

pub const J_FIELD: &[u8] = b"java/lang/reflect/Field";
pub const J_METHOD: &[u8] = b"java/lang/reflect/Method";
pub const J_METHOD_CTOR: &[u8] = b"java/lang/reflect/Constructor";
pub const J_ACCESSIBLE_OBJECT: &[u8] = b"java/lang/reflect/AccessibleObject";
pub const J_METHODHANDLE: &[u8] = b"java/lang/invoke/MethodHandle";
pub const J_METHODTYPE: &[u8] = b"java/lang/invoke/MethodType";

pub const J_INTERNAL_ERROR: &[u8] = b"java/lang/InternalError";
pub const J_NPE: &[u8] = b"java/lang/NullPointerException";
pub const J_IOEXCEPTION: &[u8] = b"java/io/IOException";
pub const J_ARRAY_INDEX_OUT_OF_BOUNDS: &[u8] = b"java/lang/ArrayIndexOutOfBoundsException";
pub const J_CLASS_NOT_FOUND: &[u8] = b"java/lang/ClassNotFoundException";
pub const J_ARITHMETIC_EX: &[u8] = b"java/lang/ArithmeticException";
pub const J_SOE: &[u8] = b"java/lang/StackOverflowError";
pub const J_NASE: &[u8] = b"java/lang/NegativeArraySizeException";
pub const J_CCE: &[u8] = b"java/lang/ClassCastException";
pub const J_THROWABLE: &[u8] = b"java/lang/Throwable";

pub const CONSTANT_METHOD_REF_TAG: u8 = 10;
pub const CONSTANT_INTERFACE_METHOD_REF_TAG: u8 = 11;


================================================
FILE: crates/classfile/src/field_info.rs
================================================
use crate::attributes::Type;
use crate::U2;

#[derive(Debug)]
pub struct FieldInfo {
    pub acc_flags: U2,
    pub name_index: U2,
    pub desc_index: U2,
    pub attrs: Vec<Type>,
}


================================================
FILE: crates/classfile/src/flags.rs
================================================
use crate::U2;

macro_rules! def_acc {
    ($name:ident, $v:expr) => {
        pub const $name: U2 = $v;
    };
}

def_acc!(ACC_PUBLIC, 0x0001);
def_acc!(ACC_PRIVATE, 0x0002);
def_acc!(ACC_PROTECTED, 0x0004);
def_acc!(ACC_STATIC, 0x0008);
def_acc!(ACC_FINAL, 0x0010);
def_acc!(ACC_SYNCHRONIZED, 0x0020);
def_acc!(ACC_SUPER, 0x0020);
def_acc!(ACC_VOLATILE, 0x0040);
def_acc!(ACC_BRIDGE, 0x0040);
def_acc!(ACC_VARARGS, 0x0080);
def_acc!(ACC_TRANSIENT, 0x0080);
def_acc!(ACC_NATIVE, 0x0100);
def_acc!(ACC_INTERFACE, 0x0200);
def_acc!(ACC_ABSTRACT, 0x0400);
def_acc!(ACC_STRICT, 0x0800);
def_acc!(ACC_SYNTHETIC, 0x1000);
def_acc!(ACC_ANNOTATION, 0x2000);
def_acc!(ACC_ENUM, 0x4000);
def_acc!(ACC_MIRANDA, 0x8000);
def_acc!(ACC_REFLECT_MASK, 0xffff);


================================================
FILE: crates/classfile/src/lib.rs
================================================
#![allow(unused)]

//! Provides types for working with class file.
//!
//! The `classfile` crate provides types for describing the
//! class file format of the Java Virtual Machine.
//!
//! It's not class file parser.
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
pub mod attributes;
mod classfile;
pub mod constant_pool;
pub mod consts;
mod field_info;
pub mod flags;
mod method_info;
mod opcode;
mod signature;
mod version;

pub type U1 = u8;
pub type U2 = u16;
pub type U4 = u32;
pub type BytesRef = std::sync::Arc<Vec<u8>>;
pub type ConstantPool = std::sync::Arc<Vec<constant_pool::Type>>;

pub use crate::classfile::ClassFile;
pub use attributes::Type as AttributeType;
pub use constant_pool::Type as ConstantPoolType;
pub use field_info::FieldInfo;
pub use method_info::MethodInfo;
pub use opcode::OpCode;
pub use signature::Type as SignatureType;
pub use version::Version;


================================================
FILE: crates/classfile/src/method_info.rs
================================================
use crate::attributes::{Code, CodeException, LineNumber, LocalVariable, StackMapFrame, Type};
use crate::constant_pool;
use crate::{BytesRef, ConstantPool, U2};
use std::collections::HashMap;

#[derive(Debug, Clone)]
pub struct MethodInfo {
    pub acc_flags: U2,
    pub name_index: U2,
    pub desc_index: U2,
    pub attrs: Vec<Type>,
}

impl MethodInfo {
    pub fn get_code(&self) -> Option<Code> {
        for it in self.attrs.iter() {
            if let Type::Code(code) = it {
                return Some(code.clone());
            }
        }

        None
    }

    pub fn get_line_number_table(&self) -> Vec<LineNumber> {
        let mut line_num_table = Vec::new();

        self.attrs.iter().for_each(|attr| {
            if let Type::Code(code) = attr {
                code.attrs.iter().for_each(|it| {
                    if let Type::LineNumberTable { tables } = it {
                        line_num_table.extend_from_slice(tables.as_slice());
                    }
                });
            }
        });

        line_num_table
    }

    pub fn get_throws(&self) -> Option<Vec<U2>> {
        for it in self.attrs.iter() {
            if let Type::Exceptions { exceptions } = it {
                return Some(exceptions.clone());
            }
        }

        None
    }

    pub fn get_ex_table(&self) -> Option<Vec<CodeException>> {
        for it in self.attrs.iter() {
            if let Type::Code(code) = it {
                if !code.exceptions.is_empty() {
                    return Some(code.exceptions.clone());
                }
            }
        }

        None
    }

    pub fn get_stack_map_table(&self) -> Option<Vec<StackMapFrame>> {
        if let Some(code) = self.get_code() {
            for it in code.attrs.iter() {
                if let Type::StackMapTable { entries } = it {
                    return Some(entries.clone());
                }
            }
        }

        None
    }

    pub fn get_local_variable_table(&self) -> Option<Vec<LocalVariable>> {
        if let Some(code) = self.get_code() {
            for it in code.attrs.iter() {
                if let Type::LocalVariableTable { tables } = it {
                    return Some(tables.clone());
                }
            }
        }

        None
    }

    pub fn get_local_variable_type_table(&self) -> Option<Vec<LocalVariable>> {
        if let Some(code) = self.get_code() {
            for it in code.attrs.iter() {
                if let Type::LocalVariableTypeTable { tables } = it {
                    return Some(tables.clone());
                }
            }
        }

        None
    }
}


================================================
FILE: crates/classfile/src/opcode.rs
================================================
#![allow(non_camel_case_types)]

#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub enum OpCode {
    //Constants
    nop,
    aconst_null,
    iconst_m1,
    iconst_0,
    iconst_1,
    iconst_2,
    iconst_3,
    iconst_4,
    iconst_5,
    lconst_0,
    lconst_1,
    fconst_0,
    fconst_1,
    fconst_2,
    dconst_0,
    dconst_1,
    bipush,
    sipush,
    ldc,
    ldc_w,
    ldc2_w,
    //Loads
    iload,
    lload,
    fload,
    dload,
    aload,
    iload_0,
    iload_1,
    iload_2,
    iload_3,
    lload_0,
    lload_1,
    lload_2,
    lload_3,
    fload_0,
    fload_1,
    fload_2,
    fload_3,
    dload_0,
    dload_1,
    dload_2,
    dload_3,
    aload_0,
    aload_1,
    aload_2,
    aload_3,
    iaload,
    laload,
    faload,
    daload,
    aaload,
    baload,
    caload,
    saload,
    //Stores
    istore,
    lstore,
    fstore,
    dstore,
    astore,
    istore_0,
    istore_1,
    istore_2,
    istore_3,
    lstore_0,
    lstore_1,
    lstore_2,
    lstore_3,
    fstore_0,
    fstore_1,
    fstore_2,
    fstore_3,
    dstore_0,
    dstore_1,
    dstore_2,
    dstore_3,
    astore_0,
    astore_1,
    astore_2,
    astore_3,
    iastore,
    lastore,
    fastore,
    dastore,
    aastore,
    bastore,
    castore,
    sastore,
    //Stack
    pop,
    pop2,
    dup,
    dup_x1,
    dup_x2,
    dup2,
    dup2_x1,
    dup2_x2,
    swap,
    //Math
    iadd,
    ladd,
    fadd,
    dadd,
    isub,
    lsub,
    fsub,
    dsub,
    imul,
    lmul,
    fmul,
    dmul,
    idiv,
    ldiv,
    fdiv,
    ddiv,
    irem,
    lrem,
    frem, //deprecated
    drem, //deprecated
    ineg,
    lneg,
    fneg, //deprecated
    dneg, //deprecated
    ishl,
    lshl,
    ishr,
    lshr,
    iushr,
    lushr,
    iand,
    land,
    ior,
    lor,
    ixor,
    lxor,
    iinc,
    //Conversions
    i2l,
    i2f,
    i2d,
    l2i,
    l2f,
    l2d,
    f2i,
    f2l,
    f2d,
    d2i,
    d2l,
    d2f,
    i2b,
    i2c,
    i2s,
    //Comparisons
    lcmp,
    fcmpl,
    fcmpg,
    dcmpl,
    dcmpg,
    ifeq,
    ifne,
    iflt,
    ifge,
    ifgt,
    ifle,
    if_icmpeq,
    if_icmpne,
    if_icmplt,
    if_icmpge,
    if_icmpgt,
    if_icmple,
    if_acmpeq,
    if_acmpne,
    //Control
    goto,
    jsr, //deprecated
    ret, //deprecated
    tableswitch,
    lookupswitch,
    ireturn,
    lreturn,
    freturn,
    dreturn,
    areturn,
    return_void,
    //References
    getstatic,
    putstatic,
    getfield,
    putfield,
    invokevirtual,
    invokespecial,
    invokestatic,
    invokeinterface,
    invokedynamic,
    new,
    newarray,
    anewarray,
    arraylength,
    athrow,
    checkcast,
    instanceof,
    monitorenter,
    monitorexit,
    //Extended
    wide, //deprecated
    multianewarray,
    ifnull,
    ifnonnull,
    goto_w, //deprecated
    jsr_w,  //deprecated
    reserved,
    breakpoint,
    impdep1,
    impdep2,
}

impl From<u8> for OpCode {
    #[inline]
    fn from(v: u8) -> Self {
        match v {
            0 => OpCode::nop,
            1 => OpCode::aconst_null,
            2 => OpCode::iconst_m1,
            3 => OpCode::iconst_0,
            4 => OpCode::iconst_1,
            5 => OpCode::iconst_2,
            6 => OpCode::iconst_3,
            7 => OpCode::iconst_4,
            8 => OpCode::iconst_5,
            9 => OpCode::lconst_0,
            10 => OpCode::lconst_1,
            11 => OpCode::fconst_0,
            12 => OpCode::fconst_1,
            13 => OpCode::fconst_2,
            14 => OpCode::dconst_0,
            15 => OpCode::dconst_1,
            16 => OpCode::bipush,
            17 => OpCode::sipush,
            18 => OpCode::ldc,
            19 => OpCode::ldc_w,
            20 => OpCode::ldc2_w,
            21 => OpCode::iload,
            22 => OpCode::lload,
            23 => OpCode::fload,
            24 => OpCode::dload,
            25 => OpCode::aload,
            26 => OpCode::iload_0,
            27 => OpCode::iload_1,
            28 => OpCode::iload_2,
            29 => OpCode::iload_3,
            30 => OpCode::lload_0,
            31 => OpCode::lload_1,
            32 => OpCode::lload_2,
            33 => OpCode::lload_3,
            34 => OpCode::fload_0,
            35 => OpCode::fload_1,
            36 => OpCode::fload_2,
            37 => OpCode::fload_3,
            38 => OpCode::dload_0,
            39 => OpCode::dload_1,
            40 => OpCode::dload_2,
            41 => OpCode::dload_3,
            42 => OpCode::aload_0,
            43 => OpCode::aload_1,
            44 => OpCode::aload_2,
            45 => OpCode::aload_3,
            46 => OpCode::iaload,
            47 => OpCode::laload,
            48 => OpCode::faload,
            49 => OpCode::daload,
            50 => OpCode::aaload,
            51 => OpCode::baload,
            52 => OpCode::caload,
            53 => OpCode::saload,
            54 => OpCode::istore,
            55 => OpCode::lstore,
            56 => OpCode::fstore,
            57 => OpCode::dstore,
            58 => OpCode::astore,
            59 => OpCode::istore_0,
            60 => OpCode::istore_1,
            61 => OpCode::istore_2,
            62 => OpCode::istore_3,
            63 => OpCode::lstore_0,
            64 => OpCode::lstore_1,
            65 => OpCode::lstore_2,
            66 => OpCode::lstore_3,
            67 => OpCode::fstore_0,
            68 => OpCode::fstore_1,
            69 => OpCode::fstore_2,
            70 => OpCode::fstore_3,
            71 => OpCode::dstore_0,
            72 => OpCode::dstore_1,
            73 => OpCode::dstore_2,
            74 => OpCode::dstore_3,
            75 => OpCode::astore_0,
            76 => OpCode::astore_1,
            77 => OpCode::astore_2,
            78 => OpCode::astore_3,
            79 => OpCode::iastore,
            80 => OpCode::lastore,
            81 => OpCode::fastore,
            82 => OpCode::dastore,
            83 => OpCode::aastore,
            84 => OpCode::bastore,
            85 => OpCode::castore,
            86 => OpCode::sastore,
            87 => OpCode::pop,
            88 => OpCode::pop2,
            89 => OpCode::dup,
            90 => OpCode::dup_x1,
            91 => OpCode::dup_x2,
            92 => OpCode::dup2,
            93 => OpCode::dup2_x1,
            94 => OpCode::dup_x2,
            95 => OpCode::swap,
            96 => OpCode::iadd,
            97 => OpCode::ladd,
            98 => OpCode::fadd,
            99 => OpCode::dadd,
            100 => OpCode::isub,
            101 => OpCode::lsub,
            102 => OpCode::fsub,
            103 => OpCode::dsub,
            104 => OpCode::imul,
            105 => OpCode::lmul,
            106 => OpCode::fmul,
            107 => OpCode::dmul,
            108 => OpCode::idiv,
            109 => OpCode::ldiv,
            110 => OpCode::fdiv,
            111 => OpCode::ddiv,
            112 => OpCode::irem,
            113 => OpCode::lrem,
            114 => OpCode::frem,
            115 => OpCode::drem,
            116 => OpCode::ineg,
            117 => OpCode::lneg,
            118 => OpCode::fneg,
            119 => OpCode::dneg,
            120 => OpCode::ishl,
            121 => OpCode::lshl,
            122 => OpCode::ishr,
            123 => OpCode::lshr,
            124 => OpCode::iushr,
            125 => OpCode::lushr,
            126 => OpCode::iand,
            127 => OpCode::land,
            128 => OpCode::ior,
            129 => OpCode::lor,
            130 => OpCode::ixor,
            131 => OpCode::lxor,
            132 => OpCode::iinc,
            133 => OpCode::i2l,
            134 => OpCode::i2f,
            135 => OpCode::i2d,
            136 => OpCode::l2i,
            137 => OpCode::l2f,
            138 => OpCode::l2d,
            139 => OpCode::f2i,
            140 => OpCode::f2l,
            141 => OpCode::f2d,
            142 => OpCode::d2i,
            143 => OpCode::d2l,
            144 => OpCode::d2f,
            145 => OpCode::i2b,
            146 => OpCode::i2c,
            147 => OpCode::i2s,
            148 => OpCode::lcmp,
            149 => OpCode::fcmpl,
            150 => OpCode::fcmpg,
            151 => OpCode::dcmpl,
            152 => OpCode::dcmpg,
            153 => OpCode::ifeq,
            154 => OpCode::ifne,
            155 => OpCode::iflt,
            156 => OpCode::ifge,
            157 => OpCode::ifgt,
            158 => OpCode::ifle,
            159 => OpCode::if_icmpeq,
            160 => OpCode::if_icmpne,
            161 => OpCode::if_icmplt,
            162 => OpCode::if_icmpge,
            163 => OpCode::if_icmpgt,
            164 => OpCode::if_icmple,
            165 => OpCode::if_acmpeq,
            166 => OpCode::if_acmpne,
            167 => OpCode::goto,
            168 => OpCode::jsr,
            169 => OpCode::ret,
            170 => OpCode::tableswitch,
            171 => OpCode::lookupswitch,
            172 => OpCode::ireturn,
            173 => OpCode::lreturn,
            174 => OpCode::freturn,
            175 => OpCode::dreturn,
            176 => OpCode::areturn,
            177 => OpCode::return_void,
            178 => OpCode::getstatic,
            179 => OpCode::putstatic,
            180 => OpCode::getfield,
            181 => OpCode::putfield,
            182 => OpCode::invokevirtual,
            183 => OpCode::invokespecial,
            184 => OpCode::invokestatic,
            185 => OpCode::invokeinterface,
            186 => OpCode::invokedynamic,
            187 => OpCode::new,
            188 => OpCode::newarray,
            189 => OpCode::anewarray,
            190 => OpCode::arraylength,
            191 => OpCode::athrow,
            192 => OpCode::checkcast,
            193 => OpCode::instanceof,
            194 => OpCode::monitorenter,
            195 => OpCode::monitorexit,
            196 => OpCode::wide,
            197 => OpCode::multianewarray,
            198 => OpCode::ifnull,
            199 => OpCode::ifnonnull,
            200 => OpCode::goto_w,
            201 => OpCode::jsr_w,
            202 => OpCode::breakpoint,
            254 => OpCode::impdep1,
            255 => OpCode::impdep2,
            _ => OpCode::reserved,
        }
    }
}

impl Into<&'static str> for OpCode {
    fn into(self) -> &'static str {
        match self {
            OpCode::nop => "nop",
            OpCode::aconst_null => "aconst_null",
            OpCode::iconst_m1 => "iconst_m1",
            OpCode::iconst_0 => "iconst_0",
            OpCode::iconst_1 => "iconst_1",
            OpCode::iconst_2 => "iconst_2",
            OpCode::iconst_3 => "iconst_3",
            OpCode::iconst_4 => "iconst_4",
            OpCode::iconst_5 => "iconst_5",
            OpCode::lconst_0 => "lconst_0",
            OpCode::lconst_1 => "lconst_1",
            OpCode::fconst_0 => "fconst_0",
            OpCode::fconst_1 => "fconst_1",
            OpCode::fconst_2 => "fconst_2",
            OpCode::dconst_0 => "dconst_0",
            OpCode::dconst_1 => "dconst_1",
            OpCode::bipush => "bipush",
            OpCode::sipush => "sipush",
            OpCode::ldc => "ldc",
            OpCode::ldc_w => "ldc_w",
            OpCode::ldc2_w => "ldc2_w",
            OpCode::iload => "iload",
            OpCode::lload => "lload",
            OpCode::fload => "fload",
            OpCode::dload => "dload",
            OpCode::aload => "aload",
            OpCode::iload_0 => "iload_0",
            OpCode::iload_1 => "iload_1",
            OpCode::iload_2 => "iload_2",
            OpCode::iload_3 => "iload_3",
            OpCode::lload_0 => "lload_0",
            OpCode::lload_1 => "lload_1",
            OpCode::lload_2 => "lload_2",
            OpCode::lload_3 => "lload_3",
            OpCode::fload_0 => "fload_0",
            OpCode::fload_1 => "fload_1",
            OpCode::fload_2 => "fload_2",
            OpCode::fload_3 => "fload_3",
            OpCode::dload_0 => "dload_0",
            OpCode::dload_1 => "dload_1",
            OpCode::dload_2 => "dload_2",
            OpCode::dload_3 => "dload_3",
            OpCode::aload_0 => "aload_0",
            OpCode::aload_1 => "aload_1",
            OpCode::aload_2 => "aload_2",
            OpCode::aload_3 => "aload_3",
            OpCode::iaload => "iaload",
            OpCode::laload => "laload",
            OpCode::faload => "faload",
            OpCode::daload => "daload",
            OpCode::aaload => "aaload",
            OpCode::baload => "baload",
            OpCode::caload => "caload",
            OpCode::saload => "saload",
            OpCode::istore => "istore",
            OpCode::lstore => "lstore",
            OpCode::fstore => "fstore",
            OpCode::dstore => "dstore",
            OpCode::astore => "astore",
            OpCode::istore_0 => "istore_0",
            OpCode::istore_1 => "istore_1",
            OpCode::istore_2 => "istore_2",
            OpCode::istore_3 => "istore_3",
            OpCode::lstore_0 => "lstore_0",
            OpCode::lstore_1 => "lstore_1",
            OpCode::lstore_2 => "lstore_2",
            OpCode::lstore_3 => "lstore_3",
            OpCode::fstore_0 => "fstore_0",
            OpCode::fstore_1 => "fstore_1",
            OpCode::fstore_2 => "fstore_2",
            OpCode::fstore_3 => "fstore_3",
            OpCode::dstore_0 => "dstore_0",
            OpCode::dstore_1 => "dstore_1",
            OpCode::dstore_2 => "dstore_2",
            OpCode::dstore_3 => "dstore_3",
            OpCode::astore_0 => "astore_0",
            OpCode::astore_1 => "astore_1",
            OpCode::astore_2 => "astore_2",
            OpCode::astore_3 => "astore_3",
            OpCode::iastore => "iastore",
            OpCode::lastore => "lastore",
            OpCode::fastore => "fastore",
            OpCode::dastore => "dastore",
            OpCode::aastore => "aastore",
            OpCode::bastore => "bastore",
            OpCode::castore => "castore",
            OpCode::sastore => "sastore",
            OpCode::pop => "pop",
            OpCode::pop2 => "pop2",
            OpCode::dup => "dup",
            OpCode::dup_x1 => "dup_x1",
            OpCode::dup_x2 => "dup_x2",
            OpCode::dup2 => "dup2",
            OpCode::dup2_x1 => "dup2_x1",
            OpCode::dup2_x2 => "dup2_x2",
            OpCode::swap => "swap",
            OpCode::iadd => "iadd",
            OpCode::ladd => "ladd",
            OpCode::fadd => "fadd",
            OpCode::dadd => "dadd",
            OpCode::isub => "isub",
            OpCode::lsub => "lsub",
            OpCode::fsub => "fsub",
            OpCode::dsub => "dsub",
            OpCode::imul => "imul",
            OpCode::lmul => "lmul",
            OpCode::fmul => "fmul",
            OpCode::dmul => "dmul",
            OpCode::idiv => "idiv",
            OpCode::ldiv => "ldiv",
            OpCode::fdiv => "fdiv",
            OpCode::ddiv => "ddiv",
            OpCode::irem => "irem",
            OpCode::lrem => "lrem",
            OpCode::frem => "frem",
            OpCode::drem => "drem",
            OpCode::ineg => "ineg",
            OpCode::lneg => "lneg",
            OpCode::fneg => "fneg",
            OpCode::dneg => "dneg",
            OpCode::ishl => "ishl",
            OpCode::lshl => "lshl",
            OpCode::ishr => "ishr",
            OpCode::lshr => "lshr",
            OpCode::iushr => "iushr",
            OpCode::lushr => "lushr",
            OpCode::iand => "iand",
            OpCode::land => "land",
            OpCode::ior => "ior",
            OpCode::lor => "lor",
            OpCode::ixor => "ixor",
            OpCode::lxor => "lxor",
            OpCode::iinc => "iinc",
            OpCode::i2l => "i2l",
            OpCode::i2f => "i2f",
            OpCode::i2d => "i2d",
            OpCode::l2i => "l2i",
            OpCode::l2f => "l2f",
            OpCode::l2d => "l2d",
            OpCode::f2i => "f2i",
            OpCode::f2l => "f2l",
            OpCode::f2d => "f2d",
            OpCode::d2i => "d2i",
            OpCode::d2l => "d2l",
            OpCode::d2f => "d2f",
            OpCode::i2b => "i2b",
            OpCode::i2c => "i2c",
            OpCode::i2s => "i2s",
            OpCode::lcmp => "lcmp",
            OpCode::fcmpl => "fcmpl",
            OpCode::fcmpg => "fcmpg",
            OpCode::dcmpl => "dcmpl",
            OpCode::dcmpg => "dcmpg",
            OpCode::ifeq => "ifeq",
            OpCode::ifne => "ifne",
            OpCode::iflt => "iflt",
            OpCode::ifge => "ifge",
            OpCode::ifgt => "ifgt",
            OpCode::ifle => "ifle",
            OpCode::if_icmpeq => "if_icmpeq",
            OpCode::if_icmpne => "if_icmpne",
            OpCode::if_icmplt => "if_icmplt",
            OpCode::if_icmpge => "if_icmpge",
            OpCode::if_icmpgt => "if_icmpgt",
            OpCode::if_icmple => "if_icmple",
            OpCode::if_acmpeq => "if_acmpeq",
            OpCode::if_acmpne => "if_acmpne",
            OpCode::goto => "goto",
            OpCode::jsr => "jsr",
            OpCode::ret => "ret",
            OpCode::tableswitch => "tableswitch",
            OpCode::lookupswitch => "lookupswitch",
            OpCode::ireturn => "ireturn",
            OpCode::lreturn => "lreturn",
            OpCode::freturn => "freturn",
            OpCode::dreturn => "dreturn",
            OpCode::areturn => "areturn",
            OpCode::return_void => "return",
            OpCode::getstatic => "getstatic",
            OpCode::putstatic => "putstatic",
            OpCode::getfield => "getfield",
            OpCode::putfield => "putfield",
            OpCode::invokevirtual => "invokevirtual",
            OpCode::invokespecial => "invokespecial",
            OpCode::invokestatic => "invokestatic",
            OpCode::invokeinterface => "invokeinterface",
            OpCode::invokedynamic => "invokedynamic",
            OpCode::new => "new",
            OpCode::newarray => "newarray",
            OpCode::anewarray => "anewarray",
            OpCode::arraylength => "arraylength",
            OpCode::athrow => "athrow",
            OpCode::checkcast => "checkcast",
            OpCode::instanceof => "instanceof",
            OpCode::monitorenter => "monitorenter",
            OpCode::monitorexit => "monitorexit",
            OpCode::wide => "wide",
            OpCode::multianewarray => "multianewarray",
            OpCode::ifnull => "ifnull",
            OpCode::ifnonnull => "ifnonnull",
            OpCode::goto_w => "goto_w",
            OpCode::jsr_w => "jsr_w",
            _ => unreachable!(),
        }
    }
}

#[cfg(test)]
mod tests {
    use super::OpCode;

    #[test]
    fn t_opcode() {
        assert_eq!(OpCode::nop, OpCode::from(0));
        assert_eq!(OpCode::aconst_null, OpCode::from(1));
        assert_eq!(OpCode::iconst_m1, OpCode::from(2));
        assert_eq!(OpCode::iconst_0, OpCode::from(3));
        assert_eq!(OpCode::iconst_1, OpCode::from(4));
        assert_eq!(OpCode::iconst_2, OpCode::from(5));
        assert_eq!(OpCode::iconst_3, OpCode::from(6));
        assert_eq!(OpCode::iconst_4, OpCode::from(7));
        assert_eq!(OpCode::iconst_5, OpCode::from(8));
        assert_eq!(OpCode::lconst_0, OpCode::from(9));
        assert_eq!(OpCode::lconst_1, OpCode::from(10));
        assert_eq!(OpCode::fconst_0, OpCode::from(11));
        assert_eq!(OpCode::fconst_1, OpCode::from(12));
        assert_eq!(OpCode::fconst_2, OpCode::from(13));
        assert_eq!(OpCode::dconst_0, OpCode::from(14));
        assert_eq!(OpCode::dconst_1, OpCode::from(15));
        assert_eq!(OpCode::bipush, OpCode::from(16));
        assert_eq!(OpCode::sipush, OpCode::from(17));
        assert_eq!(OpCode::ldc, OpCode::from(18));
        assert_eq!(OpCode::ldc_w, OpCode::from(19));
        assert_eq!(OpCode::ldc2_w, OpCode::from(20));
        assert_eq!(OpCode::iload, OpCode::from(21));
        assert_eq!(OpCode::lload, OpCode::from(22));
        assert_eq!(OpCode::fload, OpCode::from(23));
        assert_eq!(OpCode::dload, OpCode::from(24));
        assert_eq!(OpCode::aload, OpCode::from(25));
        assert_eq!(OpCode::iload_0, OpCode::from(26));
        assert_eq!(OpCode::iload_1, OpCode::from(27));
        assert_eq!(OpCode::iload_2, OpCode::from(28));
        assert_eq!(OpCode::iload_3, OpCode::from(29));
        assert_eq!(OpCode::lload_0, OpCode::from(30));
        assert_eq!(OpCode::lload_1, OpCode::from(31));
        assert_eq!(OpCode::lload_2, OpCode::from(32));
        assert_eq!(OpCode::lload_3, OpCode::from(33));
        assert_eq!(OpCode::fload_0, OpCode::from(34));
        assert_eq!(OpCode::fload_1, OpCode::from(35));
        assert_eq!(OpCode::fload_2, OpCode::from(36));
        assert_eq!(OpCode::fload_3, OpCode::from(37));
        assert_eq!(OpCode::dload_0, OpCode::from(38));
        assert_eq!(OpCode::dload_1, OpCode::from(39));
        assert_eq!(OpCode::dload_2, OpCode::from(40));
        assert_eq!(OpCode::dload_3, OpCode::from(41));
        assert_eq!(OpCode::aload_0, OpCode::from(42));
        assert_eq!(OpCode::aload_1, OpCode::from(43));
        assert_eq!(OpCode::aload_2, OpCode::from(44));
        assert_eq!(OpCode::aload_3, OpCode::from(45));
        assert_eq!(OpCode::iaload, OpCode::from(46));
        assert_eq!(OpCode::laload, OpCode::from(47));
        assert_eq!(OpCode::faload, OpCode::from(48));
        assert_eq!(OpCode::daload, OpCode::from(49));
        assert_eq!(OpCode::aaload, OpCode::from(50));
        assert_eq!(OpCode::baload, OpCode::from(51));
        assert_eq!(OpCode::caload, OpCode::from(52));
        assert_eq!(OpCode::saload, OpCode::from(53));
        assert_eq!(OpCode::istore, OpCode::from(54));
        assert_eq!(OpCode::lstore, OpCode::from(55));
        assert_eq!(OpCode::fstore, OpCode::from(56));
        assert_eq!(OpCode::dstore, OpCode::from(57));
        assert_eq!(OpCode::astore, OpCode::from(58));
        assert_eq!(OpCode::istore_0, OpCode::from(59));
        assert_eq!(OpCode::istore_1, OpCode::from(60));
        assert_eq!(OpCode::istore_2, OpCode::from(61));
        assert_eq!(OpCode::istore_3, OpCode::from(62));
        assert_eq!(OpCode::lstore_0, OpCode::from(63));
        assert_eq!(OpCode::lstore_1, OpCode::from(64));
        assert_eq!(OpCode::lstore_2, OpCode::from(65));
        assert_eq!(OpCode::lstore_3, OpCode::from(66));
        assert_eq!(OpCode::fstore_0, OpCode::from(67));
        assert_eq!(OpCode::fstore_1, OpCode::from(68));
        assert_eq!(OpCode::fstore_2, OpCode::from(69));
        assert_eq!(OpCode::fstore_3, OpCode::from(70));
        assert_eq!(OpCode::dstore_0, OpCode::from(71));
        assert_eq!(OpCode::dstore_1, OpCode::from(72));
        assert_eq!(OpCode::dstore_2, OpCode::from(73));
        assert_eq!(OpCode::dstore_3, OpCode::from(74));
        assert_eq!(OpCode::astore_0, OpCode::from(75));
        assert_eq!(OpCode::astore_1, OpCode::from(76));
        assert_eq!(OpCode::astore_2, OpCode::from(77));
        assert_eq!(OpCode::astore_3, OpCode::from(78));
        assert_eq!(OpCode::iastore, OpCode::from(79));
        assert_eq!(OpCode::lastore, OpCode::from(80));
        assert_eq!(OpCode::fastore, OpCode::from(81));
        assert_eq!(OpCode::dastore, OpCode::from(82));
        assert_eq!(OpCode::aastore, OpCode::from(83));
        assert_eq!(OpCode::bastore, OpCode::from(84));
        assert_eq!(OpCode::castore, OpCode::from(85));
        assert_eq!(OpCode::sastore, OpCode::from(86));
        assert_eq!(OpCode::pop, OpCode::from(87));
        assert_eq!(OpCode::pop2, OpCode::from(88));
        assert_eq!(OpCode::dup, OpCode::from(89));
        assert_eq!(OpCode::dup_x1, OpCode::from(90));
        assert_eq!(OpCode::dup_x2, OpCode::from(91));
        assert_eq!(OpCode::dup2, OpCode::from(92));
        assert_eq!(OpCode::dup2_x1, OpCode::from(93));
        assert_eq!(OpCode::dup2_x2, OpCode::from(94));
        assert_eq!(OpCode::swap, OpCode::from(95));
        assert_eq!(OpCode::iadd, OpCode::from(96));
        assert_eq!(OpCode::ladd, OpCode::from(97));
        assert_eq!(OpCode::fadd, OpCode::from(98));
        assert_eq!(OpCode::dadd, OpCode::from(99));
        assert_eq!(OpCode::isub, OpCode::from(100));
        assert_eq!(OpCode::lsub, OpCode::from(101));
        assert_eq!(OpCode::fsub, OpCode::from(102));
        assert_eq!(OpCode::dsub, OpCode::from(103));
        assert_eq!(OpCode::imul, OpCode::from(104));
        assert_eq!(OpCode::lmul, OpCode::from(105));
        assert_eq!(OpCode::fmul, OpCode::from(106));
        assert_eq!(OpCode::dmul, OpCode::from(107));
        assert_eq!(OpCode::idiv, OpCode::from(108));
        assert_eq!(OpCode::ldiv, OpCode::from(109));
        assert_eq!(OpCode::fdiv, OpCode::from(110));
        assert_eq!(OpCode::ddiv, OpCode::from(111));
        assert_eq!(OpCode::irem, OpCode::from(112));
        assert_eq!(OpCode::lrem, OpCode::from(113));
        assert_eq!(OpCode::frem, OpCode::from(114));
        assert_eq!(OpCode::drem, OpCode::from(115));
        assert_eq!(OpCode::ineg, OpCode::from(116));
        assert_eq!(OpCode::lneg, OpCode::from(117));
        assert_eq!(OpCode::fneg, OpCode::from(118));
        assert_eq!(OpCode::dneg, OpCode::from(119));
        assert_eq!(OpCode::ishl, OpCode::from(120));
        assert_eq!(OpCode::lshl, OpCode::from(121));
        assert_eq!(OpCode::ishr, OpCode::from(122));
        assert_eq!(OpCode::lshr, OpCode::from(123));
        assert_eq!(OpCode::iushr, OpCode::from(124));
        assert_eq!(OpCode::lushr, OpCode::from(125));
        assert_eq!(OpCode::iand, OpCode::from(126));
        assert_eq!(OpCode::land, OpCode::from(127));
        assert_eq!(OpCode::ior, OpCode::from(128));
        assert_eq!(OpCode::lor, OpCode::from(129));
        assert_eq!(OpCode::ixor, OpCode::from(130));
        assert_eq!(OpCode::lxor, OpCode::from(131));
        assert_eq!(OpCode::iinc, OpCode::from(132));
        assert_eq!(OpCode::i2l, OpCode::from(133));
        assert_eq!(OpCode::i2f, OpCode::from(134));
        assert_eq!(OpCode::i2d, OpCode::from(135));
        assert_eq!(OpCode::l2i, OpCode::from(136));
        assert_eq!(OpCode::l2f, OpCode::from(137));
        assert_eq!(OpCode::l2d, OpCode::from(138));
        assert_eq!(OpCode::f2i, OpCode::from(139));
        assert_eq!(OpCode::f2l, OpCode::from(140));
        assert_eq!(OpCode::f2d, OpCode::from(141));
        assert_eq!(OpCode::d2i, OpCode::from(142));
        assert_eq!(OpCode::d2l, OpCode::from(143));
        assert_eq!(OpCode::d2f, OpCode::from(144));
        assert_eq!(OpCode::i2b, OpCode::from(145));
        assert_eq!(OpCode::i2c, OpCode::from(146));
        assert_eq!(OpCode::i2s, OpCode::from(147));
        assert_eq!(OpCode::lcmp, OpCode::from(148));
        assert_eq!(OpCode::fcmpl, OpCode::from(149));
        assert_eq!(OpCode::fcmpg, OpCode::from(150));
        assert_eq!(OpCode::dcmpl, OpCode::from(151));
        assert_eq!(OpCode::dcmpg, OpCode::from(152));
        assert_eq!(OpCode::ifeq, OpCode::from(153));
        assert_eq!(OpCode::ifne, OpCode::from(154));
        assert_eq!(OpCode::iflt, OpCode::from(155));
        assert_eq!(OpCode::ifge, OpCode::from(156));
        assert_eq!(OpCode::ifgt, OpCode::from(157));
        assert_eq!(OpCode::ifle, OpCode::from(158));
        assert_eq!(OpCode::if_icmpeq, OpCode::from(159));
        assert_eq!(OpCode::if_icmpne, OpCode::from(160));
        assert_eq!(OpCode::if_icmplt, OpCode::from(161));
        assert_eq!(OpCode::if_icmpge, OpCode::from(162));
        assert_eq!(OpCode::if_icmpgt, OpCode::from(163));
        assert_eq!(OpCode::if_icmple, OpCode::from(164));
        assert_eq!(OpCode::if_acmpeq, OpCode::from(165));
        assert_eq!(OpCode::if_acmpne, OpCode::from(166));
        assert_eq!(OpCode::goto, OpCode::from(167));
        assert_eq!(OpCode::jsr, OpCode::from(168));
        assert_eq!(OpCode::ret, OpCode::from(169));
        assert_eq!(OpCode::tableswitch, OpCode::from(170));
        assert_eq!(OpCode::lookupswitch, OpCode::from(171));
        assert_eq!(OpCode::ireturn, OpCode::from(172));
        assert_eq!(OpCode::lreturn, OpCode::from(173));
        assert_eq!(OpCode::freturn, OpCode::from(174));
        assert_eq!(OpCode::dreturn, OpCode::from(175));
        assert_eq!(OpCode::areturn, OpCode::from(176));
        assert_eq!(OpCode::return_void, OpCode::from(177));
        assert_eq!(OpCode::getstatic, OpCode::from(178));
        assert_eq!(OpCode::putstatic, OpCode::from(179));
        assert_eq!(OpCode::getfield, OpCode::from(180));
        assert_eq!(OpCode::putfield, OpCode::from(181));
        assert_eq!(OpCode::invokevirtual, OpCode::from(182));
        assert_eq!(OpCode::invokespecial, OpCode::from(183));
        assert_eq!(OpCode::invokestatic, OpCode::from(184));
        assert_eq!(OpCode::invokeinterface, OpCode::from(185));
        assert_eq!(OpCode::invokedynamic, OpCode::from(186));
        assert_eq!(OpCode::new, OpCode::from(187));
        assert_eq!(OpCode::newarray, OpCode::from(188));
        assert_eq!(OpCode::anewarray, OpCode::from(189));
        assert_eq!(OpCode::arraylength, OpCode::from(190));
        assert_eq!(OpCode::athrow, OpCode::from(191));
        assert_eq!(OpCode::checkcast, OpCode::from(192));
        assert_eq!(OpCode::instanceof, OpCode::from(193));
        assert_eq!(OpCode::monitorenter, OpCode::from(194));
        assert_eq!(OpCode::monitorexit, OpCode::from(195));
        assert_eq!(OpCode::wide, OpCode::from(196));
        assert_eq!(OpCode::multianewarray, OpCode::from(197));
        assert_eq!(OpCode::ifnull, OpCode::from(198));
        assert_eq!(OpCode::ifnonnull, OpCode::from(199));
        assert_eq!(OpCode::goto_w, OpCode::from(200));
        assert_eq!(OpCode::jsr_w, OpCode::from(201));
        assert_eq!(OpCode::breakpoint, OpCode::from(202));
        //        assert_eq!(OpCode::, OpCode::from(203));
        //        assert_eq!(OpCode::, OpCode::from(204));
        //        assert_eq!(OpCode::, OpCode::from(205));
        //        assert_eq!(OpCode::, OpCode::from(206));
        //        assert_eq!(OpCode::, OpCode::from(207));
        //        assert_eq!(OpCode::, OpCode::from(208));
        //        assert_eq!(OpCode::, OpCode::from(209));
        //        assert_eq!(OpCode::, OpCode::from(210));
        //        assert_eq!(OpCode::, OpCode::from(211));
        //        assert_eq!(OpCode::, OpCode::from(212));
        //        assert_eq!(OpCode::, OpCode::from(213));
        //        assert_eq!(OpCode::, OpCode::from(214));
        //        assert_eq!(OpCode::, OpCode::from(215));
        //        assert_eq!(OpCode::, OpCode::from(216));
        //        assert_eq!(OpCode::, OpCode::from(217));
        //        assert_eq!(OpCode::, OpCode::from(218));
        //        assert_eq!(OpCode::, OpCode::from(219));
        //        assert_eq!(OpCode::, OpCode::from(220));
        //        assert_eq!(OpCode::, OpCode::from(221));
        //        assert_eq!(OpCode::, OpCode::from(222));
        //        assert_eq!(OpCode::, OpCode::from(223));
        //        assert_eq!(OpCode::, OpCode::from(224));
        //        assert_eq!(OpCode::, OpCode::from(225));
        //        assert_eq!(OpCode::, OpCode::from(226));
        //        assert_eq!(OpCode::, OpCode::from(227));
        //        assert_eq!(OpCode::, OpCode::from(228));
        //        assert_eq!(OpCode::, OpCode::from(229));
        //        assert_eq!(OpCode::, OpCode::from(230));
        //        assert_eq!(OpCode::, OpCode::from(231));
        //        assert_eq!(OpCode::, OpCode::from(232));
        //        assert_eq!(OpCode::, OpCode::from(233));
        //        assert_eq!(OpCode::, OpCode::from(234));
        //        assert_eq!(OpCode::, OpCode::from(235));
        //        assert_eq!(OpCode::, OpCode::from(236));
        //        assert_eq!(OpCode::, OpCode::from(237));
        //        assert_eq!(OpCode::, OpCode::from(238));
        //        assert_eq!(OpCode::, OpCode::from(239));
        //        assert_eq!(OpCode::, OpCode::from(240));
        //        assert_eq!(OpCode::, OpCode::from(241));
        //        assert_eq!(OpCode::, OpCode::from(242));
        //        assert_eq!(OpCode::, OpCode::from(243));
        //        assert_eq!(OpCode::, OpCode::from(244));
        //        assert_eq!(OpCode::, OpCode::from(245));
        //        assert_eq!(OpCode::, OpCode::from(246));
        //        assert_eq!(OpCode::, OpCode::from(247));
        //        assert_eq!(OpCode::, OpCode::from(248));
        //        assert_eq!(OpCode::, OpCode::from(249));
        //        assert_eq!(OpCode::, OpCode::from(250));
        //        assert_eq!(OpCode::, OpCode::from(251));
        //        assert_eq!(OpCode::, OpCode::from(252));
        //        assert_eq!(OpCode::, OpCode::from(253));
        assert_eq!(OpCode::impdep1, OpCode::from(254));
        assert_eq!(OpCode::impdep2, OpCode::from(255));
        //        assert_eq!(OpCode::, OpCode::from(256));
    }
}


================================================
FILE: crates/classfile/src/signature.rs
================================================
use crate::BytesRef;
use std::fmt::Formatter;

#[derive(Clone, PartialEq)]
pub enum Type {
    Byte,
    Char,
    Double,
    Float,
    Int,
    Long,
    //the 1st, container class
    //the 2nd, generic class's arg
    //the 3rd, if there is a '+'
    //  Ljava/util/List<Lcom/google/inject/Module;>;)
    //    => java.util.List<com.google.inject.Module>
    //  Ljava/lang/Class<+Lcom/google/inject/Module;>;
    //    => java.lang.Class<? extends com.google.inject.Module>
    Object(BytesRef, Option<Vec<Type>>, Option<u8>),
    Short,
    Boolean,
    Array(BytesRef),
    Void,
}

impl std::fmt::Debug for Type {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            Type::Byte => write!(f, "B"),
            Type::Char => write!(f, "C"),
            Type::Double => write!(f, "D"),
            Type::Float => write!(f, "F"),
            Type::Int => write!(f, "I"),
            Type::Long => write!(f, "J"),
            Type::Object(container, args, prefix) => {
                write!(f, "Object(");
                write!(f, "\"{}\",", String::from_utf8_lossy(container.as_slice()));
                write!(f, "{:?},", args);
                write!(f, "{:?}", prefix);
                write!(f, ")")
            }
            Type::Short => write!(f, "S"),
            Type::Boolean => write!(f, "Z"),
            Type::Array(desc) => write!(f, "Array({})", String::from_utf8_lossy(desc.as_slice())),
            Type::Void => write!(f, "V"),
        }
    }
}


================================================
FILE: crates/classfile/src/version.rs
================================================
use crate::U2;

#[derive(Debug)]
pub struct Version {
    pub minor: U2,
    pub major: U2,
}


================================================
FILE: crates/vm/Cargo.toml
================================================
[package]
name = "vm"
version = "0.1.0"
authors = ["Dou Chuan <1843657913@qq.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
chrono = "0.4"
classfile = { path = "../classfile", version = "0.1.0" }
class-parser = { path="../class-parser", version="0.1.0" }
dirs = "3.0.1"
lazy_static = "1.4.0"
libc = "0.2.85"
log = "0.4"
nix = "0.19.1"
rustc-hash = "1.1.0"
zip = "0.5.9"


================================================
FILE: crates/vm/README.md
================================================
## Java Virtual Machine
This is the `vm` crate, which contains implementation of Java Virtual Machine.
The implementation based on `Java SE 8 Edition`.

================================================
FILE: crates/vm/src/lib.rs
================================================
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;

//contains macros, must be here
#[macro_use]
pub mod util;

pub mod native;
pub mod oop;
pub mod runtime;
pub mod types;

pub fn init_vm() {
    oop::init();
    runtime::init();
    native::init();
}

#[inline]
pub fn new_br(s: &str) -> classfile::BytesRef {
    std::sync::Arc::new(Vec::from(s))
}


================================================
FILE: crates/vm/src/native/common/check_format.rs
================================================
// pub fn is_valid_class_name(s: &String) -> bool {
//     if s.contains("/") {
//         return false;
//     }
//
//     true
// }


================================================
FILE: crates/vm/src/native/common/mod.rs
================================================
mod check_format;
pub mod reflect;


================================================
FILE: crates/vm/src/native/common/reflect.rs
================================================
#![allow(non_snake_case)]

use crate::native::java_lang_Class;
use crate::oop::{self, Class, Oop, OopPtr};
use crate::runtime::{self, require_class3};
use crate::types::*;
use crate::util;
use class_parser::{FieldSignature, MethodSignature};
use classfile::consts as cls_const;
use classfile::SignatureType;
use std::sync::Arc;

pub fn new_field(fir: FieldIdRef) -> Oop {
    let field_cls = runtime::require_class3(None, cls_const::J_FIELD).unwrap();

    let clazz = fir.field.class.get_class().get_mirror();

    let field_sig = FieldSignature::new(fir.field.desc.as_slice());
    let typ_mirror = create_value_type(field_sig.field_type);
    let desc = unsafe { std::str::from_utf8_unchecked(fir.field.desc.as_slice()) };
    let signature = util::oop::new_java_lang_string2(desc);

    let field_name = unsafe { std::str::from_utf8_unchecked(fir.field.name.as_slice()) };
    let mut desc = Vec::new();
    desc.push(b'(');
    let mut args: Vec<Oop> = vec![
        ("clazz", "Ljava/lang/Class;", clazz),
        (
            "name",
            "Ljava/lang/String;",
            util::oop::new_java_lang_string2(field_name),
        ),
        ("type", "Ljava/lang/Class;", typ_mirror),
        ("modifiers", "I", Oop::new_int(fir.field.acc_flags as i32)),
        ("slot", "I", Oop::new_int(fir.offset as i32)),
        ("signature", "Ljava/lang/String;", signature),
        ("annotations", "[B", Oop::Null),
    ]
    .iter()
    .map(|(_, t, v)| {
        desc.extend_from_slice(t.as_bytes());
        v.clone()
    })
    .collect();
    desc.extend_from_slice(b")V");

    let oop = Oop::new_inst(field_cls.clone());
    args.insert(0, oop.clone());
    runtime::invoke::invoke_ctor(field_cls, Arc::new(desc), args);

    oop
}

pub fn new_method_ctor(mir: MethodIdRef) -> Oop {
    let ctor_cls = require_class3(None, cls_const::J_METHOD_CTOR).unwrap();

    //declaringClass
    let declaring_cls = mir.method.class.get_class().get_mirror();

    //parameterTypes
    let signature = MethodSignature::new(mir.method.desc.as_slice());
    let params: Vec<Oop> = signature
        .args
        .iter()
        .map(|t| create_value_type(t.clone()))
        .collect();
    let cls = require_class3(None, b"[Ljava/lang/Class;").unwrap();
    let parameter_types = Oop::new_ref_ary2(cls, params);

    //fixme: checkedExceptions
    let cls = require_class3(None, b"[Ljava/lang/Class;").unwrap();
    let checked_exceptions = Oop::new_ref_ary2(cls, vec![]);

    //modifiers
    let modifiers = mir.method.acc_flags;
    //slot
    let slot = mir.offset;
    //signature
    let desc = unsafe { std::str::from_utf8_unchecked(mir.method.desc.as_slice()) };
    let signature = util::oop::new_java_lang_string2(desc);
    let annotations = {
        let raw = mir.method.get_annotation();
        match raw {
            Some(raw) => Oop::new_byte_ary2(raw.to_vec()),
            None => Oop::Null,
        }
    };
    let parameter_annotations = {
        let raw = mir.method.get_param_annotation();
        match raw {
            Some(raw) => Oop::new_byte_ary2(raw.to_vec()),
            None => Oop::Null,
        }
    };

    let mut desc = Vec::new();
    desc.push(b'(');
    let mut args: Vec<Oop> = vec![
        ("declaringClass", "Ljava/lang/Class;", declaring_cls),
        ("parameterTypes", "[Ljava/lang/Class;", parameter_types),
        (
            "checkedExceptions",
            "[Ljava/lang/Class;",
            checked_exceptions,
        ),
        ("modifiers", "I", Oop::new_int(modifiers as i32)),
        ("slot", "I", Oop::new_int(slot as i32)),
        ("signature", "Ljava/lang/String;", signature),
        ("annotations", "[B", annotations),
        ("parameterAnnotations", "[B", parameter_annotations),
    ]
    .iter()
    .map(|(_, t, v)| {
        desc.extend_from_slice(t.as_bytes());
        v.clone()
    })
    .collect();
    desc.extend_from_slice(b")V");

    let oop = Oop::new_inst(ctor_cls.clone());
    args.insert(0, oop.clone());
    runtime::invoke::invoke_ctor(ctor_cls, Arc::new(desc), args);

    oop
}

pub fn new_method_normal(mir: MethodIdRef) -> Oop {
    let ctor_cls = require_class3(None, cls_const::J_METHOD).unwrap();

    //declaringClass
    let declaring_cls = mir.method.class.get_class().get_mirror();

    //name
    let name = {
        let name = unsafe { std::str::from_utf8_unchecked(mir.method.name.as_slice()) };
        util::oop::new_java_lang_string2(name)
    };

    //parameterTypes
    let signature = MethodSignature::new(mir.method.desc.as_slice());
    let params: Vec<Oop> = signature
        .args
        .iter()
        .map(|t| create_value_type(t.clone()))
        .collect();
    let cls = require_class3(None, b"[Ljava/lang/Class;").unwrap();
    let parameter_types = Oop::new_ref_ary2(cls, params);

    //returnType
    let return_type = create_value_type(signature.retype);

    //fixme: checkedExceptions
    let cls = require_class3(None, b"[Ljava/lang/Class;").unwrap();
    let checked_exceptions = Oop::new_ref_ary2(cls, vec![]);

    //modifiers
    let modifiers = mir.method.acc_flags;
    //slot
    let slot = mir.offset;
    //signature
    let signature = {
        let desc = unsafe { std::str::from_utf8_unchecked(mir.method.desc.as_slice()) };
        util::oop::new_java_lang_string2(desc)
    };
    let annotations = {
        let raw = mir.method.get_annotation();
        match raw {
            Some(raw) => Oop::new_byte_ary2(raw.to_vec()),
            None => Oop::Null,
        }
    };
    let parameter_annotations = {
        let raw = mir.method.get_param_annotation();
        match raw {
            Some(raw) => Oop::new_byte_ary2(raw.to_vec()),
            None => Oop::Null,
        }
    };
    let annotation_default = {
        let raw = mir.method.get_annotation_default();
        match raw {
            Some(raw) => Oop::new_byte_ary2(raw.to_vec()),
            None => Oop::Null,
        }
    };

    let mut desc = Vec::new();
    desc.push(b'(');
    let mut args: Vec<Oop> = vec![
        ("declaringClass", "Ljava/lang/Class;", declaring_cls),
        ("name", "Ljava/lang/String;", name),
        ("parameterTypes", "[Ljava/lang/Class;", parameter_types),
        ("returnType", "Ljava/lang/Class;", return_type),
        (
            "checkedExceptions",
            "[Ljava/lang/Class;",
            checked_exceptions,
        ),
        ("modifiers", "I", Oop::new_int(modifiers as i32)),
        ("slot", "I", Oop::new_int(slot as i32)),
        ("signature", "Ljava/lang/String;", signature),
        ("annotations", "[B", annotations),
        ("parameterAnnotations", "[B", parameter_annotations),
        ("annotationDefault", "[B", annotation_default),
    ]
    .iter()
    .map(|(_, t, v)| {
        desc.extend_from_slice(t.as_bytes());
        v.clone()
    })
    .collect();
    desc.extend_from_slice(b")V");

    let oop = Oop::new_inst(ctor_cls.clone());
    args.insert(0, oop.clone());
    runtime::invoke::invoke_ctor(ctor_cls, Arc::new(desc), args);

    oop
}

pub fn get_Constructor_clazz(ctor: &Oop) -> Oop {
    //todo: optimize, avoid obtain class
    let cls = {
        let rf = ctor.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };

    //todo: optimize, avoid obtain id
    let cls = cls.get_class();
    let id = cls.get_field_id(&util::S_CLAZZ, &util::S_JAVA_LANG_CLASS, false);
    Class::get_field_value(ctor.extract_ref(), id)
}

/*
pub fn get_Constructor_slot(ctor: &Oop) -> i32 {
    let cls = {
        let v = util::oop::extract_ref(ctor);
        let v = v.read().unwrap();
        match &v.v {
            oop::RefKind::Inst(inst) => inst.class.clone(),
            _ => unreachable!(),
        }
    };

    let cls = cls.read().unwrap();
    let id = cls.get_field_id(b"slot", b"I", false);
    let v = cls.get_field_value(ctor, id);
    util::oop::extract_int(&v)
}
*/

pub fn get_Constructor_signature(ctor: &Oop) -> String {
    //todo: optimisze, cache Constructor cls, avoid obtain class
    let cls = {
        let rf = ctor.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };

    //todo: optimize, cache id
    let cls = cls.get_class();
    let id = cls.get_field_id(&util::S_SIGNATURE, &util::S_JAVA_LANG_STRING, false);
    let v = Class::get_field_value(ctor.extract_ref(), id);
    OopPtr::java_lang_string(v.extract_ref())
}

fn create_value_type(t: SignatureType) -> Oop {
    match t {
        SignatureType::Byte => java_lang_Class::get_primitive_class_mirror("B").unwrap(),
        SignatureType::Char => java_lang_Class::get_primitive_class_mirror("C").unwrap(),
        SignatureType::Int => java_lang_Class::get_primitive_class_mirror("I").unwrap(),
        SignatureType::Double => java_lang_Class::get_primitive_class_mirror("D").unwrap(),
        SignatureType::Float => java_lang_Class::get_primitive_class_mirror("F").unwrap(),
        SignatureType::Long => java_lang_Class::get_primitive_class_mirror("J").unwrap(),
        SignatureType::Object(desc, _, _) => {
            let len = desc.len();
            let name = &desc.as_slice()[1..len - 1];
            let cls = require_class3(None, name).unwrap();
            let cls = cls.get_class();
            cls.get_mirror()
        }
        SignatureType::Short => java_lang_Class::get_primitive_class_mirror("S").unwrap(),
        SignatureType::Boolean => java_lang_Class::get_primitive_class_mirror("Z").unwrap(),
        SignatureType::Array(desc) => {
            let cls = require_class3(None, desc.as_slice()).unwrap();
            let cls = cls.get_class();
            cls.get_mirror()
        }
        SignatureType::Void => java_lang_Class::get_primitive_class_mirror("V").unwrap(),
    }
}


================================================
FILE: crates/vm/src/native/java_io_FileDescriptor.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::Oop;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![new_fn("initIDs", "()V", Box::new(jvm_initIDs))]
}

fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}


================================================
FILE: crates/vm/src/native/java_io_FileInputStream.rs
================================================
#![allow(non_snake_case)]
use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{Class, Oop, OopPtr};
use crate::runtime::{self, require_class3};
use crate::util;
use classfile::consts as cls_consts;

static mut FILE_INPUT_STREAM_FD: usize = 0;
static mut FILE_DESCRIPTOR_FD: usize = 0;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("initIDs", "()V", Box::new(jvm_initIDs)),
        new_fn("open0", "(Ljava/lang/String;)V", Box::new(jvm_open0)),
        new_fn("readBytes", "([BII)I", Box::new(jvm_readBytes)),
        //available0 used by zulu8 jdk
        new_fn("available0", "()I", Box::new(jvm_available0)),
        new_fn("available", "()I", Box::new(jvm_available0)),
        new_fn("close0", "()V", Box::new(jvm_close0)),
    ]
}

fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    //setup: java.io.FileInputStream fd
    let cls = require_class3(None, b"java/io/FileInputStream").unwrap();
    let cls = cls.get_class();
    let id = cls.get_field_id(&util::S_FD, &util::S_JAVA_IO_FD, false);
    unsafe {
        FILE_INPUT_STREAM_FD = id.offset;
    }

    //setup: java.io.FileDescriptor fd
    let cls = require_class3(None, b"java/io/FileDescriptor").unwrap();
    let cls = cls.get_class();
    let id = cls.get_field_id(&util::S_FD, &util::S_I, false);
    unsafe {
        FILE_DESCRIPTOR_FD = id.offset;
    }

    Ok(None)
}

fn jvm_open0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let name = {
        let v = args.get(1).unwrap();
        OopPtr::java_lang_string(v.extract_ref())
    };
    let fd = unsafe {
        use std::ffi::CString;
        let name = CString::new(name).unwrap();
        libc::open(name.as_ptr(), libc::O_RDONLY)
    };

    set_file_descriptor_fd(this, fd);

    Ok(None)
}

fn jvm_readBytes(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let fd = get_file_descriptor_fd(this);
    let byte_ary = args.get(1).unwrap();
    let off = args.get(2).unwrap().extract_int();
    let len = args.get(3).unwrap().extract_int();

    let n = {
        let rf = byte_ary.extract_ref();
        let ary = rf.extract_mut_type_array();
        let ary = ary.extract_mut_bytes();

        let (_, ptr) = ary.split_at_mut(off as usize);
        let ptr = ptr.as_mut_ptr() as *mut libc::c_void;
        let n = unsafe { libc::read(fd, ptr, len as usize) };
        // error!("readBytes n = {}", n);
        if n > 0 {
            n as i32
        } else if n == -1 {
            let ex = runtime::exception::new(
                cls_consts::J_IOEXCEPTION,
                Some(String::from("Read Error")),
            );
            error!("jvm_readBytes read error");
            return Err(ex);
        } else {
            -1
        }
    };

    Ok(Some(Oop::new_int(n)))
}

fn jvm_available0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let fd = get_file_descriptor_fd(this);

    if fd == -1 {
        unimplemented!("Stream Closed");
    }

    let mut size = -1i64;

    unsafe {
        let mut stat: libc::stat = std::mem::zeroed();
        if libc::fstat(fd, &mut stat) != -1 {
            let mode = stat.st_mode;
            if (mode & libc::S_IFIFO == libc::S_IFIFO)
                || (mode & libc::S_IFCHR == libc::S_IFCHR)
                || (mode & libc::S_IFSOCK == libc::S_IFSOCK)
            {
                let mut n = 0;
                if libc::ioctl(fd, libc::FIONREAD, &mut n) >= 0 {
                    return Ok(Some(Oop::new_int(n)));
                }
            } else if mode & libc::S_IFREG == libc::S_IFREG {
                size = stat.st_size;
            }
        }

        let current = libc::lseek(fd, 0, libc::SEEK_CUR);
        if current == -1 {
            return Ok(Some(Oop::new_int(0)));
        }

        if size < current {
            size = libc::lseek(fd, 0, libc::SEEK_END);
            if size == -1 {
                return Ok(Some(Oop::new_int(0)));
            }

            if libc::lseek(fd, current, libc::SEEK_SET) == -1 {
                return Ok(Some(Oop::new_int(0)));
            }
        }

        Ok(Some(Oop::new_int((size - current) as i32)))
    }
}

fn jvm_close0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let fd = get_file_descriptor_fd(this);
    unsafe {
        libc::close(fd);
    }
    Ok(None)
}

fn set_file_descriptor_fd(fin: &Oop, fd: i32) {
    let offset = unsafe { FILE_INPUT_STREAM_FD };
    let fd_this = Class::get_field_value2(fin.extract_ref(), offset);

    let offset = unsafe { FILE_DESCRIPTOR_FD };
    Class::put_field_value2(fd_this.extract_ref(), offset, Oop::new_int(fd));
}

fn get_file_descriptor_fd(fin: &Oop) -> i32 {
    let offset = unsafe { FILE_INPUT_STREAM_FD };
    let fd_this = Class::get_field_value2(fin.extract_ref(), offset);

    let offset = unsafe { FILE_DESCRIPTOR_FD };
    let fd = Class::get_field_value2(fd_this.extract_ref(), offset);
    fd.extract_int()
}


================================================
FILE: crates/vm/src/native/java_io_FileOutputStream.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{Class, Oop, OopPtr};
use crate::runtime::require_class3;
use crate::util;

static mut FILE_OUTPUT_STREAM_FD: usize = 0;
static mut FILE_DESCRIPTOR_FD: usize = 0;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("initIDs", "()V", Box::new(jvm_initIDs)),
        new_fn("writeBytes", "([BIIZ)V", Box::new(jvm_writeBytes)),
        new_fn("open0", "(Ljava/lang/String;Z)V", Box::new(jvm_open0)),
    ]
}

fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    //setup: java.io.FileOutputStream fd
    let cls = require_class3(None, b"java/io/FileOutputStream").unwrap();
    let cls = cls.get_class();
    let id = cls.get_field_id(&util::S_FD, &util::S_JAVA_IO_FD, false);
    unsafe {
        FILE_OUTPUT_STREAM_FD = id.offset;
    }

    //setup: java.io.FileDescriptor fd
    let cls = require_class3(None, b"java/io/FileDescriptor").unwrap();
    let cls = cls.get_class();
    let id = cls.get_field_id(&util::S_FD, &util::S_I, false);
    unsafe {
        FILE_DESCRIPTOR_FD = id.offset;
    }

    Ok(None)
}

fn jvm_writeBytes(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let os = args.get(0).unwrap();
    let fd = get_file_descriptor_fd(os);
    let byte_ary = args.get(1).unwrap();
    let off = args.get(2).unwrap().extract_int();
    let len = args.get(3).unwrap().extract_int();
    let append = args.get(4).unwrap().extract_int();

    let rf = byte_ary.extract_ref();
    let ary = rf.extract_type_array();
    let ary = ary.extract_bytes();
    let (_, ary) = ary.split_at(off as usize);
    let len = len as usize;

    unsafe {
        if append == 1 {
            libc::lseek(fd, 0, libc::SEEK_END);
        }

        if -1 == libc::write(fd, ary.as_ptr() as *const libc::c_void, len) {
            panic!("write failed");
        }
    }

    Ok(None)
}

fn jvm_open0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let name = args.get(1).unwrap();
    let name = OopPtr::java_lang_string(name.extract_ref());
    let append = {
        let v = args.get(2).unwrap().extract_int();
        v == 1
    };
    let fd = unsafe {
        use std::ffi::CString;
        let name = CString::new(name).unwrap();
        let mut flag = libc::O_WRONLY | libc::O_CREAT;
        if append {
            flag |= libc::O_APPEND;
        } else {
            flag |= libc::O_TRUNC;
        }
        libc::open(name.as_ptr(), flag)
    };

    set_file_descriptor_fd(this, fd);

    Ok(None)
}

fn get_file_descriptor_fd(fos: &Oop) -> i32 {
    let fd_this = {
        let offset = unsafe { FILE_OUTPUT_STREAM_FD };
        Class::get_field_value2(fos.extract_ref(), offset)
    };

    let fd = {
        let offset = unsafe { FILE_DESCRIPTOR_FD };
        Class::get_field_value2(fd_this.extract_ref(), offset)
    };

    fd.extract_int()
}

fn set_file_descriptor_fd(fos: &Oop, fd: i32) {
    let fd_this = {
        let offset = unsafe { FILE_OUTPUT_STREAM_FD };
        Class::get_field_value2(fos.extract_ref(), offset)
    };

    let offset = unsafe { FILE_DESCRIPTOR_FD };
    Class::put_field_value2(fd_this.extract_ref(), offset, Oop::new_int(fd));
}


================================================
FILE: crates/vm/src/native/java_io_UnixFileSystem.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{Class, Oop, OopPtr};
use crate::runtime::require_class3;
use crate::{new_br, util};
use std::fs;

static mut FILE_PATH: usize = 0;

//FileSystem.java define
const BA_EXISTS: i32 = 0x01;
const BA_REGULAR: i32 = 0x02;
const BA_DIRECTORY: i32 = 0x04;
const _BA_HIDDEN: i32 = 0x08;
const ACCESS_READ: i32 = 0x04;
const ACCESS_WRITE: i32 = 0x02;
const ACCESS_EXECUTE: i32 = 0x01;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("initIDs", "()V", Box::new(jvm_initIDs)),
        new_fn(
            "getBooleanAttributes0",
            "(Ljava/io/File;)I",
            Box::new(jvm_getBooleanAttributes0),
        ),
        new_fn(
            "checkAccess",
            "(Ljava/io/File;I)Z",
            Box::new(jvm_checkAccess),
        ),
        new_fn(
            "canonicalize0",
            "(Ljava/lang/String;)Ljava/lang/String;",
            Box::new(jvm_canonicalize0),
        ),
        new_fn(
            "createFileExclusively",
            "(Ljava/lang/String;)Z",
            Box::new(jvm_createFileExclusively),
        ),
    ]
}

fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    let cls = require_class3(None, b"java/io/File").unwrap();
    let cls = cls.get_class();
    let fir = cls.get_field_id(&new_br("path"), &util::S_JAVA_LANG_STRING, false);
    unsafe {
        FILE_PATH = fir.offset;
    }

    Ok(None)
}

fn jvm_getBooleanAttributes0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let file = args.get(1).unwrap();
    let path = get_File_path(file);

    let mut r = 0;
    if let Ok(attr) = fs::metadata(path) {
        r |= BA_EXISTS;
        if attr.is_file() {
            r |= BA_REGULAR;
        }
        if attr.is_dir() {
            r |= BA_DIRECTORY;
        }
    }

    Ok(Some(Oop::new_int(r)))
}

fn jvm_checkAccess(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let file = args.get(1).unwrap();
    let path = get_File_path(file);

    let access = args.get(2).unwrap().extract_int();

    let mut amode = 0;
    if (access & ACCESS_READ) == ACCESS_READ {
        amode |= libc::R_OK;
    }
    if (access & ACCESS_WRITE) == ACCESS_WRITE {
        amode |= libc::W_OK;
    }
    if (access & ACCESS_EXECUTE) == ACCESS_EXECUTE {
        amode |= libc::X_OK;
    }

    let r = unsafe {
        use std::ffi::CString;
        let path = CString::new(path).unwrap();
        if libc::access(path.as_ptr(), amode) == 0 {
            1
        } else {
            0
        }
    };

    Ok(Some(Oop::new_int(r)))
}

fn jvm_canonicalize0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let path = args.get(1).unwrap();
    let path = OopPtr::java_lang_string(path.extract_ref());
    let path = std::path::Path::new(&path);
    let path = path.canonicalize().expect("path canonicalize failed");
    let path = path.to_str().expect("path to_str failed");
    let path = util::oop::new_java_lang_string2(path);

    Ok(Some(path))
}

fn jvm_createFileExclusively(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let path = args.get(1).unwrap();
    let path = OopPtr::java_lang_string(path.extract_ref());
    let v = match std::fs::OpenOptions::new()
        .read(true)
        .write(true)
        .create(true)
        .open(&path)
    {
        Ok(_) => 1,
        Err(e) => {
            error!("open {}, error = {:?}", path, e);
            0
        }
    };
    Ok(Some(Oop::new_int(v)))
}

fn get_File_path(file: &Oop) -> String {
    let offset = unsafe { FILE_PATH };
    let path = Class::get_field_value2(file.extract_ref(), offset);
    OopPtr::java_lang_string(path.extract_ref())
}


================================================
FILE: crates/vm/src/native/java_lang_Class.rs
================================================
#![allow(non_snake_case)]

use crate::native::{common, new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{self, Class, ClassKind, Oop, OopPtr, ValueType};
use crate::runtime::{self, require_class2, require_class3};
use crate::types::{ClassRef, MethodIdRef};
use crate::util;
use classfile::{constant_pool, consts as cls_consts, flags as acc};
use rustc_hash::FxHashMap;
use std::sync::{Arc, RwLock};

pub fn get_primitive_class_mirror(key: &str) -> Option<Oop> {
    //todo: avoid mutex lock, it's only read
    let mirrors = PRIM_MIRROS.read().unwrap();
    mirrors.get(key).cloned()
}

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("registerNatives", "()V", Box::new(jvm_registerNatives)),
        new_fn(
            "desiredAssertionStatus0",
            "(Ljava/lang/Class;)Z",
            Box::new(jvm_desiredAssertionStatus0),
        ),
        new_fn(
            "getPrimitiveClass",
            "(Ljava/lang/String;)Ljava/lang/Class;",
            Box::new(jvm_getPrimitiveClass),
        ),
        new_fn(
            "getDeclaredFields0",
            "(Z)[Ljava/lang/reflect/Field;",
            Box::new(jvm_getDeclaredFields0),
        ),
        new_fn("getName0", "()Ljava/lang/String;", Box::new(jvm_getName0)),
        new_fn(
            "forName0",
            "(Ljava/lang/String;ZLjava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Class;",
            Box::new(jvm_forName0),
        ),
        new_fn("isPrimitive", "()Z", Box::new(jvm_isPrimitive)),
        new_fn(
            "isAssignableFrom",
            "(Ljava/lang/Class;)Z",
            Box::new(jvm_isAssignableFrom),
        ),
        new_fn("isInterface", "()Z", Box::new(jvm_isInterface)),
        new_fn(
            "getDeclaredConstructors0",
            "(Z)[Ljava/lang/reflect/Constructor;",
            Box::new(jvm_getDeclaredConstructors0),
        ),
        new_fn("getModifiers", "()I", Box::new(jvm_getModifiers)),
        new_fn(
            "getSuperclass",
            "()Ljava/lang/Class;",
            Box::new(jvm_getSuperclass),
        ),
        new_fn("isArray", "()Z", Box::new(jvm_isArray)),
        new_fn(
            "getComponentType",
            "()Ljava/lang/Class;",
            Box::new(jvm_getComponentType),
        ),
        new_fn(
            "getEnclosingMethod0",
            "()[Ljava/lang/Object;",
            Box::new(jvm_getEnclosingMethod0),
        ),
        new_fn(
            "getDeclaringClass0",
            "()Ljava/lang/Class;",
            Box::new(jvm_getDeclaringClass0),
        ),
        new_fn(
            "isInstance",
            "(Ljava/lang/Object;)Z",
            Box::new(jvm_isInstance),
        ),
        new_fn(
            "getDeclaredMethods0",
            "(Z)[Ljava/lang/reflect/Method;",
            Box::new(jvm_getDeclaredMethods0),
        ),
        new_fn(
            "getInterfaces0",
            "()[Ljava/lang/Class;",
            Box::new(jvm_getInterfaces0),
        ),
        new_fn("getRawAnnotations", "()[B", Box::new(jvm_getRawAnnotations)),
        new_fn(
            "getConstantPool",
            "()Lsun/reflect/ConstantPool;",
            Box::new(jvm_getConstantPool),
        ),
        new_fn(
            "getDeclaredClasses0",
            "()[Ljava/lang/Class;",
            Box::new(jvm_getDeclaredClasses0),
        ),
        new_fn(
            "getGenericSignature0",
            "()Ljava/lang/String;",
            Box::new(jvm_getGenericSignature0),
        ),
    ]
}

#[derive(Copy, Clone, PartialEq)]
enum ClassMirrorState {
    NotFixed,
    Fixed,
}

lazy_static! {
    static ref MIRROR_STATE: RwLock<ClassMirrorState> = RwLock::new(ClassMirrorState::NotFixed);
    static ref PRIM_MIRROS: RwLock<FxHashMap<String, Oop>> = {
        let hm = FxHashMap::default();
        RwLock::new(hm)
    };
    static ref SIGNATURE_DIC: FxHashMap<&'static str, &'static str> = {
        let dic: FxHashMap<&'static str, &'static str> = [
            ("byte", "B"),
            ("boolean", "Z"),
            ("char", "C"),
            ("short", "S"),
            ("int", "I"),
            ("float", "F"),
            ("long", "J"),
            ("double", "D"),
            ("void", "V"),
        ]
        .iter()
        .cloned()
        .collect();

        dic
    };
    static ref DELAYED_MIRROS: RwLock<Vec<String>> = {
        let v = vec![
            "I", "Z", "B", "C", "S", "F", "J", "D", "V", "[I", "[Z", "[B", "[C", "[S", "[F", "[J",
            "[D",
        ];
        let v: Vec<String> = v.iter().map(|it| it.to_string()).collect();
        RwLock::new(v)
    };
    static ref DELAYED_ARY_MIRROS: RwLock<Vec<ClassRef>> = {
        let v = vec![];
        RwLock::new(v)
    };
}

pub fn init() {
    lazy_static::initialize(&MIRROR_STATE);
    lazy_static::initialize(&SIGNATURE_DIC);
    lazy_static::initialize(&PRIM_MIRROS);
    lazy_static::initialize(&DELAYED_MIRROS);
    lazy_static::initialize(&DELAYED_ARY_MIRROS);
}

pub fn create_mirror(cls: ClassRef) {
    let is_fixed = {
        let s = MIRROR_STATE.write().unwrap();
        *s == ClassMirrorState::Fixed
    };

    if is_fixed {
        let mirror = Oop::new_mirror(cls.clone());
        let cls = cls.get_mut_class();
        trace!("mirror created: {}", unsafe {
            std::str::from_utf8_unchecked(cls.name.as_slice())
        });
        cls.set_mirror(mirror);
    } else {
        let cls_back = cls.clone();
        let cls = cls.get_class();
        let name = unsafe { std::str::from_utf8_unchecked(cls.name.as_slice()) };
        warn!("mirror create delayed: {}", name);
        match cls.kind {
            oop::class::ClassKind::Instance(_) => {
                let mut mirrors = DELAYED_MIRROS.write().unwrap();
                mirrors.push(String::from(name));
            }
            _ => {
                let mut mirrors = DELAYED_ARY_MIRROS.write().unwrap();
                mirrors.push(cls_back);
            }
        }
    }
}

/*
called after 'java/lang/Class' inited in init_vm.rs
*/
pub fn create_delayed_mirrors() {
    let names: Vec<String> = {
        let mirros = DELAYED_MIRROS.read().unwrap();
        mirros.clone()
    };

    {
        let mut s = MIRROR_STATE.write().unwrap();
        *s = ClassMirrorState::Fixed;
    }

    for name in names {
        if name.len() > 2 {
            //java.lang.XXX
            let target = require_class3(None, name.as_bytes()).unwrap();
            create_mirror(target);
        } else {
            let is_prim_ary = name.as_bytes()[0] == b'[';
            let (vt, target) = if is_prim_ary {
                let vt = ValueType::from(&name.as_bytes()[1]);
                let target = require_class3(None, name.as_bytes()).unwrap();
                (vt, Some(target))
            } else {
                (ValueType::from(&name.as_bytes()[0]), None)
            };

            let mirror = Oop::new_prim_mirror(vt, target.clone());
            if is_prim_ary {
                let target = target.unwrap();
                let cls = target.get_mut_class();
                //                warn!("set_mirror name={}", String::from_utf8_lossy(cls.name.as_slice()));
                cls.set_mirror(mirror.clone());
            }

            let mut mirrors = PRIM_MIRROS.write().unwrap();
            mirrors.insert(name.to_string(), mirror);
        }
    }
}

/*
called after 'java/lang/Class' inited in init_vm.rs
*/
pub fn create_delayed_ary_mirrors() {
    let classes: Vec<ClassRef> = {
        let mirros = DELAYED_ARY_MIRROS.read().unwrap();
        mirros.clone()
    };

    for cls in classes {
        let value_type = {
            let cls = cls.get_class();
            match &cls.kind {
                oop::class::ClassKind::ObjectArray(obj_ary) => obj_ary.value_type,
                oop::class::ClassKind::TypeArray(typ_ary) => typ_ary.value_type,
                _ => unreachable!(),
            }
        };
        let mirror = Oop::new_ary_mirror(cls.clone(), value_type);
        let cls = cls.get_mut_class();
        cls.set_mirror(mirror);
    }
}

fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

fn jvm_desiredAssertionStatus0(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(Some(Oop::new_int(0)))
}

fn jvm_getPrimitiveClass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let v = OopPtr::java_lang_string(v.extract_ref());
    match SIGNATURE_DIC.get(v.as_str()) {
        Some(&s) => Ok(get_primitive_class_mirror(s)),
        _ => unreachable!("Unknown primitive type: {}", v),
    }
}

fn jvm_getDeclaredFields0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    //parse args
    let mirror_target = {
        let arg0 = args.get(0).unwrap();
        extract_mirror_target(arg0)
    };

    let public_only = {
        let arg1 = args.get(1).unwrap();
        arg1.extract_int() == 1
    };

    //fixme: super fields
    //obtain inst&static fields
    let (inst_fields, static_fields) = {
        let inst = mirror_target.extract_inst();
        (inst.inst_fields.clone(), inst.static_fields.clone())
    };

    //build fields ary
    let mut fields = Vec::new();
    for (_, it) in inst_fields {
        if public_only && !it.field.is_public() {
            continue;
        }

        let v = common::reflect::new_field(it);
        fields.push(v);
    }

    for (_, it) in static_fields {
        if public_only && !it.field.is_public() {
            continue;
        }

        let v = common::reflect::new_field(it);
        fields.push(v);
    }

    //build oop field ar
    let ary_cls = require_class3(None, b"[Ljava/lang/reflect/Field;").unwrap();
    Ok(Some(Oop::new_ref_ary2(ary_cls, fields)))
}

fn jvm_getName0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let (target, vt) = {
        let arg0 = args.get(0).unwrap();
        let rf = arg0.extract_ref();
        let mirror = rf.extract_mirror();
        (mirror.target.clone(), mirror.value_type)
    };
    let name = {
        match target {
            Some(target) => {
                let cls = target.get_class();
                Vec::from(cls.name.as_slice())
            }
            None => {
                let v = vt.get_primitive_name();
                Vec::from(v)
            }
        }
    };

    let name = unsafe { std::str::from_utf8_unchecked(name.as_slice()) };
    let name = name.replace("/", ".");
    let v = util::oop::new_java_lang_string2(&name);
    Ok(Some(v))
}

fn jvm_forName0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();
    let java_name = {
        let rf = arg0.extract_ref();
        OopPtr::java_lang_string(rf)
    };
    let initialize = {
        let arg1 = args.get(1).unwrap();
        arg1.extract_int() != 0
    };
    let java_cls_loader = args.get(2).unwrap();
    {
        match java_cls_loader {
            Oop::Null => (),
            _ => unimplemented!("app class loader, unimpl"),
        }
    }

    let _caller_mirror = args.get(3).unwrap();

    if java_name.contains('/') {
        let msg = Some(java_name);
        let ex = runtime::exception::new(cls_consts::J_CLASS_NOT_FOUND, msg);
        return Err(ex);
    }

    let java_name = java_name.replace(".", "/");
    let cls = {
        if java_name == "sun/nio/cs/ext/ExtendedCharsets" {
            //fixme: skip, cause jvm start very slow
            None
        } else {
            require_class3(None, java_name.as_bytes())
        }
    };

    match cls {
        Some(cls) => {
            oop::class::init_class(&cls);
            if initialize {
                oop::class::init_class_fully(&cls);
            }

            let mirror = cls.get_class().get_mirror();
            Ok(Some(mirror))
        }
        None => {
            // error!("forName0, NotFound: {}", java_name);
            let msg = Some(java_name);
            let ex = runtime::exception::new(cls_consts::J_CLASS_NOT_FOUND, msg);
            Err(ex)
        }
    }
}

fn jvm_isPrimitive(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let v = {
        let rf = v.extract_ref();
        let mirror = rf.extract_mirror();
        if mirror.target.is_none() {
            1
        } else {
            0
        }
    };
    Ok(Some(Oop::new_int(v)))
}

fn jvm_isAssignableFrom(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let l = args.get(0).unwrap();
    let r = args.get(1).unwrap();

    let (lt, ltyp) = {
        let rf = l.extract_ref();
        let mirror = rf.extract_mirror();
        (mirror.target.clone(), mirror.value_type)
    };

    let (rt, rtyp) = {
        let rf = r.extract_ref();
        let mirror = rf.extract_mirror();
        (mirror.target.clone(), mirror.value_type)
    };

    let v = if lt.is_none() && rt.is_none() {
        if ltyp == rtyp {
            1
        } else {
            0
        }
    } else {
        let lt = lt.unwrap();
        let rt = rt.unwrap();
        if runtime::cmp::instance_of(rt, lt) {
            1
        } else {
            0
        }
    };

    Ok(Some(Oop::new_int(v)))
}

fn jvm_isInterface(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let v = {
        let rf = v.extract_ref();
        let mirror = rf.extract_mirror();
        match &mirror.target {
            Some(target) => {
                if target.get_class().is_interface() {
                    1
                } else {
                    0
                }
            }
            None => 0,
        }
    };

    Ok(Some(Oop::new_int(v)))
}

fn jvm_getDeclaredConstructors0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    //parse args
    let mirror_target = {
        let arg0 = args.get(0).unwrap();
        extract_mirror_target(arg0)
    };
    let public_only = args.get(1).unwrap().extract_int() == 1;
    get_declared_method_helper(mirror_target, public_only, true)
}

pub fn jvm_getModifiers(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let v = {
        let rf = v.extract_ref();
        let mirror = rf.extract_mirror();
        match &mirror.target {
            Some(target) => {
                let mut acc_flags = target.get_class().acc_flags;

                //use access_flags in InnerClasses Attribute
                //don't know why. just read the JDK codes
                let inst = target.extract_inst();
                let this_class = inst.class_file.this_class;
                match &inst.inner_classes {
                    Some(inner_classes) => {
                        for it in inner_classes {
                            if it.inner_class_info_index == 0 {
                                continue;
                            }

                            if it.inner_class_info_index == this_class {
                                acc_flags = it.inner_class_access_flags;
                            }
                        }
                    }
                    None => {}
                }

                acc_flags
            }
            None => acc::ACC_ABSTRACT | acc::ACC_FINAL | acc::ACC_PUBLIC,
        }
    };

    Ok(Some(Oop::new_int(v as i32)))
}

fn jvm_getSuperclass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();
    let rf = arg0.extract_ref();
    let mirror = rf.extract_mirror();
    match &mirror.target {
        Some(target) => {
            let cls = target.get_class();
            match &cls.super_class {
                Some(super_cls) => {
                    let cls = super_cls.get_class();
                    let mirror = cls.get_mirror();
                    Ok(Some(mirror))
                }
                None => Ok(Some(Oop::Null)),
            }
        }
        None => Ok(Some(Oop::Null)),
    }
}

fn jvm_isArray(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();

    let mirror_cls = {
        let rf = arg0.extract_ref();
        let mirror = rf.extract_mirror();
        match &mirror.target {
            Some(target) => target.clone(),
            None => return Ok(Some(Oop::new_int(0))),
        }
    };

    let cls = mirror_cls.get_class();
    let v = match cls.get_class_kind_type() {
        oop::class::ClassKindType::Instance => 0,
        _ => 1,
    };

    Ok(Some(Oop::new_int(v)))
}

fn jvm_getComponentType(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();
    let cls = {
        let rf = arg0.extract_ref();
        let mirror = rf.extract_mirror();
        mirror.target.clone().unwrap()
    };
    let cls = cls.get_class();
    let v = match &cls.kind {
        oop::class::ClassKind::TypeArray(type_ary_cls) => {
            let vt = type_ary_cls.value_type.into();
            let key = unsafe { std::str::from_utf8_unchecked(vt) };
            let mirrors = PRIM_MIRROS.read().unwrap();
            mirrors.get(key).cloned()
        }
        oop::class::ClassKind::ObjectArray(obj_ary_cls) => {
            let component = obj_ary_cls.component.clone().unwrap();
            let cls = component.get_class();
            Some(cls.get_mirror())
        }
        _ => unreachable!(),
    };
    Ok(v)
}

fn jvm_getEnclosingMethod0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();
    let target = {
        let rf = arg0.extract_ref();
        let ptr = rf.get_raw_ptr();
        unsafe {
            match &(*ptr).v {
                oop::RefKind::Mirror(mirror) => mirror.target.clone(),
                _ => return Ok(Some(Oop::Null)),
            }
        }
    };

    let (cls_file, em) = match target {
        Some(target) => {
            let cls = target.get_class();
            match &cls.kind {
                ClassKind::Instance(cls) => match &cls.enclosing_method {
                    Some(em) => (cls.class_file.clone(), em.clone()),
                    None => return Ok(Some(Oop::Null)),
                },
                _ => return Ok(Some(Oop::Null)),
            }
        }
        None => return Ok(Some(Oop::Null)),
    };

    //push EnclosingMethod class mirror
    if em.class_index == 0 {
        panic!();
    }
    let em_class = require_class2(em.class_index, &cls_file.cp).unwrap();
    let em_class_mirror = {
        let cls = em_class.get_class();
        cls.get_mirror()
    };
    let mut elms = Vec::with_capacity(3);
    elms.push(em_class_mirror);

    //push EnclosingMethod name&desc
    if em.method_index != 0 {
        let (name, desc) = constant_pool::get_name_and_type(&cls_file.cp, em.method_index as usize);
        let name = unsafe { std::str::from_utf8_unchecked(name.as_slice()) };
        let desc = unsafe { std::str::from_utf8_unchecked(desc.as_slice()) };

        elms.push(util::oop::new_java_lang_string2(name));
        elms.push(util::oop::new_java_lang_string2(desc));
    } else {
        elms.push(Oop::Null);
        elms.push(Oop::Null);
    }

    let ary = require_class3(None, b"[Ljava/lang/Object;").unwrap();
    let ary = Oop::new_ref_ary2(ary, elms);

    Ok(Some(ary))
}

fn jvm_getDeclaringClass0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();
    let target = {
        let rf = arg0.extract_ref();
        let ptr = rf.get_raw_ptr();
        unsafe {
            match &(*ptr).v {
                oop::RefKind::Mirror(mirror) => mirror.target.clone(),
                _ => return Ok(Some(Oop::Null)),
            }
        }
    };

    let (cls_file, target, inner_classes) = match target {
        Some(target) => {
            let cls = target.get_class();
            match &cls.kind {
                ClassKind::Instance(cls) => match &cls.inner_classes {
                    Some(inner_classes) => (
                        cls.class_file.clone(),
                        target.clone(),
                        inner_classes.clone(),
                    ),
                    None => return Ok(Some(Oop::Null)),
                },
                _ => return Ok(Some(Oop::Null)),
            }
        }
        None => return Ok(Some(Oop::Null)),
    };

    for it in inner_classes.iter() {
        if it.inner_class_info_index == 0 {
            continue;
        }

        let inner_class = require_class2(it.inner_class_info_index, &cls_file.cp).unwrap();

        if Arc::ptr_eq(&inner_class, &target) {
            return if it.outer_class_info_index == 0 {
                Ok(Some(Oop::Null))
            } else {
                let outer_class = require_class2(it.outer_class_info_index, &cls_file.cp).unwrap();
                let v = outer_class.get_class();
                Ok(Some(v.get_mirror()))
            };
        }
    }

    Ok(Some(Oop::Null))
}

fn jvm_isInstance(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let arg0 = args.get(0).unwrap();
    let arg1 = args.get(1).unwrap();

    let target_cls = {
        let rf = arg0.extract_ref();
        let ptr = rf.get_raw_ptr();
        unsafe {
            match &(*ptr).v {
                oop::RefKind::Inst(inst) => inst.class.clone(),
                oop::RefKind::Mirror(mirror) => mirror.target.clone().unwrap(),
                _ => unreachable!(),
            }
        }
    };
    let obj_cls = {
        let rf = arg1.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };

    let v = if runtime::cmp::instance_of(obj_cls, target_cls) {
        1
    } else {
        0
    };

    Ok(Some(Oop::new_int(v)))
}

fn jvm_getDeclaredMethods0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    //parse args
    let mirror_target = {
        let arg0 = args.get(0).unwrap();
        extract_mirror_target(arg0)
    };
    let public_only = args.get(1).unwrap().extract_int() == 1;
    get_declared_method_helper(mirror_target, public_only, false)
}

fn jvm_getInterfaces0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let mirror = {
        let arg0 = args.get(0).unwrap();
        extract_mirror_target(arg0)
    };

    let v = mirror.get_class();
    let elms = match &v.kind {
        oop::ClassKind::Instance(inst) => {
            let mut elms = Vec::with_capacity(inst.class_file.interfaces.len());
            let cp = &inst.class_file.cp;
            inst.class_file.interfaces.iter().for_each(|it| {
                let cls = require_class2(*it, cp).unwrap();
                let cls = cls.get_class();
                elms.push(cls.get_mirror());
            });

            elms
        }
        ClassKind::ObjectArray(_ary) => {
            let cls_cloneable = require_class3(None, cls_consts::J_CLONEABLE).unwrap();
            let cls_serializable = require_class3(None, cls_consts::J_SERIALIZABLE).unwrap();
            let mut elms = Vec::with_capacity(2);

            {
                let cls = cls_cloneable.get_class();
                elms.push(cls.get_mirror());
            }

            {
                let cls = cls_serializable.get_class();
                elms.push(cls.get_mirror());
            }

            elms
        }
        ClassKind::TypeArray(_) => unimplemented!("type array getInterfaces0"),
    };

    let clazz = require_class3(None, b"[Ljava/lang/Class;").unwrap();
    let ary = Oop::new_ref_ary2(clazz, elms);

    Ok(Some(ary))
}

fn jvm_getRawAnnotations(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let cls = args.get(0).unwrap();
    let annotations = match cls {
        Oop::Ref(rf) => {
            let mirror = rf.extract_mirror();
            let cls = mirror.target.clone().unwrap();
            let cls = cls.get_class();
            let raw = cls.get_annotation();
            match raw {
                Some(raw) => Oop::new_byte_ary2(raw.to_vec()),
                None => Oop::Null,
            }
        }
        _ => Oop::Null,
    };

    Ok(Some(annotations))
}

fn jvm_getConstantPool(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let cp_oop = match this {
        Oop::Ref(_rf) => {
            let cp_cls = require_class3(None, b"sun/reflect/ConstantPool").unwrap();
            let cp_oop = Oop::new_inst(cp_cls.clone());

            let cls = cp_cls.get_class();
            let fid =
                cls.get_field_id(&util::S_CONSTANT_POOL_OOP, &util::S_JAVA_LANG_OBJECT, false);
            //todo: reimpl maybe, create one JNIHandles, like jdk
            Class::put_field_value(cp_oop.extract_ref(), fid, this.clone());

            cp_oop
        }
        _ => Oop::Null,
    };

    Ok(Some(cp_oop))
}

fn jvm_getDeclaredClasses0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let target_clz = extract_mirror_target(this);

    let array_class = require_class3(None, b"[Ljava/lang/Class;").unwrap();

    let target_class = target_clz.get_class();
    let v = match &target_class.kind {
        ClassKind::Instance(inst) => {
            let cp = &inst.class_file.cp;
            match &inst.inner_classes {
                Some(inner_classes) => {
                    let this_class = inst.class_file.this_class;
                    let mut inners = Vec::with_capacity(inner_classes.len());
                    for it in inner_classes {
                        if it.outer_class_info_index == this_class {
                            let inner_clz = require_class2(it.inner_class_info_index, cp).unwrap();
                            let v = inner_clz.get_class().get_mirror();
                            inners.push(v);
                        }
                    }

                    Oop::new_ref_ary2(array_class, inners)
                }
                _ => Oop::new_ref_ary(array_class, 0),
            }
        }
        _ => Oop::new_ref_ary(array_class, 0),
    };

    Ok(Some(v))
}

fn jvm_getGenericSignature0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let v = match this {
        Oop::Ref(rf) => {
            let ptr = rf.get_raw_ptr();
            unsafe {
                let mirror = (*ptr).v.extract_mirror();
                let vt = mirror.value_type;
                if vt == ValueType::OBJECT {
                    let target = mirror.target.clone().unwrap();
                    let cls = target.get_class();
                    let sig = cls.get_attr_signatrue();
                    sig.map_or(Oop::Null, |v| {
                        let sig = std::str::from_utf8_unchecked(v.as_slice());
                        util::oop::new_java_lang_string2(sig)
                    })
                } else {
                    Oop::Null
                }
            }
        }
        _ => unreachable!(),
    };

    Ok(Some(v))
}

fn get_declared_method_helper(
    mirror_target: ClassRef,
    public_only: bool,
    want_constructor: bool,
) -> JNIResult {
    //fixme: super methods
    let selected_methods = {
        let cls = mirror_target.get_class();
        match &cls.kind {
            oop::class::ClassKind::Instance(inst) => {
                fn chooser1(want_constructor: bool, name: &[u8]) -> bool {
                    if want_constructor {
                        name == b"<init>"
                    } else {
                        name != b"<init>"
                    }
                }

                fn chooser2(want_constructor: bool, m: &MethodIdRef) -> bool {
                    if want_constructor {
                        m.method.name.as_slice() == b"<init>" && !m.method.is_static()
                    } else {
                        m.method.name.as_slice() != b"<init>"
                    }
                }

                let mut selected_methods = Vec::new();
                for (k, m) in inst.all_methods.iter() {
                    if !chooser1(want_constructor, k.0.as_slice()) {
                        continue;
                    }

                    if chooser2(want_constructor, &m) && (!public_only || m.method.is_public()) {
                        selected_methods.push(m.clone());
                    }
                }

                selected_methods
            }
            oop::class::ClassKind::ObjectArray(_ary) => vec![],
            _ => unreachable!("{:?}", mirror_target),
        }
    };

    //build methods ary
    let mut methods = Vec::with_capacity(selected_methods.len());
    for m in selected_methods {
        let v = if want_constructor {
            common::reflect::new_method_ctor(m)
        } else {
            common::reflect::new_method_normal(m)
        };

        methods.push(v);
    }

    //build oop methods ary
    let ary_cls = if want_constructor {
        require_class3(None, b"[Ljava/lang/reflect/Constructor;").unwrap()
    } else {
        require_class3(None, b"[Ljava/lang/reflect/Method;").unwrap()
    };

    Ok(Some(Oop::new_ref_ary2(ary_cls, methods)))
}

fn extract_mirror_target(v: &Oop) -> ClassRef {
    let rf = v.extract_ref();
    let mirror = rf.extract_mirror();
    mirror.target.clone().unwrap()
}


================================================
FILE: crates/vm/src/native/java_lang_ClassLoader.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{self, Oop, OopPtr};
use crate::runtime;
use crate::util;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("registerNatives", "()V", Box::new(jvm_registerNatives)),
        new_fn(
            "findBuiltinLib",
            "(Ljava/lang/String;)Ljava/lang/String;",
            Box::new(jvm_findBuiltinLib),
        ),
        new_fn(
            "findLoadedClass0",
            "(Ljava/lang/String;)Ljava/lang/Class;",
            Box::new(jvm_findLoadedClass0),
        ),
        new_fn(
            "findBootstrapClass",
            "(Ljava/lang/String;)Ljava/lang/Class;",
            Box::new(jvm_findBootstrapClass),
        ),
    ]
}

fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

fn jvm_findBuiltinLib(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let name = args.get(0).unwrap();
    let name = OopPtr::java_lang_string(name.extract_ref());
    info!("findBuiltinLib: {}", name);
    Ok(None)
}

fn jvm_findLoadedClass0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let name = args.get(1).unwrap();
    let name = OopPtr::java_lang_string(name.extract_ref());
    info!("findLoadedClass0: {}", name);
    let name = name.replace(".", util::FILE_SEP);
    let v = match runtime::sys_dic_find(name.as_bytes()) {
        Some(cls) => {
            let cls = cls.get_class();
            cls.get_mirror()
        }
        None => Oop::Null,
    };
    Ok(Some(v))
}

// fixme: Is this correct? uncertain
fn jvm_findBootstrapClass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    info!("findBootstrapClass");
    jvm_findLoadedClass0(_env, args)
}


================================================
FILE: crates/vm/src/native/java_lang_Double.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::Oop;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn(
            "doubleToRawLongBits",
            "(D)J",
            Box::new(jvm_doubleToRawLongBits),
        ),
        new_fn("longBitsToDouble", "(J)D", Box::new(jvm_longBitsToDouble)),
    ]
}

fn jvm_doubleToRawLongBits(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap().extract_double();
    let v = v.to_bits().to_be_bytes();
    let v = i64::from_be_bytes(v);
    Ok(Some(Oop::new_long(v)))
}

fn jvm_longBitsToDouble(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap().extract_long();
    let v = v.to_be_bytes();
    let v = f64::from_be_bytes(v);
    Ok(Some(Oop::new_double(v)))
}


================================================
FILE: crates/vm/src/native/java_lang_Float.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::Oop;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![new_fn(
        "floatToRawIntBits",
        "(F)I",
        Box::new(jvm_floatToRawIntBits),
    )]
}

fn jvm_floatToRawIntBits(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap().extract_float();
    let v = v.to_bits().to_be_bytes();
    let v = i32::from_be_bytes(v);
    Ok(Some(Oop::new_int(v)))
}


================================================
FILE: crates/vm/src/native/java_lang_Object.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{self, Oop};
use std::time::Duration;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("registerNatives", "()V", Box::new(jvm_registerNatives)),
        new_fn("hashCode", "()I", Box::new(jvm_hashCode)),
        new_fn("clone", "()Ljava/lang/Object;", Box::new(jvm_clone)),
        new_fn("getClass", "()Ljava/lang/Class;", Box::new(jvm_getClass)),
        new_fn("notifyAll", "()V", Box::new(jvm_notifyAll)),
        new_fn("wait", "(J)V", Box::new(jvm_wait)),
    ]
}

fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

pub fn jvm_hashCode(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let v = v.hash_code();
    let v = Oop::new_int(v);
    Ok(Some(v))
}

fn jvm_clone(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    //    let java_lang_Cloneable = require_class3(None, b"java/lang/Cloneable").unwrap();
    let this_obj = args.get(0).unwrap();
    Ok(Some(this_obj.clone()))
}

fn jvm_getClass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let mirror = {
        let rf = v.extract_ref();
        let ptr = rf.get_raw_ptr();
        unsafe {
            match &(*ptr).v {
                oop::RefKind::Inst(inst) => {
                    let cls = inst.class.get_class();
                    cls.get_mirror()
                }
                oop::RefKind::Array(ary) => ary.class.get_class().get_mirror(),
                oop::RefKind::Mirror(_mirror) => v.clone(),
                t => unimplemented!("t = {:?}", t),
            }
        }
    };
    Ok(Some(mirror))
}

fn jvm_notifyAll(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let rf = this.extract_ref();
    rf.notify_all();
    Ok(None)
}

fn jvm_wait(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let millis = args.get(1).unwrap().extract_long();

    let rf = this.extract_ref();
    if millis == 0 {
        rf.wait();
    } else {
        rf.wait_timeout(Duration::from_millis(millis as u64));
    }

    Ok(None)
}


================================================
FILE: crates/vm/src/native/java_lang_Runtime.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::Oop;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn(
            "availableProcessors",
            "()I",
            Box::new(jvm_availableProcessors),
        ),
        new_fn("gc", "()V", Box::new(jvm_gc)),
    ]
}

//fixme:
fn jvm_availableProcessors(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(Some(Oop::new_int(1)))
}

fn jvm_gc(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}


================================================
FILE: crates/vm/src/native/java_lang_String.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::Oop;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![new_fn(
        "intern",
        "()Ljava/lang/String;",
        Box::new(jvm_intern),
    )]
}

fn jvm_intern(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    Ok(Some(v.clone()))
}


================================================
FILE: crates/vm/src/native/java_lang_System.rs
================================================
#![allow(non_snake_case)]

use crate::native::{self, new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{self, Oop, OopPtr};
use crate::runtime::{self, thread, JavaCall};
use crate::{new_br, util};
use std::sync::Arc;
use std::time::SystemTime;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn(
            "arraycopy",
            "(Ljava/lang/Object;ILjava/lang/Object;II)V",
            Box::new(jvm_arraycopy),
        ),
        new_fn("registerNatives", "()V", Box::new(jvm_registerNatives)),
        new_fn(
            "initProperties",
            "(Ljava/util/Properties;)Ljava/util/Properties;",
            Box::new(jvm_initProperties),
        ),
        new_fn("setIn0", "(Ljava/io/InputStream;)V", Box::new(jvm_setIn0)),
        new_fn("setOut0", "(Ljava/io/PrintStream;)V", Box::new(jvm_setOut0)),
        new_fn("setErr0", "(Ljava/io/PrintStream;)V", Box::new(jvm_setErr0)),
        new_fn(
            "mapLibraryName",
            "(Ljava/lang/String;)Ljava/lang/String;",
            Box::new(jvm_mapLibraryName),
        ),
        new_fn(
            "loadLibrary",
            "(Ljava/lang/String;)V",
            Box::new(jvm_loadLibrary),
        ),
        new_fn(
            "identityHashCode",
            "(Ljava/lang/Object;)I",
            Box::new(jvm_identityHashCode),
        ),
        new_fn("nanoTime", "()J", Box::new(jvm_nanoTime)),
        new_fn("currentTimeMillis", "()J", Box::new(jvm_currentTimeMillis)),
        //Note: just for debug
        //        new_fn("getProperty", "(Ljava/lang/String;)Ljava/lang/String;", Box::new(jvm_getProperty)),
    ]
}

fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

fn jvm_arraycopy(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let src = args.get(0).unwrap();
    let src_pos = args.get(1).unwrap().extract_int();
    let dest = args.get(2).unwrap();
    let dest_pos = args.get(3).unwrap().extract_int();
    let length = args.get(4).unwrap().extract_int();

    //todo: do check & throw exception

    if length == 0 {
        return Ok(None);
    }

    let is_same_obj = OopPtr::is_eq(src, dest);

    if is_same_obj {
        arraycopy_same_obj(
            src.extract_ref(),
            src_pos as usize,
            dest_pos as usize,
            length as usize,
        );
    } else {
        arraycopy_diff_obj(
            src.extract_ref(),
            src_pos as usize,
            dest.extract_ref(),
            dest_pos as usize,
            length as usize,
        );
    }

    Ok(None)
}

fn jvm_initProperties(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    //fixme:
    let props = vec![
        ("file.encoding.pkg", "sun.io"),
        ("file.encoding", "US-ASCII"),
        ("file.separator", util::FILE_SEP),
        ("java.class.path", "."),
        ("java.class.version", "52.0"),
        ("java.security.egd", "file:/dev/random"),
        // ("java.security.debug", "all"),
        // ("java.security.auth.debug", "all"),
        ("java.specification.version", "1.8"),
        ("java.specification.name", "Java Platform API Specification"),
        ("java.specification.vendor", "Oracle Corporation"),
        ("java.vendor", "Chuan"),
        ("java.vendor.url", "https://github.com/douchuan/jvm"),
        ("java.vendor.url.bug", "https://github.com/douchuan/jvm"),
        ("java.version", "1.8"),
        ("line.separator", util::LINE_SEP),
        ("os.arch", "x86_64"),
        ("os.name", "Mac OS X"),
        ("os.version", "18.7.0"),
        ("path.separator", util::PATH_SEP),
        ("sun.arch.data.model", "64"),
        ("sun.cpu.endian", "little"),
        ("sun.cpu.isalist", ""),
        // ("sun.misc.URLClassPath.debug", "true"),
        // ("sun.misc.URLClassPath.debugLookupCache", "true"),
        ("sun.stdout.encoding", "UTF-8"),
        ("sun.stderr.encoding", "UTF-8"),
        ("user.language", "en"),
        ("user.name", "chuan"),
        ("user.region", "US"),
        //        ("java.security.manager", ""),
        //        ("sun.jnu.encoding", "UTF-8"),
        //        ("sun.io.unicode.encoding", "UnicodeBig"),
    ];

    let props_oop = args.get(0).unwrap();
    for (k, v) in props.iter() {
        put_props_kv(props_oop, k, v);
    }

    //user.dir
    let v = std::env::current_dir().expect("current_dir failed");
    let v = v.to_str().expect("current_dir to_str faield");
    put_props_kv(props_oop, "user.dir", v);

    //java.io.tmpdir
    let v = std::env::temp_dir();
    let v = v.to_str().expect("temp_dir to_str failed");
    put_props_kv(props_oop, "java.io.tmpdir", v);

    //user.home
    let v = dirs::home_dir().expect("get home_dir failed");
    let v = v.to_str().expect("home_dir to_str failed");
    put_props_kv(props_oop, "user.home", v);

    //JAVA_HOME
    let v = std::env::var("JAVA_HOME").expect("Please Setup JAVA_HOME env");
    put_props_kv(props_oop, "java.home", v.as_str());

    //test.src for jdk/test/java/lang/Character/CheckProp.java
    if let Ok(v) = std::env::var("TEST_SRC") {
        put_props_kv(props_oop, "test.src", v.as_str());
    }

    if thread::is_meet_ex() {
        unreachable!("jvm_initProperties meet ex");
    }

    Ok(Some(props_oop.clone()))
}

fn put_props_kv(props: &Oop, k: &str, v: &str) {
    //todo: optimize me
    let cls = {
        let rf = props.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };

    let mir = {
        let cls = cls.get_class();
        cls.get_virtual_method(
            &new_br("put"),
            &new_br("(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"),
        )
        .unwrap()
    };

    let k = util::oop::new_java_lang_string2(k);
    let v = util::oop::new_java_lang_string2(v);

    let args = vec![props.clone(), k, v];

    let mut jc = JavaCall::new_with_args(mir, args);
    let area = runtime::DataArea::new(1);
    jc.invoke(Some(&area), false);
}

fn jvm_setIn0(env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let cls = env.read().unwrap().class.clone();
    let cls = cls.get_mut_class();
    let id = cls.get_field_id(&util::S_IN, &util::S_JAVA_IO_INPUT_STREAM, true);
    cls.put_static_field_value(id, v.clone());
    Ok(None)
}

fn jvm_setOut0(env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let cls = env.read().unwrap().class.clone();
    let cls = cls.get_mut_class();
    let id = cls.get_field_id(&util::S_OUT, &util::S_JAVA_IO_PRINT_STREAM, true);
    cls.put_static_field_value(id, v.clone());
    Ok(None)
}

fn jvm_setErr0(env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let cls = env.read().unwrap().class.clone();
    let cls = cls.get_mut_class();
    let id = cls.get_field_id(&util::S_ERR, &util::S_JAVA_IO_PRINT_STREAM, true);
    cls.put_static_field_value(id, v.clone());
    Ok(None)
}

fn jvm_mapLibraryName(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let v = args.get(0).unwrap();
    let s = OopPtr::java_lang_string(v.extract_ref());

    trace!("mapLibraryName libname = {}", s);
    let mut name = String::new();
    if cfg!(target_os = "macos") {
        name.push_str("lib");
        name.push_str(&s);
        name.push_str(".dylib");
    } else if cfg!(target_os = "windows") {
        unimplemented!();
    //        name.extend_from_slice(s.as_bytes());
    //        name.extend_from_slice(".dll".as_bytes());
    } else if cfg!(target_os = "linux") {
        unimplemented!();
    //        name.extend_from_slice("lib".as_bytes());
    //        name.extend_from_slice(s.as_bytes());
    //        name.extend_from_slice(".so".as_bytes());
    } else {
        unimplemented!()
    }
    trace!("mapLibraryName name = {}", name);

    let v = util::oop::new_java_lang_string2(&name);

    Ok(Some(v))
}

fn jvm_loadLibrary(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

fn jvm_identityHashCode(env: JNIEnv, args: &[Oop]) -> JNIResult {
    native::java_lang_Object::jvm_hashCode(env, args)
}

/*
fn jvm_getProperty(jt: &mut JavaThread, env: JNIEnv, args: Vec<OopRef>) -> JNIResult {
    let key = args.get(0).unwrap();

    let str_key = util::oop::extract_str(key.clone());
    warn!("xxxx jvm_getProperty key = {}", str_key);

    let cls = require_class3(None, b"java/lang/System").unwrap();
    let props = {
        let cls = cls.lock().unwrap();
        let id = cls.get_field_id(b"props", b"Ljava/util/Properties;", true);
        cls.get_static_field_value(id)
    };

    let prop_cls = require_class3(None, b"java/util/Properties").unwrap();
    let mir = {
        let cls = prop_cls.lock().unwrap();
        let id = util::new_method_id(b"getProperty", b"(Ljava/lang/String;)Ljava/lang/String;");
        cls.get_class_method(id).unwrap()
    };

    let args = vec![props, key.clone()];
    let mut stack = Stack::new(1);
    let mut jc = runtime::java_call::JavaCall::new_with_args(jt, mir, args);
    jc.invoke(jt, &mut stack, false);

    let v = stack.pop_ref();

    //    trace!("xxxxx 1, str_key = {}", String::from_utf8_lossy(str_key.as_slice()));
    //    let str_v = util::oop::extract_str(v.clone());
    //    warn!("xxxx jvm_getProperty v = {}", String::from_utf8_lossy(str_v.as_slice()));
    //    trace!("xxxxx 2");

    Ok(Some(v))
}
*/

fn arraycopy_same_obj(buf: Arc<OopPtr>, src_pos: usize, dest_pos: usize, length: usize) {
    let is_type_ary = {
        let ptr = buf.get_raw_ptr();
        unsafe {
            match &(*ptr).v {
                oop::RefKind::TypeArray(_) => true,
                oop::RefKind::Array(_) => false,
                _ => unreachable!(),
            }
        }
    };

    if is_type_ary {
        let ptr = buf.get_mut_raw_ptr();
        unsafe {
            match &mut (*ptr).v {
                oop::RefKind::TypeArray(ary) => match ary {
                    oop::TypeArrayDesc::Char(ary) => {
                        ary.copy_within(src_pos..(src_pos + length), dest_pos)
                    }
                    oop::TypeArrayDesc::Byte(ary) => {
                        ary.copy_within(src_pos..(src_pos + length), dest_pos)
                    }
                    t => unreachable!("t = {:?}", t),
                },

                _ => unreachable!(),
            }
        }
    } else {
        let tmp = {
            let ary = buf.extract_array();
            let mut tmp = vec![Oop::Null; length];

            let (_, ary) = ary.elements.split_at(src_pos);
            tmp.clone_from_slice(&ary[..length]);
            tmp
        };

        let ary = buf.extract_mut_array();
        let (_, ary) = ary.elements.split_at_mut(dest_pos);
        ary[..length].clone_from_slice(&tmp[..]);
    }
}

pub fn arraycopy_diff_obj(
    src: Arc<OopPtr>,
    src_pos: usize,
    dest: Arc<OopPtr>,
    dest_pos: usize,
    length: usize,
) {
    let is_type_ary = {
        let ptr = src.get_raw_ptr();
        unsafe {
            match &(*ptr).v {
                oop::RefKind::TypeArray(_) => true,
                oop::RefKind::Array(_) => false,
                _ => unreachable!(),
            }
        }
    };

    // error!("src={}, dest={}, length={}, is_type_ary={}", src_pos, dest_pos, length, is_type_ary);

    let src_ptr = src.get_raw_ptr();

    if is_type_ary {
        unsafe {
            match &(*src_ptr).v {
                oop::RefKind::TypeArray(src_ary) => match src_ary {
                    oop::TypeArrayDesc::Byte(src_ary) => {
                        let dest_ary = dest.extract_mut_type_array();
                        let dest_ary = dest_ary.extract_mut_bytes();
                        let (_, dest_ptr) = dest_ary.split_at_mut(dest_pos);
                        let (_, src_ptr) = src_ary.split_at(src_pos);
                        dest_ptr[..length].copy_from_slice(&src_ptr[..length]);
                    }
                    oop::TypeArrayDesc::Char(src_ary) => {
                        let dest_ary = dest.extract_mut_type_array();
                        let dest_ary = dest_ary.extract_mut_chars();
                        let (_, dest_ptr) = dest_ary.split_at_mut(dest_pos);
                        let (_, src_ptr) = src_ary.split_at(src_pos);
                        dest_ptr[..length].copy_from_slice(&src_ptr[..length]);
                    }
                    oop::TypeArrayDesc::Int(src_ary) => {
                        let dest_ary = dest.extract_mut_type_array();
                        let dest_ary = dest_ary.extract_mut_ints();
                        let (_, dest_ptr) = dest_ary.split_at_mut(dest_pos);
                        let (_, src_ptr) = src_ary.split_at(src_pos);
                        dest_ptr[..length].copy_from_slice(&src_ptr[..length]);
                    }
                    t => unreachable!("t = {:?}", t),
                },
                _ => unreachable!(),
            }
        }
    } else {
        let src = src.extract_array();
        let dest = dest.extract_mut_array();

        let (_, src_ptr) = src.elements.split_at(src_pos);
        let (_, dest_ptr) = dest.elements.split_at_mut(dest_pos);

        dest_ptr[..length].clone_from_slice(&src_ptr[..length]);
    }
}

fn jvm_nanoTime(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    let v = match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
        Ok(n) => n.as_nanos(),
        Err(_) => panic!("SystemTime before UNIX EPOCH!"),
    };
    // let v = chrono::Utc::now().timestamp_nanos();
    Ok(Some(Oop::new_long(v as i64)))
}

fn jvm_currentTimeMillis(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    let v = match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) {
        Ok(n) => n.as_millis(),
        Err(_) => panic!("SystemTime before UNIX EPOCH!"),
    };

    Ok(Some(Oop::new_long(v as i64)))
}


================================================
FILE: crates/vm/src/native/java_lang_Thread.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::new_br;
use crate::oop::{Class, Oop, OopPtr};
use crate::runtime::vm::get_vm;
use crate::runtime::{self, vm, JavaCall, JavaThread};

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn("registerNatives", "()V", Box::new(jvm_registerNatives)),
        new_fn(
            "currentThread",
            "()Ljava/lang/Thread;",
            Box::new(jvm_currentThread),
        ),
        new_fn("setPriority0", "(I)V", Box::new(jvm_setPriority0)),
        new_fn("isAlive", "()Z", Box::new(jvm_isAlive)),
        new_fn("start0", "()V", Box::new(jvm_start0)),
        new_fn("isInterrupted", "(Z)Z", Box::new(jvm_isInterrupted)),
    ]
}

fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

fn jvm_currentThread(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    let jt = runtime::thread::current_java_thread();
    let obj = jt.read().unwrap().java_thread_obj.clone();
    Ok(obj)
}

fn jvm_setPriority0(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    Ok(None)
}

//'_jt' is caller's thread context, can't be used here
//should find by 'eetop' in thread pool
fn jvm_isAlive(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let this = args.get(0).unwrap();
    let eetop = OopPtr::java_lang_thread_eetop(this.extract_ref());
    let vm = get_vm();

    let r = match vm.threads.find_java_thread(eetop) {
        Some(jt) => {
            info!("native thread tag = {}", jt.read().unwrap().tag);
            if jt.read().unwrap().is_alive {
                1
            } else {
                0
            }
        }
        None => 0,
    };

    Ok(Some(Oop::new_int(r)))
}

fn jvm_start0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let thread_oop = args.get(0).unwrap().clone();
    let clazz = {
        let rf = thread_oop.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };

    let cls = clazz.get_class();
    if cls.name.as_slice() == "java/lang/ref/Reference$ReferenceHandler".as_bytes() {
        Ok(None)
    } else {
        let vm = vm::get_vm();

        let jt = JavaThread::new(None, vm.threads.next_id());
        vm.threads.attach_java_thread(jt.clone());

        let args = vec![thread_oop.clone()];
        vm.threads.spawn_java_thread(move || {
            //setup current thread
            let current_thread = jt.clone();
            runtime::thread::THREAD.with(|t| {
                *t.borrow_mut() = current_thread;
            });

            let cls = clazz.get_class();
            let mir = {
                //setup eetop
                let eetop = jt.read().unwrap().eetop;
                let fid = cls.get_field_id(&new_br("eetop"), &new_br("J"), false);
                Class::put_field_value(thread_oop.extract_ref(), fid, Oop::new_long(eetop));

                //obtain 'run' method
                cls.get_virtual_method(&new_br("run"), &new_br("()V"))
                    .unwrap()
            };

            //invoke 'run'
            let mut jc = JavaCall::new_with_args(mir, args);
            jt.write().unwrap().is_alive = true;
            jt.write().unwrap().java_thread_obj = Some(thread_oop.clone());
            jc.invoke(None, false);
            jt.write().unwrap().is_alive = false;

            //notify thread that invoke 'join'
            let v = thread_oop.extract_ref();
            v.notify_all();

            vm.threads.detach_current_thread();
        });

        Ok(None)
    }
}

fn jvm_isInterrupted(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
    //todo: fix me
    let v = Oop::new_int(0);
    Ok(Some(v))
}


================================================
FILE: crates/vm/src/native/java_lang_Throwable.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{self, Class, Oop};
use crate::runtime::{self, require_class3};
use crate::{new_br, util};
use std::sync::atomic::Ordering;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn(
            "fillInStackTrace",
            "(I)Ljava/lang/Throwable;",
            Box::new(jvm_fillInStackTrace),
        ),
        new_fn(
            "getStackTraceDepth",
            "()I",
            Box::new(jvm_getStackTraceDepth),
        ),
        new_fn(
            "getStackTraceElement",
            "(I)Ljava/lang/StackTraceElement;",
            Box::new(jvm_getStackTraceElement),
        ),
    ]
}

fn jvm_fillInStackTrace(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let jt = runtime::thread::current_java_thread();

    let elm_cls = oop::class::load_and_init(b"java/lang/StackTraceElement");
    let ary_cls = require_class3(None, b"[Ljava/lang/StackTraceElement;").unwrap();

    let throwable_oop = args.get(0).unwrap();
    let mut backtrace = Vec::with_capacity(jt.read().unwrap().frames.len());

    let mut found_ex_here = false;
    let jth = jt.read().unwrap();
    for it in jth.frames.iter() {
        let ex_here = {
            let it = it.try_read().unwrap();
            it.ex_here.load(Ordering::Relaxed)
        };

        backtrace.push(it.clone());

        if ex_here {
            found_ex_here = true;
            break;
        }
    }
    drop(jth);

    /*
       todo: how handle throw better?

    if no ex_here found, it's:
      throw new AnnotationFormatError("Unexpected end of annotations.");

    new Throwable
      Throwable.fillInStackTrace invoked, and come here

    there are stacktraces for build 'Throwable' obj, not necessary for user, need discard

    Exception in thread "main" java.lang.annotation.AnnotationFormatError: Unexpected end of annotations.
       at java.lang.Throwable.fillInStackTrace(Throwable.java)
       at java.lang.Throwable.fillInStackTrace(Throwable.java:783)
       at java.lang.Throwable.<init>(Throwable.java:265)
       at java.lang.Error.<init>(Error.java:70)
       */
    if !found_ex_here {
        backtrace.pop();
        backtrace.pop();
        backtrace.pop();
        backtrace.pop();
    }

    let mut traces = Vec::new();
    for caller in backtrace.iter().rev() {
        let (mir, pc) = {
            let caller = caller.try_read().unwrap();
            let pc = caller.pc.load(Ordering::Relaxed);
            (caller.mir.clone(), pc)
        };

        let cls = mir.method.class.get_class();
        let cls_name = unsafe { std::str::from_utf8_unchecked(cls.name.as_slice()) };
        let cls_name = cls_name.replace("/", ".");
        let method_name = unsafe { std::str::from_utf8_unchecked(mir.method.name.as_slice()) };
        let src_file = {
            let cls = mir.method.class.get_class();
            cls.get_source_file()
        };
        let src_file = match src_file {
            Some(name) => {
                let name = unsafe { std::str::from_utf8_unchecked(name.as_slice()) };
                util::oop::new_java_lang_string2(name)
            }
            None => util::oop::new_java_lang_string2(""),
        };
        let line_num = mir.method.get_line_num((pc - 1) as u16);

        let elm = Oop::new_inst(elm_cls.clone());
        let args = vec![
            elm.clone(),
            util::oop::new_java_lang_string2(&cls_name),
            util::oop::new_java_lang_string2(method_name),
            src_file,
            Oop::new_int(line_num),
        ];
        runtime::invoke::invoke_ctor(
            elm_cls.clone(),
            new_br("(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V"),
            args,
        );

        traces.push(elm);
    }

    let stack_trace_ary = Oop::new_ref_ary2(ary_cls, traces);
    let throwable_cls = require_class3(None, b"java/lang/Throwable").unwrap();
    {
        let cls = throwable_cls.get_class();
        let id = cls.get_field_id(
            &new_br("stackTrace"),
            &new_br("[Ljava/lang/StackTraceElement;"),
            false,
        );
        Class::put_field_value(throwable_oop.extract_ref(), id, Oop::Null);
        let id = cls.get_field_id(&new_br("backtrace"), &new_br("Ljava/lang/Object;"), false);
        Class::put_field_value(throwable_oop.extract_ref(), id, stack_trace_ary);
    }

    Ok(Some(throwable_oop.clone()))
}

fn jvm_getStackTraceDepth(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let throwable = args.get(0).unwrap();
    let cls = {
        let rf = throwable.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };
    let backtrace = {
        let cls = cls.get_class();
        let id = cls.get_field_id(&new_br("backtrace"), &new_br("Ljava/lang/Object;"), false);
        Class::get_field_value(throwable.extract_ref(), id)
    };

    let v = match backtrace {
        Oop::Null => Oop::new_int(0),
        Oop::Ref(rf) => {
            let ary = rf.extract_array();
            let len = ary.elements.len();
            Oop::new_int(len as i32)
        }
        _ => unreachable!(),
    };

    Ok(Some(v))
}

fn jvm_getStackTraceElement(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let throwable = args.get(0).unwrap();
    let index = args.get(1).unwrap().extract_int();
    let cls = {
        let rf = throwable.extract_ref();
        let inst = rf.extract_inst();
        inst.class.clone()
    };
    let backtrace = {
        let cls = cls.get_class();
        let id = cls.get_field_id(&new_br("backtrace"), &new_br("Ljava/lang/Object;"), false);
        Class::get_field_value(throwable.extract_ref(), id)
    };

    let v = {
        let rf = backtrace.extract_ref();
        let ary = rf.extract_array();
        if index >= 0 && (index as usize) < ary.elements.len() {
            ary.elements[index as usize].clone()
        } else {
            Oop::Null
        }
    };

    Ok(Some(v))
}


================================================
FILE: crates/vm/src/native/java_lang_reflect_Array.rs
================================================
#![allow(non_snake_case)]

use crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};
use crate::oop::{self, Oop, ValueType};
use crate::runtime::require_class3;
use crate::types::ClassRef;

pub fn get_native_methods() -> Vec<JNINativeMethod> {
    vec![
        new_fn(
            "newArray",
            "(Ljava/lang/Class;I)Ljava/lang/Object;",
            Box::new(jvm_newArray),
        ),
        new_fn(
            "getLength",
            "(Ljava/lang/Object;)I",
            Box::new(jvm_getLength),
        ),
    ]
}

fn jvm_newArray(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let mirror = args.get(0).unwrap();
    //todo: throw NegativeArraySizeException
    let length = args.get(1).unwrap().extract_int();

    let (vt, component_cls) = {
        let rf = mirror.extract_ref();
        let mirror = rf.extract_mirror();
        (mirror.value_type, mirror.target.clone())
    };
    let name = build_ary_name(vt, component_cls);
    let ary_cls = require_class3(None, name.as_slice()).unwrap();
    let v = Oop::new_ref_ary(ary_cls, length as usize);

    Ok(Some(v))
}

fn jvm_getLength(_env: JNIEnv, args: &[Oop]) -> JNIResult {
    let ary = args.get(0).unwrap();
  
Download .txt
gitextract_9nbsz2bv/

├── .gitignore
├── Cargo.toml
├── LICENSE
├── README.md
├── crates/
│   ├── class-parser/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── class.rs
│   │       ├── lib.rs
│   │       └── signature.rs
│   ├── class-verification/
│   │   ├── Cargo.toml
│   │   └── src/
│   │       ├── checker.rs
│   │       └── lib.rs
│   ├── classfile/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   └── src/
│   │       ├── attributes.rs
│   │       ├── classfile.rs
│   │       ├── constant_pool.rs
│   │       ├── consts.rs
│   │       ├── field_info.rs
│   │       ├── flags.rs
│   │       ├── lib.rs
│   │       ├── method_info.rs
│   │       ├── opcode.rs
│   │       ├── signature.rs
│   │       └── version.rs
│   └── vm/
│       ├── Cargo.toml
│       ├── README.md
│       └── src/
│           ├── lib.rs
│           ├── native/
│           │   ├── common/
│           │   │   ├── check_format.rs
│           │   │   ├── mod.rs
│           │   │   └── reflect.rs
│           │   ├── java_io_FileDescriptor.rs
│           │   ├── java_io_FileInputStream.rs
│           │   ├── java_io_FileOutputStream.rs
│           │   ├── java_io_UnixFileSystem.rs
│           │   ├── java_lang_Class.rs
│           │   ├── java_lang_ClassLoader.rs
│           │   ├── java_lang_Double.rs
│           │   ├── java_lang_Float.rs
│           │   ├── java_lang_Object.rs
│           │   ├── java_lang_Runtime.rs
│           │   ├── java_lang_String.rs
│           │   ├── java_lang_System.rs
│           │   ├── java_lang_Thread.rs
│           │   ├── java_lang_Throwable.rs
│           │   ├── java_lang_reflect_Array.rs
│           │   ├── java_lang_reflect_Proxy.rs
│           │   ├── java_security_AccessController.rs
│           │   ├── java_util_concurrent_atomic_AtomicLong.rs
│           │   ├── mod.rs
│           │   ├── sun_misc_Signal.rs
│           │   ├── sun_misc_URLClassPath.rs
│           │   ├── sun_misc_Unsafe.rs
│           │   ├── sun_misc_VM.rs
│           │   ├── sun_nio_cs_StreamEncoder.rs
│           │   ├── sun_reflect_ConstantPool.rs
│           │   ├── sun_reflect_NativeConstructorAccessorImpl.rs
│           │   ├── sun_reflect_NativeMethodAccessorImpl.rs
│           │   └── sun_reflect_Reflection.rs
│           ├── oop/
│           │   ├── ary.rs
│           │   ├── class.rs
│           │   ├── consts.rs
│           │   ├── field.rs
│           │   ├── inst.rs
│           │   ├── mirror.rs
│           │   ├── mod.rs
│           │   ├── reference.rs
│           │   └── values.rs
│           ├── runtime/
│           │   ├── class_loader.rs
│           │   ├── class_path_manager.rs
│           │   ├── cmp.rs
│           │   ├── constant_pool.rs
│           │   ├── consts.rs
│           │   ├── dataarea.rs
│           │   ├── exception.rs
│           │   ├── frame.rs
│           │   ├── init_vm.rs
│           │   ├── interp.rs
│           │   ├── invoke.rs
│           │   ├── local.rs
│           │   ├── method.rs
│           │   ├── mod.rs
│           │   ├── slot.rs
│           │   ├── stack.rs
│           │   ├── sys_dic.rs
│           │   ├── thread/
│           │   │   ├── condvar.rs
│           │   │   ├── java_thread.rs
│           │   │   ├── main.rs
│           │   │   ├── mod.rs
│           │   │   ├── mutex.rs
│           │   │   ├── thread_pool.rs
│           │   │   └── threads.rs
│           │   └── vm.rs
│           ├── types.rs
│           └── util/
│               ├── attributes.rs
│               ├── consts.rs
│               ├── debug.rs
│               ├── macros.rs
│               ├── mod.rs
│               ├── oop.rs
│               └── sys.rs
├── jvm/
│   ├── Cargo.toml
│   ├── README.md
│   ├── r.sh
│   ├── sample/
│   │   └── HelloWorld.java
│   ├── src/
│   │   ├── main.rs
│   │   └── options.rs
│   └── t.sh
├── libjvm/
│   ├── Cargo.toml
│   ├── README.md
│   └── src/
│       ├── invocation.rs
│       ├── lib.rs
│       ├── native.rs
│       ├── private.rs
│       └── util.rs
├── note.txt
└── tools/
    ├── javap/
    │   ├── Cargo.toml
    │   ├── run.sh
    │   ├── src/
    │   │   ├── cmd/
    │   │   │   ├── disassemble.rs
    │   │   │   └── mod.rs
    │   │   ├── main.rs
    │   │   ├── misc/
    │   │   │   ├── class_path_manager.rs
    │   │   │   ├── mod.rs
    │   │   │   └── sys_info.rs
    │   │   ├── sd/
    │   │   │   └── mod.rs
    │   │   ├── strategy.rs
    │   │   ├── template.rs
    │   │   ├── trans/
    │   │   │   ├── access_flag.rs
    │   │   │   ├── class_file.rs
    │   │   │   ├── code.rs
    │   │   │   ├── constant_pool_trans.rs
    │   │   │   ├── field.rs
    │   │   │   ├── instruction/
    │   │   │   │   ├── aaload.rs
    │   │   │   │   ├── aastore.rs
    │   │   │   │   ├── aconst_null.rs
    │   │   │   │   ├── aload.rs
    │   │   │   │   ├── aload_0.rs
    │   │   │   │   ├── aload_1.rs
    │   │   │   │   ├── aload_2.rs
    │   │   │   │   ├── aload_3.rs
    │   │   │   │   ├── anewarray.rs
    │   │   │   │   ├── areturn.rs
    │   │   │   │   ├── arraylength.rs
    │   │   │   │   ├── astore.rs
    │   │   │   │   ├── astore_0.rs
    │   │   │   │   ├── astore_1.rs
    │   │   │   │   ├── astore_2.rs
    │   │   │   │   ├── astore_3.rs
    │   │   │   │   ├── athrow.rs
    │   │   │   │   ├── baload.rs
    │   │   │   │   ├── bastore.rs
    │   │   │   │   ├── bipush.rs
    │   │   │   │   ├── caload.rs
    │   │   │   │   ├── castore.rs
    │   │   │   │   ├── checkcast.rs
    │   │   │   │   ├── d2f.rs
    │   │   │   │   ├── d2i.rs
    │   │   │   │   ├── d2l.rs
    │   │   │   │   ├── dadd.rs
    │   │   │   │   ├── daload.rs
    │   │   │   │   ├── dastore.rs
    │   │   │   │   ├── dcmpg.rs
    │   │   │   │   ├── dcmpl.rs
    │   │   │   │   ├── dconst_0.rs
    │   │   │   │   ├── dconst_1.rs
    │   │   │   │   ├── ddiv.rs
    │   │   │   │   ├── dload.rs
    │   │   │   │   ├── dload_0.rs
    │   │   │   │   ├── dload_1.rs
    │   │   │   │   ├── dload_2.rs
    │   │   │   │   ├── dload_3.rs
    │   │   │   │   ├── dmul.rs
    │   │   │   │   ├── dneg.rs
    │   │   │   │   ├── drem.rs
    │   │   │   │   ├── dreturn.rs
    │   │   │   │   ├── dstore.rs
    │   │   │   │   ├── dstore_0.rs
    │   │   │   │   ├── dstore_1.rs
    │   │   │   │   ├── dstore_2.rs
    │   │   │   │   ├── dstore_3.rs
    │   │   │   │   ├── dsub.rs
    │   │   │   │   ├── dup.rs
    │   │   │   │   ├── dup2.rs
    │   │   │   │   ├── dup2_x1.rs
    │   │   │   │   ├── dup2_x2.rs
    │   │   │   │   ├── dup_x1.rs
    │   │   │   │   ├── dup_x2.rs
    │   │   │   │   ├── f2d.rs
    │   │   │   │   ├── f2i.rs
    │   │   │   │   ├── f2l.rs
    │   │   │   │   ├── fadd.rs
    │   │   │   │   ├── faload.rs
    │   │   │   │   ├── fastore.rs
    │   │   │   │   ├── fcmpg.rs
    │   │   │   │   ├── fcmpl.rs
    │   │   │   │   ├── fconst_0.rs
    │   │   │   │   ├── fconst_1.rs
    │   │   │   │   ├── fconst_2.rs
    │   │   │   │   ├── fdiv.rs
    │   │   │   │   ├── fload.rs
    │   │   │   │   ├── fload_0.rs
    │   │   │   │   ├── fload_1.rs
    │   │   │   │   ├── fload_2.rs
    │   │   │   │   ├── fload_3.rs
    │   │   │   │   ├── fmul.rs
    │   │   │   │   ├── fneg.rs
    │   │   │   │   ├── frem.rs
    │   │   │   │   ├── freturn.rs
    │   │   │   │   ├── fstore.rs
    │   │   │   │   ├── fstore_0.rs
    │   │   │   │   ├── fstore_1.rs
    │   │   │   │   ├── fstore_2.rs
    │   │   │   │   ├── fstore_3.rs
    │   │   │   │   ├── fsub.rs
    │   │   │   │   ├── getfield.rs
    │   │   │   │   ├── getstatic.rs
    │   │   │   │   ├── goto.rs
    │   │   │   │   ├── goto_w.rs
    │   │   │   │   ├── i2b.rs
    │   │   │   │   ├── i2c.rs
    │   │   │   │   ├── i2d.rs
    │   │   │   │   ├── i2f.rs
    │   │   │   │   ├── i2l.rs
    │   │   │   │   ├── i2s.rs
    │   │   │   │   ├── iadd.rs
    │   │   │   │   ├── iaload.rs
    │   │   │   │   ├── iand.rs
    │   │   │   │   ├── iastore.rs
    │   │   │   │   ├── iconst_0.rs
    │   │   │   │   ├── iconst_1.rs
    │   │   │   │   ├── iconst_2.rs
    │   │   │   │   ├── iconst_3.rs
    │   │   │   │   ├── iconst_4.rs
    │   │   │   │   ├── iconst_5.rs
    │   │   │   │   ├── iconst_m1.rs
    │   │   │   │   ├── idiv.rs
    │   │   │   │   ├── if_acmpeq.rs
    │   │   │   │   ├── if_acmpne.rs
    │   │   │   │   ├── if_icmpeq.rs
    │   │   │   │   ├── if_icmpge.rs
    │   │   │   │   ├── if_icmpgt.rs
    │   │   │   │   ├── if_icmple.rs
    │   │   │   │   ├── if_icmplt.rs
    │   │   │   │   ├── if_icmpne.rs
    │   │   │   │   ├── ifeq.rs
    │   │   │   │   ├── ifge.rs
    │   │   │   │   ├── ifgt.rs
    │   │   │   │   ├── ifle.rs
    │   │   │   │   ├── iflt.rs
    │   │   │   │   ├── ifne.rs
    │   │   │   │   ├── ifnonnull.rs
    │   │   │   │   ├── ifnull.rs
    │   │   │   │   ├── iinc.rs
    │   │   │   │   ├── iload.rs
    │   │   │   │   ├── iload_0.rs
    │   │   │   │   ├── iload_1.rs
    │   │   │   │   ├── iload_2.rs
    │   │   │   │   ├── iload_3.rs
    │   │   │   │   ├── imul.rs
    │   │   │   │   ├── ineg.rs
    │   │   │   │   ├── instanceof.rs
    │   │   │   │   ├── invokedynamic.rs
    │   │   │   │   ├── invokeinterface.rs
    │   │   │   │   ├── invokespecial.rs
    │   │   │   │   ├── invokestatic.rs
    │   │   │   │   ├── invokevirtual.rs
    │   │   │   │   ├── ior.rs
    │   │   │   │   ├── irem.rs
    │   │   │   │   ├── ireturn.rs
    │   │   │   │   ├── ishl.rs
    │   │   │   │   ├── ishr.rs
    │   │   │   │   ├── istore.rs
    │   │   │   │   ├── istore_0.rs
    │   │   │   │   ├── istore_1.rs
    │   │   │   │   ├── istore_2.rs
    │   │   │   │   ├── istore_3.rs
    │   │   │   │   ├── isub.rs
    │   │   │   │   ├── iushr.rs
    │   │   │   │   ├── ixor.rs
    │   │   │   │   ├── jsr.rs
    │   │   │   │   ├── jsr_w.rs
    │   │   │   │   ├── l2d.rs
    │   │   │   │   ├── l2f.rs
    │   │   │   │   ├── l2i.rs
    │   │   │   │   ├── ladd.rs
    │   │   │   │   ├── laload.rs
    │   │   │   │   ├── land.rs
    │   │   │   │   ├── lastore.rs
    │   │   │   │   ├── lcmp.rs
    │   │   │   │   ├── lconst_0.rs
    │   │   │   │   ├── lconst_1.rs
    │   │   │   │   ├── ldc.rs
    │   │   │   │   ├── ldc2_w.rs
    │   │   │   │   ├── ldc_w.rs
    │   │   │   │   ├── ldiv.rs
    │   │   │   │   ├── lload.rs
    │   │   │   │   ├── lload_0.rs
    │   │   │   │   ├── lload_1.rs
    │   │   │   │   ├── lload_2.rs
    │   │   │   │   ├── lload_3.rs
    │   │   │   │   ├── lmul.rs
    │   │   │   │   ├── lneg.rs
    │   │   │   │   ├── lookupswitch.rs
    │   │   │   │   ├── lor.rs
    │   │   │   │   ├── lrem.rs
    │   │   │   │   ├── lreturn.rs
    │   │   │   │   ├── lshl.rs
    │   │   │   │   ├── lshr.rs
    │   │   │   │   ├── lstore.rs
    │   │   │   │   ├── lstore_0.rs
    │   │   │   │   ├── lstore_1.rs
    │   │   │   │   ├── lstore_2.rs
    │   │   │   │   ├── lstore_3.rs
    │   │   │   │   ├── lsub.rs
    │   │   │   │   ├── lushr.rs
    │   │   │   │   ├── lxor.rs
    │   │   │   │   ├── mod.rs
    │   │   │   │   ├── monitorenter.rs
    │   │   │   │   ├── monitorexit.rs
    │   │   │   │   ├── multianewarray.rs
    │   │   │   │   ├── new.rs
    │   │   │   │   ├── newarray.rs
    │   │   │   │   ├── nop.rs
    │   │   │   │   ├── pop.rs
    │   │   │   │   ├── pop2.rs
    │   │   │   │   ├── putfield.rs
    │   │   │   │   ├── putstatic.rs
    │   │   │   │   ├── ret.rs
    │   │   │   │   ├── return_void.rs
    │   │   │   │   ├── saload.rs
    │   │   │   │   ├── sastore.rs
    │   │   │   │   ├── sipush.rs
    │   │   │   │   ├── swap.rs
    │   │   │   │   ├── tableswitch.rs
    │   │   │   │   └── wide.rs
    │   │   │   ├── method.rs
    │   │   │   ├── mod.rs
    │   │   │   └── signature_type.rs
    │   │   └── util/
    │   │       ├── mod.rs
    │   │       └── sys.rs
    │   └── test/
    │       ├── AbstractGraphicObject.java
    │       ├── EnumMobile.java
    │       ├── Football.java
    │       ├── HelloWorld.java
    │       ├── Hockey.java
    │       ├── Interface1.java
    │       └── Sports.java
    └── misc/
        ├── instruction.py
        └── native.py
Download .txt
SYMBOL INDEX (1780 symbols across 318 files)

FILE: crates/class-parser/src/class.rs
  function constant_pool (line 117) | fn constant_pool(input: &[u8]) -> nom::IResult<&[u8], ConstantPool> {
  function parse (line 712) | pub fn parse(input: &[u8]) -> nom::IResult<&[u8], ClassFile> {

FILE: crates/class-parser/src/signature.rs
  type ClassSignature (line 19) | pub struct ClassSignature {
    method new (line 43) | pub fn new(raw: &[u8]) -> Self {
    method parse (line 49) | fn parse(i: &str) -> IResult<&str, ClassSignature> {
  type MethodSignature (line 24) | pub struct MethodSignature {
    method new (line 56) | pub fn new(raw: &[u8]) -> Self {
    method parse (line 62) | fn parse(i: &str) -> IResult<&str, MethodSignature> {
  type FieldSignature (line 38) | pub struct FieldSignature {
    method new (line 106) | pub fn new(raw: &[u8]) -> Self {
    method parse (line 112) | fn parse(mut i: &str) -> IResult<&str, FieldSignature> {
  method default (line 119) | fn default() -> Self {
  function primitive (line 132) | fn primitive<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Ty...
  function object_desc (line 150) | fn object_desc<'a, E: ParseError<&'a str>>(input: &'a str) -> IResult<&s...
  function object_generic (line 166) | fn object_generic<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&st...
  function object_normal (line 194) | fn object_normal<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str...
  function object (line 200) | fn object<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type,...
  function array (line 204) | fn array<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, Type, ...
  function generic_declare (line 227) | fn generic_declare<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&s...
  function parse_type (line 235) | fn parse_type<'a, E: ParseError<&'a str>>(i: &'a str) -> IResult<&str, T...
  function parse_types (line 239) | fn parse_types<'a, E: ParseError<&'a str>>(mut input: &'a str) -> IResul...
  function t_method_no_arg (line 271) | fn t_method_no_arg() {
  function method_primitive (line 283) | fn method_primitive() {
  function method_array_object (line 359) | fn method_array_object() {
  function method_mix (line 373) | fn method_mix() {
  function method_arg_generic (line 396) | fn method_arg_generic() {
  function generic1 (line 452) | fn generic1() {
  function generic2 (line 468) | fn generic2() {
  function generic_nest1 (line 492) | fn generic_nest1() {
  function generic_method (line 526) | fn generic_method() {
  function method_return_generic (line 561) | fn method_return_generic() {
  function field (line 583) | fn field() {
  function t_class_signature (line 614) | fn t_class_signature() {

FILE: crates/class-verification/src/checker.rs
  type Err (line 4) | pub enum Err {
  type CheckResult (line 28) | pub type CheckResult = Result<(), Err>;
  type Checker (line 30) | pub trait Checker {
    method check (line 31) | fn check(&self, cp: &ConstantPool) -> CheckResult;

FILE: crates/classfile/src/attributes.rs
  type Type (line 5) | pub enum Type {
  type Tag (line 81) | pub enum Tag {
    method from (line 109) | fn from(raw: &[u8]) -> Self {
  type Code (line 146) | pub struct Code {
  type CodeException (line 155) | pub struct CodeException {
    method contains (line 163) | pub fn contains(&self, pc: U2) -> bool {
    method is_finally (line 167) | pub fn is_finally(&self) -> bool {
  type AttributeInfo (line 173) | pub struct AttributeInfo {
  type NestedClassAccessPropertyFlag (line 179) | pub enum NestedClassAccessPropertyFlag {
  type InnerClass (line 193) | pub struct InnerClass {
  type LineNumber (line 201) | pub struct LineNumber {
  type LocalVariable (line 207) | pub struct LocalVariable {
  type ElementValueTag (line 216) | pub enum ElementValueTag {
    method from (line 234) | fn from(v: u8) -> Self {
  type ElementValueType (line 255) | pub enum ElementValueType {
  type AnnotationElementValue (line 273) | pub struct AnnotationElementValue {
  type ElementValuePair (line 278) | pub struct ElementValuePair {
  type AnnotationEntry (line 284) | pub struct AnnotationEntry {
  type BootstrapMethod (line 290) | pub struct BootstrapMethod {
  type MethodParameterAccessFlag (line 296) | pub enum MethodParameterAccessFlag {
  type MethodParameter (line 303) | pub struct MethodParameter {
  type VerificationTypeInfo (line 309) | pub enum VerificationTypeInfo {
  type StackMapFrame (line 322) | pub enum StackMapFrame {
  type TypeAnnotation (line 360) | pub struct TypeAnnotation {
  type TargetInfo (line 368) | pub enum TargetInfo {
  type LocalVarTargetTable (line 402) | pub struct LocalVarTargetTable {
  type TypePath (line 409) | pub struct TypePath {
  type EnclosingMethod (line 415) | pub struct EnclosingMethod {

FILE: crates/classfile/src/classfile.rs
  type ClassFile (line 6) | pub struct ClassFile {
    method inner_classes (line 19) | pub fn inner_classes(&self) -> Option<Vec<InnerClass>> {
    method signature (line 29) | pub fn signature(&self) -> Option<usize> {

FILE: crates/classfile/src/constant_pool.rs
  function get_class_name (line 10) | pub fn get_class_name(cp: &ConstantPool, idx: usize) -> &BytesRef {
  function get_field_ref (line 17) | pub fn get_field_ref(cp: &ConstantPool, idx: usize) -> (u16, u16) {
  function get_method_ref (line 27) | pub fn get_method_ref(cp: &ConstantPool, idx: usize) -> (u8, u16, u16) {
  function get_name_and_type (line 45) | pub fn get_name_and_type(cp: &ConstantPool, idx: usize) -> (&BytesRef, &...
  function get_utf8 (line 58) | pub fn get_utf8(cp: &ConstantPool, idx: usize) -> &BytesRef {
  function get_string (line 65) | pub fn get_string(cp: &ConstantPool, idx: usize) -> String {
  function construct_string_raw (line 76) | pub fn construct_string_raw(bs: &[u8]) -> Vec<u16> {
  type Type (line 126) | pub enum Type {
    method as_cp_item (line 220) | pub fn as_cp_item<'a, 'b>(&'a self, cp: &'b ConstantPool) -> ConstantP...
  type Tag (line 180) | pub enum Tag {
    method from (line 198) | fn from(tag: u8) -> Self {
  type ConstantPoolItem (line 225) | pub struct ConstantPoolItem<'item, 'cp> {
  method fmt (line 231) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: crates/classfile/src/consts.rs
  constant MAGIC (line 3) | pub const MAGIC: U4 = 0xCAFEBABE;
  constant METHOD_NAME_INIT (line 5) | pub const METHOD_NAME_INIT: &[u8] = b"<init>";
  constant METHOD_NAME_CLINIT (line 6) | pub const METHOD_NAME_CLINIT: &[u8] = b"<clinit>";
  constant MAX_CP_ENTRIES (line 8) | pub const MAX_CP_ENTRIES: u16 = 65535;
  constant MAX_FIELDS_NUM (line 9) | pub const MAX_FIELDS_NUM: u16 = 65535;
  constant MAX_METHODS_NUM (line 10) | pub const MAX_METHODS_NUM: u16 = 65535;
  constant MAX_DIRECT_SUPER_INTERFACES_NUM (line 11) | pub const MAX_DIRECT_SUPER_INTERFACES_NUM: u16 = 65535;
  constant MAX_LOCAL_VARS_NUM (line 12) | pub const MAX_LOCAL_VARS_NUM: u16 = 65535;
  constant MAX_OP_STACKS_SIZE (line 13) | pub const MAX_OP_STACKS_SIZE: u16 = 65535;
  constant MAX_METHOD_PARAMS_NUM (line 14) | pub const MAX_METHOD_PARAMS_NUM: u16 = 255;
  constant MAX_CONST_STR_LEN (line 15) | pub const MAX_CONST_STR_LEN: u16 = 65535;
  constant MAX_ARRAY_DIMENSIONS (line 16) | pub const MAX_ARRAY_DIMENSIONS: u16 = 255;
  constant J_OBJECT (line 18) | pub const J_OBJECT: &[u8] = b"java/lang/Object";
  constant J_CLONEABLE (line 19) | pub const J_CLONEABLE: &[u8] = b"java/lang/Cloneable";
  constant J_SERIALIZABLE (line 20) | pub const J_SERIALIZABLE: &[u8] = b"java/io/Serializable";
  constant J_CLASS (line 21) | pub const J_CLASS: &[u8] = b"java/lang/Class";
  constant J_STRING (line 22) | pub const J_STRING: &[u8] = b"java/lang/String";
  constant J_THREAD (line 23) | pub const J_THREAD: &[u8] = b"java/lang/Thread";
  constant J_THREAD_GROUP (line 24) | pub const J_THREAD_GROUP: &[u8] = b"java/lang/ThreadGroup";
  constant J_SYSTEM (line 25) | pub const J_SYSTEM: &[u8] = b"java/lang/System";
  constant J_INPUT_STREAM (line 27) | pub const J_INPUT_STREAM: &[u8] = b"java/io/InputStream";
  constant J_PRINT_STREAM (line 28) | pub const J_PRINT_STREAM: &[u8] = b"java/io/PrintStream";
  constant J_SECURITY_MANAGER (line 29) | pub const J_SECURITY_MANAGER: &[u8] = b"java/lang/SecurityManager";
  constant J_FIELD (line 31) | pub const J_FIELD: &[u8] = b"java/lang/reflect/Field";
  constant J_METHOD (line 32) | pub const J_METHOD: &[u8] = b"java/lang/reflect/Method";
  constant J_METHOD_CTOR (line 33) | pub const J_METHOD_CTOR: &[u8] = b"java/lang/reflect/Constructor";
  constant J_ACCESSIBLE_OBJECT (line 34) | pub const J_ACCESSIBLE_OBJECT: &[u8] = b"java/lang/reflect/AccessibleObj...
  constant J_METHODHANDLE (line 35) | pub const J_METHODHANDLE: &[u8] = b"java/lang/invoke/MethodHandle";
  constant J_METHODTYPE (line 36) | pub const J_METHODTYPE: &[u8] = b"java/lang/invoke/MethodType";
  constant J_INTERNAL_ERROR (line 38) | pub const J_INTERNAL_ERROR: &[u8] = b"java/lang/InternalError";
  constant J_NPE (line 39) | pub const J_NPE: &[u8] = b"java/lang/NullPointerException";
  constant J_IOEXCEPTION (line 40) | pub const J_IOEXCEPTION: &[u8] = b"java/io/IOException";
  constant J_ARRAY_INDEX_OUT_OF_BOUNDS (line 41) | pub const J_ARRAY_INDEX_OUT_OF_BOUNDS: &[u8] = b"java/lang/ArrayIndexOut...
  constant J_CLASS_NOT_FOUND (line 42) | pub const J_CLASS_NOT_FOUND: &[u8] = b"java/lang/ClassNotFoundException";
  constant J_ARITHMETIC_EX (line 43) | pub const J_ARITHMETIC_EX: &[u8] = b"java/lang/ArithmeticException";
  constant J_SOE (line 44) | pub const J_SOE: &[u8] = b"java/lang/StackOverflowError";
  constant J_NASE (line 45) | pub const J_NASE: &[u8] = b"java/lang/NegativeArraySizeException";
  constant J_CCE (line 46) | pub const J_CCE: &[u8] = b"java/lang/ClassCastException";
  constant J_THROWABLE (line 47) | pub const J_THROWABLE: &[u8] = b"java/lang/Throwable";
  constant CONSTANT_METHOD_REF_TAG (line 49) | pub const CONSTANT_METHOD_REF_TAG: u8 = 10;
  constant CONSTANT_INTERFACE_METHOD_REF_TAG (line 50) | pub const CONSTANT_INTERFACE_METHOD_REF_TAG: u8 = 11;

FILE: crates/classfile/src/field_info.rs
  type FieldInfo (line 5) | pub struct FieldInfo {

FILE: crates/classfile/src/lib.rs
  type U1 (line 24) | pub type U1 = u8;
  type U2 (line 25) | pub type U2 = u16;
  type U4 (line 26) | pub type U4 = u32;
  type BytesRef (line 27) | pub type BytesRef = std::sync::Arc<Vec<u8>>;
  type ConstantPool (line 28) | pub type ConstantPool = std::sync::Arc<Vec<constant_pool::Type>>;

FILE: crates/classfile/src/method_info.rs
  type MethodInfo (line 7) | pub struct MethodInfo {
    method get_code (line 15) | pub fn get_code(&self) -> Option<Code> {
    method get_line_number_table (line 25) | pub fn get_line_number_table(&self) -> Vec<LineNumber> {
    method get_throws (line 41) | pub fn get_throws(&self) -> Option<Vec<U2>> {
    method get_ex_table (line 51) | pub fn get_ex_table(&self) -> Option<Vec<CodeException>> {
    method get_stack_map_table (line 63) | pub fn get_stack_map_table(&self) -> Option<Vec<StackMapFrame>> {
    method get_local_variable_table (line 75) | pub fn get_local_variable_table(&self) -> Option<Vec<LocalVariable>> {
    method get_local_variable_type_table (line 87) | pub fn get_local_variable_type_table(&self) -> Option<Vec<LocalVariabl...

FILE: crates/classfile/src/opcode.rs
  type OpCode (line 5) | pub enum OpCode {
    method from (line 226) | fn from(v: u8) -> Self {
    method into (line 439) | fn into(self) -> &'static str {
  function t_opcode (line 653) | fn t_opcode() {

FILE: crates/classfile/src/signature.rs
  type Type (line 5) | pub enum Type {
    method fmt (line 27) | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {

FILE: crates/classfile/src/version.rs
  type Version (line 4) | pub struct Version {

FILE: crates/vm/src/lib.rs
  function init_vm (line 15) | pub fn init_vm() {
  function new_br (line 22) | pub fn new_br(s: &str) -> classfile::BytesRef {

FILE: crates/vm/src/native/common/reflect.rs
  function new_field (line 13) | pub fn new_field(fir: FieldIdRef) -> Oop {
  function new_method_ctor (line 54) | pub fn new_method_ctor(mir: MethodIdRef) -> Oop {
  function new_method_normal (line 127) | pub fn new_method_normal(mir: MethodIdRef) -> Oop {
  function get_Constructor_clazz (line 221) | pub fn get_Constructor_clazz(ctor: &Oop) -> Oop {
  function get_Constructor_signature (line 253) | pub fn get_Constructor_signature(ctor: &Oop) -> String {
  function create_value_type (line 268) | fn create_value_type(t: SignatureType) -> Oop {

FILE: crates/vm/src/native/java_io_FileDescriptor.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_initIDs (line 10) | fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_io_FileInputStream.rs
  function get_native_methods (line 11) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_initIDs (line 23) | fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_open0 (line 43) | fn jvm_open0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_readBytes (line 60) | fn jvm_readBytes(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_available0 (line 93) | fn jvm_available0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_close0 (line 140) | fn jvm_close0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function set_file_descriptor_fd (line 149) | fn set_file_descriptor_fd(fin: &Oop, fd: i32) {
  function get_file_descriptor_fd (line 157) | fn get_file_descriptor_fd(fin: &Oop) -> i32 {

FILE: crates/vm/src/native/java_io_FileOutputStream.rs
  function get_native_methods (line 11) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_initIDs (line 19) | fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_writeBytes (line 39) | fn jvm_writeBytes(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_open0 (line 66) | fn jvm_open0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function get_file_descriptor_fd (line 91) | fn get_file_descriptor_fd(fos: &Oop) -> i32 {
  function set_file_descriptor_fd (line 105) | fn set_file_descriptor_fd(fos: &Oop, fd: i32) {

FILE: crates/vm/src/native/java_io_UnixFileSystem.rs
  constant BA_EXISTS (line 12) | const BA_EXISTS: i32 = 0x01;
  constant BA_REGULAR (line 13) | const BA_REGULAR: i32 = 0x02;
  constant BA_DIRECTORY (line 14) | const BA_DIRECTORY: i32 = 0x04;
  constant _BA_HIDDEN (line 15) | const _BA_HIDDEN: i32 = 0x08;
  constant ACCESS_READ (line 16) | const ACCESS_READ: i32 = 0x04;
  constant ACCESS_WRITE (line 17) | const ACCESS_WRITE: i32 = 0x02;
  constant ACCESS_EXECUTE (line 18) | const ACCESS_EXECUTE: i32 = 0x01;
  function get_native_methods (line 20) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_initIDs (line 46) | fn jvm_initIDs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_getBooleanAttributes0 (line 57) | fn jvm_getBooleanAttributes0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_checkAccess (line 75) | fn jvm_checkAccess(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_canonicalize0 (line 105) | fn jvm_canonicalize0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_createFileExclusively (line 116) | fn jvm_createFileExclusively(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function get_File_path (line 134) | fn get_File_path(file: &Oop) -> String {

FILE: crates/vm/src/native/java_lang_Class.rs
  function get_primitive_class_mirror (line 12) | pub fn get_primitive_class_mirror(key: &str) -> Option<Oop> {
  function get_native_methods (line 18) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  type ClassMirrorState (line 111) | enum ClassMirrorState {
  function init (line 154) | pub fn init() {
  function create_mirror (line 162) | pub fn create_mirror(cls: ClassRef) {
  function create_delayed_mirrors (line 196) | pub fn create_delayed_mirrors() {
  function create_delayed_ary_mirrors (line 239) | pub fn create_delayed_ary_mirrors() {
  function jvm_registerNatives (line 260) | fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_desiredAssertionStatus0 (line 264) | fn jvm_desiredAssertionStatus0(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_getPrimitiveClass (line 268) | fn jvm_getPrimitiveClass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getDeclaredFields0 (line 277) | fn jvm_getDeclaredFields0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getName0 (line 321) | fn jvm_getName0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_forName0 (line 347) | fn jvm_forName0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_isPrimitive (line 402) | fn jvm_isPrimitive(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_isAssignableFrom (line 416) | fn jvm_isAssignableFrom(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_isInterface (line 451) | fn jvm_isInterface(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getDeclaredConstructors0 (line 471) | fn jvm_getDeclaredConstructors0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getModifiers (line 481) | pub fn jvm_getModifiers(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getSuperclass (line 518) | fn jvm_getSuperclass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_isArray (line 538) | fn jvm_isArray(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getComponentType (line 559) | fn jvm_getComponentType(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getEnclosingMethod0 (line 584) | fn jvm_getEnclosingMethod0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getDeclaringClass0 (line 642) | fn jvm_getDeclaringClass0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_isInstance (line 694) | fn jvm_isInstance(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getDeclaredMethods0 (line 724) | fn jvm_getDeclaredMethods0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getInterfaces0 (line 734) | fn jvm_getInterfaces0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getRawAnnotations (line 779) | fn jvm_getRawAnnotations(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getConstantPool (line 798) | fn jvm_getConstantPool(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getDeclaredClasses0 (line 819) | fn jvm_getDeclaredClasses0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getGenericSignature0 (line 852) | fn jvm_getGenericSignature0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function get_declared_method_helper (line 879) | fn get_declared_method_helper(
  function extract_mirror_target (line 945) | fn extract_mirror_target(v: &Oop) -> ClassRef {

FILE: crates/vm/src/native/java_lang_ClassLoader.rs
  function get_native_methods (line 8) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_registerNatives (line 29) | fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_findBuiltinLib (line 33) | fn jvm_findBuiltinLib(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_findLoadedClass0 (line 40) | fn jvm_findLoadedClass0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_findBootstrapClass (line 56) | fn jvm_findBootstrapClass(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_Double.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_doubleToRawLongBits (line 17) | fn jvm_doubleToRawLongBits(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_longBitsToDouble (line 24) | fn jvm_longBitsToDouble(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_Float.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_floatToRawIntBits (line 14) | fn jvm_floatToRawIntBits(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_Object.rs
  function get_native_methods (line 7) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_registerNatives (line 18) | fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_hashCode (line 22) | pub fn jvm_hashCode(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_clone (line 29) | fn jvm_clone(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getClass (line 35) | fn jvm_getClass(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_notifyAll (line 55) | fn jvm_notifyAll(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_wait (line 62) | fn jvm_wait(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_Runtime.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_availableProcessors (line 18) | fn jvm_availableProcessors(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_gc (line 22) | fn jvm_gc(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_String.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_intern (line 14) | fn jvm_intern(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_System.rs
  function get_native_methods (line 10) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_registerNatives (line 48) | fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_arraycopy (line 52) | fn jvm_arraycopy(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_initProperties (line 87) | fn jvm_initProperties(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function put_props_kv (line 161) | fn put_props_kv(props: &Oop, k: &str, v: &str) {
  function jvm_setIn0 (line 188) | fn jvm_setIn0(env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_setOut0 (line 197) | fn jvm_setOut0(env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_setErr0 (line 206) | fn jvm_setErr0(env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_mapLibraryName (line 215) | fn jvm_mapLibraryName(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_loadLibrary (line 244) | fn jvm_loadLibrary(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_identityHashCode (line 248) | fn jvm_identityHashCode(env: JNIEnv, args: &[Oop]) -> JNIResult {
  function arraycopy_same_obj (line 289) | fn arraycopy_same_obj(buf: Arc<OopPtr>, src_pos: usize, dest_pos: usize,...
  function arraycopy_diff_obj (line 334) | pub fn arraycopy_diff_obj(
  function jvm_nanoTime (line 397) | fn jvm_nanoTime(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_currentTimeMillis (line 406) | fn jvm_currentTimeMillis(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_Thread.rs
  function get_native_methods (line 9) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_registerNatives (line 24) | fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_currentThread (line 28) | fn jvm_currentThread(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_setPriority0 (line 34) | fn jvm_setPriority0(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_isAlive (line 40) | fn jvm_isAlive(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_start0 (line 60) | fn jvm_start0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_isInterrupted (line 115) | fn jvm_isInterrupted(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_Throwable.rs
  function get_native_methods (line 9) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_fillInStackTrace (line 29) | fn jvm_fillInStackTrace(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getStackTraceDepth (line 138) | fn jvm_getStackTraceDepth(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getStackTraceElement (line 164) | fn jvm_getStackTraceElement(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/java_lang_reflect_Array.rs
  function get_native_methods (line 8) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_newArray (line 23) | fn jvm_newArray(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getLength (line 40) | fn jvm_getLength(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function build_ary_name (line 56) | fn build_ary_name(vt: ValueType, component_cls: Option<ClassRef>) -> Vec...

FILE: crates/vm/src/native/java_lang_reflect_Proxy.rs
  function get_native_methods (line 12) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_defineClass0 (line 20) | fn jvm_defineClass0(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function do_parse_class (line 45) | fn do_parse_class(v: &Oop, off: usize, len: usize) -> ClassRef {

FILE: crates/vm/src/native/java_security_AccessController.rs
  function get_native_methods (line 8) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_doPrivileged (line 29) | fn jvm_doPrivileged(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_doPrivileged2 (line 63) | fn jvm_doPrivileged2(env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_doPrivileged3 (line 68) | fn jvm_doPrivileged3(env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getStackAccessControlContext (line 72) | fn jvm_getStackAccessControlContext(_env: JNIEnv, _args: &[Oop]) -> JNIR...

FILE: crates/vm/src/native/java_util_concurrent_atomic_AtomicLong.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_VMSupportsCS8 (line 10) | fn jvm_VMSupportsCS8(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/mod.rs
  type JNIEnv (line 38) | pub type JNIEnv = Arc<RwLock<Box<JNIEnvStruct>>>;
  type JNIResult (line 39) | pub type JNIResult = Result<Option<Oop>, Oop>;
  type NativeMethodPtr (line 40) | pub type NativeMethodPtr = Box<dyn Fn(JNIEnv, &[Oop]) -> JNIResult + Sen...
  type JNINativeMethod (line 41) | pub type JNINativeMethod = Arc<JNINativeMethodStruct>;
  type JNINativeMethodStruct (line 43) | pub struct JNINativeMethodStruct {
    method invoke (line 91) | pub fn invoke(&self, jni: JNIEnv, args: &[Oop]) -> JNIResult {
  type JNIEnvStruct (line 49) | pub struct JNIEnvStruct {
  function new_fn (line 60) | pub fn new_fn(
  function new_jni_env (line 72) | pub fn new_jni_env(class: ClassRef) -> JNIEnv {
  function find_symbol (line 76) | pub fn find_symbol(package: &[u8], name: &[u8], desc: &[u8]) -> Option<J...
  function init (line 85) | pub fn init() {
  function create_native_fn_tables (line 96) | fn create_native_fn_tables(

FILE: crates/vm/src/native/sun_misc_Signal.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_findSignal (line 18) | fn jvm_findSignal(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_handle0 (line 23) | fn jvm_handle0(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_misc_URLClassPath.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_getLookupCacheURLs (line 14) | fn jvm_getLookupCacheURLs(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_misc_Unsafe.rs
  function get_native_methods (line 12) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_registerNatives (line 104) | fn jvm_registerNatives(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_arrayBaseOffset (line 108) | fn jvm_arrayBaseOffset(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_arrayIndexScale (line 112) | fn jvm_arrayIndexScale(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_addressSize (line 116) | fn jvm_addressSize(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_objectFieldOffset (line 121) | fn jvm_objectFieldOffset(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_compareAndSwapObject (line 127) | fn jvm_compareAndSwapObject(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getIntVolatile (line 143) | fn jvm_getIntVolatile(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_compareAndSwapInt (line 150) | fn jvm_compareAndSwapInt(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_allocateMemory (line 169) | fn jvm_allocateMemory(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_freeMemory (line 177) | fn jvm_freeMemory(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_putLong (line 187) | fn jvm_putLong(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getByte (line 198) | fn jvm_getByte(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_compareAndSwapLong (line 204) | fn jvm_compareAndSwapLong(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getObjectVolatile (line 223) | fn jvm_getObjectVolatile(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_pageSize (line 230) | fn jvm_pageSize(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_getLongVolatile (line 234) | fn jvm_getLongVolatile(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_setMemory (line 241) | fn jvm_setMemory(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_putChar (line 270) | fn jvm_putChar(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_copyMemory (line 281) | fn jvm_copyMemory(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getChar (line 349) | fn jvm_getChar(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_putObject (line 356) | fn jvm_putObject(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_ensureClassInitialized (line 367) | fn jvm_ensureClassInitialized(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_staticFieldOffset (line 377) | fn jvm_staticFieldOffset(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_staticFieldBase (line 382) | fn jvm_staticFieldBase(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_putByte (line 391) | fn jvm_putByte(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_getByte2 (line 415) | fn jvm_getByte2(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function jvm_park (line 438) | fn jvm_park(_env: JNIEnv, args: &[Oop]) -> JNIResult {
  function objectFieldOffset (line 460) | fn objectFieldOffset(field: &Oop, is_static: bool) -> JNIResult {

FILE: crates/vm/src/native/sun_misc_VM.rs
  function get_native_methods (line 6) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_initialize (line 10) | fn jvm_initialize(_env: JNIEnv, _args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_nio_cs_StreamEncoder.rs
  function get_native_methods (line 8) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_forOutputStreamWriter (line 16) | fn jvm_forOutputStreamWriter(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_reflect_ConstantPool.rs
  function get_native_methods (line 7) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_getUTF8At0 (line 15) | fn jvm_getUTF8At0(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_reflect_NativeConstructorAccessorImpl.rs
  function get_native_methods (line 7) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_newInstance0 (line 15) | fn jvm_newInstance0(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_reflect_NativeMethodAccessorImpl.rs
  function get_native_methods (line 10) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_invoke0 (line 18) | fn jvm_invoke0(_env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/native/sun_reflect_Reflection.rs
  function get_native_methods (line 7) | pub fn get_native_methods() -> Vec<JNINativeMethod> {
  function jvm_getCallerClass (line 22) | fn jvm_getCallerClass(_env: JNIEnv, _args: &[Oop]) -> JNIResult {
  function jvm_getClassAccessFlags (line 54) | fn jvm_getClassAccessFlags(env: JNIEnv, args: &[Oop]) -> JNIResult {

FILE: crates/vm/src/oop/ary.rs
  type ArrayOopDesc (line 5) | pub struct ArrayOopDesc {
    method new (line 34) | pub fn new(class: ClassRef, elements: Vec<Oop>) -> Self {
    method get_dimension (line 42) | pub fn get_dimension(&self) -> usize {
  type TypeArrayDesc (line 11) | pub enum TypeArrayDesc {
    method len (line 53) | pub fn len(&self) -> usize {
    method extract_chars (line 68) | pub fn extract_chars(&self) -> &CharAry {
    method extract_mut_chars (line 75) | pub fn extract_mut_chars(&mut self) -> &mut CharAry {
    method extract_bytes (line 82) | pub fn extract_bytes(&self) -> &ByteAry {
    method extract_mut_bytes (line 89) | pub fn extract_mut_bytes(&mut self) -> &mut ByteAry {
    method extract_bools (line 96) | pub fn extract_bools(&self) -> &BoolAry {
    method extract_mut_bools (line 103) | pub fn extract_mut_bools(&mut self) -> &mut BoolAry {
    method extract_shorts (line 110) | pub fn extract_shorts(&self) -> &ShortAry {
    method extract_mut_shorts (line 117) | pub fn extract_mut_shorts(&mut self) -> &mut ShortAry {
    method extract_floats (line 124) | pub fn extract_floats(&self) -> &FloatAry {
    method extract_mut_floats (line 131) | pub fn extract_mut_floats(&mut self) -> &mut FloatAry {
    method extract_doubles (line 138) | pub fn extract_doubles(&self) -> &DoubleAry {
    method extract_mut_doubles (line 145) | pub fn extract_mut_doubles(&mut self) -> &mut DoubleAry {
    method extract_ints (line 152) | pub fn extract_ints(&self) -> &IntAry {
    method extract_mut_ints (line 159) | pub fn extract_mut_ints(&mut self) -> &mut IntAry {
    method extract_longs (line 166) | pub fn extract_longs(&self) -> &LongAry {
    method extract_mut_longs (line 173) | pub fn extract_mut_longs(&mut self) -> &mut LongAry {
  type TypeArrayEnum (line 22) | pub enum TypeArrayEnum {
    method from (line 182) | fn from(b: u8) -> Self {

FILE: crates/vm/src/oop/class.rs
  type ClassPtr (line 22) | pub struct ClassPtr(u64);
    method new (line 25) | pub fn new(v: Class) -> ClassRef {
    method raw_ptr (line 39) | fn raw_ptr(&self) -> *const Class {
    method raw_mut_ptr (line 43) | fn raw_mut_ptr(&self) -> *mut Class {
    method name (line 49) | pub fn name(&self) -> BytesRef {
    method get_class (line 54) | pub fn get_class(&self) -> &Class {
    method get_mut_class (line 59) | pub fn get_mut_class(&self) -> &mut Class {
    method extract_inst (line 64) | pub fn extract_inst(&self) -> &ClassObject {
  method drop (line 33) | fn drop(&mut self) {
  method fmt (line 74) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
  type Class (line 90) | pub struct Class {
    method get_class_state (line 257) | pub fn get_class_state(&self) -> State {
    method set_class_state (line 262) | pub fn set_class_state(&mut self, s: State) {
    method get_name (line 266) | pub fn get_name(&self) -> BytesRef {
    method get_super_class (line 270) | pub fn get_super_class(&self) -> Option<ClassRef> {
    method is_public (line 274) | pub fn is_public(&self) -> bool {
    method is_private (line 278) | pub fn is_private(&self) -> bool {
    method is_protected (line 282) | pub fn is_protected(&self) -> bool {
    method is_final (line 286) | pub fn is_final(&self) -> bool {
    method is_static (line 290) | pub fn is_static(&self) -> bool {
    method is_abstract (line 294) | pub fn is_abstract(&self) -> bool {
    method is_interface (line 298) | pub fn is_interface(&self) -> bool {
    method monitor_enter (line 302) | pub fn monitor_enter(&self) {
    method monitor_exit (line 308) | pub fn monitor_exit(&self) {
    method link_class (line 314) | pub fn link_class(&mut self, self_ref: ClassRef) {
    method get_class_kind_type (line 348) | pub fn get_class_kind_type(&self) -> ClassKindType {
    method is_instance (line 356) | pub fn is_instance(&self) -> bool {
    method is_array (line 363) | pub fn is_array(&self) -> bool {
    method is_object_ary (line 370) | pub fn is_object_ary(&self) -> bool {
    method get_mirror (line 378) | pub fn get_mirror(&self) -> Oop {
    method set_mirror (line 389) | pub fn set_mirror(&mut self, mirror: Oop) {
    method get_source_file (line 397) | pub fn get_source_file(&self) -> Option<BytesRef> {
    method get_annotation (line 404) | pub fn get_annotation(&self) -> Option<Vec<u8>> {
    method get_type_annotation (line 413) | pub fn get_type_annotation(&self) -> Option<Vec<u8>> {
    method get_attr_signatrue (line 422) | pub fn get_attr_signatrue(&self) -> Option<&BytesRef> {
    method get_static_method (line 459) | pub fn get_static_method(&self, name: &BytesRef, desc: &BytesRef) -> R...
    method get_class_method (line 463) | pub fn get_class_method(&self, name: &BytesRef, desc: &BytesRef) -> Re...
    method get_this_class_method (line 467) | pub fn get_this_class_method(
    method get_virtual_method (line 475) | pub fn get_virtual_method(&self, name: &BytesRef, desc: &BytesRef) -> ...
    method get_interface_method (line 479) | pub fn get_interface_method(
    method get_field_id (line 487) | pub fn get_field_id(&self, name: &BytesRef, desc: &BytesRef, is_static...
    method put_field_value (line 517) | pub fn put_field_value(rf: Arc<OopPtr>, fir: FieldIdRef, v: Oop) {
    method put_field_value2 (line 521) | pub fn put_field_value2(rf: Arc<OopPtr>, offset: usize, v: Oop) {
    method get_field_value (line 533) | pub fn get_field_value(rf: Arc<OopPtr>, fid: FieldIdRef) -> Oop {
    method get_field_value2 (line 537) | pub fn get_field_value2(rf: Arc<OopPtr>, offset: usize) -> Oop {
    method put_static_field_value (line 552) | pub fn put_static_field_value(&mut self, fid: FieldIdRef, v: Oop) {
    method get_static_field_value (line 574) | pub fn get_static_field_value(&self, fid: FieldIdRef) -> Oop {
    method check_interface (line 593) | pub fn check_interface(&self, intf: ClassRef) -> bool {
    method hack_as_native (line 619) | pub fn hack_as_native(&mut self, name: &[u8], desc: &[u8]) {
    method new_class (line 650) | pub fn new_class(class_file: ClassFileRef, class_loader: Option<ClassL...
    method new_object_ary (line 689) | pub fn new_object_ary(class_loader: ClassLoader, component: ClassRef, ...
    method new_prime_ary (line 718) | pub fn new_prime_ary(class_loader: ClassLoader, value_type: ValueType)...
    method new_wrapped_ary (line 748) | pub fn new_wrapped_ary(class_loader: ClassLoader, down_type: ClassRef)...
    method get_class_method_inner (line 948) | pub fn get_class_method_inner(
    method get_virtual_method_inner (line 981) | fn get_virtual_method_inner(
    method get_interface_method_inner (line 1002) | pub fn get_interface_method_inner(
  type ClassKind (line 107) | pub enum ClassKind {
  type ClassKindType (line 114) | pub enum ClassKindType {
  type State (line 121) | pub enum State {
    method from (line 131) | fn from(v: u8) -> Self {
    method into (line 145) | fn into(self) -> u8 {
  type ClassObject (line 157) | pub struct ClassObject {
    method link_super_class (line 803) | fn link_super_class(
    method link_fields (line 831) | fn link_fields(&mut self, self_ref: ClassRef, cls_name: BytesRef, num_...
    method link_interfaces (line 865) | fn link_interfaces(&mut self) {
    method link_methods (line 884) | fn link_methods(&mut self, this_ref: ClassRef, cls_name: BytesRef) {
    method link_attributes (line 909) | fn link_attributes(&mut self) {
    method init_static_fields (line 932) | fn init_static_fields(&mut self) {
  type ArrayClassObject (line 184) | pub struct ArrayClassObject {
    method get_dimension (line 440) | pub fn get_dimension(&self) -> usize {
  function init_class (line 196) | pub fn init_class(class: &ClassRef) {
  function init_class_fully (line 220) | pub fn init_class_fully(class: &ClassRef) {
  function load_and_init (line 244) | pub fn load_and_init(name: &[u8]) -> ClassRef {

FILE: crates/vm/src/oop/consts.rs
  function get_int0 (line 11) | pub fn get_int0() -> Oop {
  function get_long0 (line 15) | pub fn get_long0() -> Oop {
  function get_float0 (line 19) | pub fn get_float0() -> Oop {
  function get_double0 (line 23) | pub fn get_double0() -> Oop {
  function init (line 27) | pub fn init() {

FILE: crates/vm/src/oop/field.rs
  function get_field_ref (line 15) | pub fn get_field_ref(cp: &ConstantPool, idx: usize, is_static: bool) -> ...
  function build_inited_field_values (line 36) | pub fn build_inited_field_values(class: ClassRef) -> Vec<Oop> {
  type FieldId (line 91) | pub struct FieldId {
  type Field (line 97) | pub struct Field {
    method new (line 108) | pub fn new(cp: &ConstantPool, fi: &FieldInfo, cls_name: BytesRef, clas...
    method is_public (line 137) | pub fn is_public(&self) -> bool {
    method is_private (line 141) | pub fn is_private(&self) -> bool {
    method is_protected (line 145) | pub fn is_protected(&self) -> bool {
    method is_final (line 149) | pub fn is_final(&self) -> bool {
    method is_static (line 153) | pub fn is_static(&self) -> bool {
    method is_volatile (line 157) | pub fn is_volatile(&self) -> bool {
    method get_constant_value (line 161) | pub fn get_constant_value(&self) -> Oop {
    method get_attr_constant_value (line 176) | pub fn get_attr_constant_value(&self) -> Option<Oop> {
    method fmt (line 182) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function constant_value (line 190) | fn constant_value(cp: &ConstantPool, v_idx: usize) -> Oop {

FILE: crates/vm/src/oop/inst.rs
  type InstOopDesc (line 5) | pub struct InstOopDesc {
    method new (line 11) | pub fn new(class: ClassRef) -> Self {

FILE: crates/vm/src/oop/mirror.rs
  type MirrorOopDesc (line 5) | pub struct MirrorOopDesc {
    method is_prim_mirror (line 12) | pub fn is_prim_mirror(&self) -> bool {

FILE: crates/vm/src/oop/mod.rs
  type Oop (line 31) | pub enum Oop {
    method fmt (line 51) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method new_int (line 80) | pub fn new_int(v: i32) -> Self {
    method new_long (line 84) | pub fn new_long(v: i64) -> Self {
    method new_float (line 88) | pub fn new_float(v: f32) -> Self {
    method new_double (line 92) | pub fn new_double(v: f64) -> Self {
    method new_type_ary (line 99) | pub fn new_type_ary(v: u8, len: usize) -> Oop {
    method char_ary_from1 (line 112) | pub fn char_ary_from1(v: &[u16]) -> Oop {
    method new_byte_ary (line 117) | pub fn new_byte_ary(len: usize) -> Oop {
    method new_bool_ary (line 122) | fn new_bool_ary(len: usize) -> Oop {
    method new_char_ary (line 127) | fn new_char_ary(len: usize) -> Oop {
    method new_short_ary (line 132) | fn new_short_ary(len: usize) -> Oop {
    method new_int_ary (line 137) | fn new_int_ary(len: usize) -> Oop {
    method new_float_ary (line 142) | fn new_float_ary(len: usize) -> Oop {
    method new_double_ary (line 147) | fn new_double_ary(len: usize) -> Oop {
    method new_long_ary (line 152) | fn new_long_ary(len: usize) -> Oop {
    method new_byte_ary2 (line 157) | pub fn new_byte_ary2(elms: Vec<u8>) -> Oop {
    method new_bool_ary2 (line 163) | pub fn new_bool_ary2(elms: Vec<u8>) -> Oop {
    method new_char_ary2 (line 169) | pub fn new_char_ary2(elms: Vec<u16>) -> Oop {
    method new_short_ary2 (line 175) | pub fn new_short_ary2(elms: Vec<i16>) -> Oop {
    method new_int_ary2 (line 181) | pub fn new_int_ary2(elms: Vec<i32>) -> Oop {
    method new_float_ary2 (line 187) | pub fn new_float_ary2(elms: Vec<f32>) -> Oop {
    method new_double_ary2 (line 193) | pub fn new_double_ary2(elms: Vec<f64>) -> Oop {
    method new_long_ary2 (line 199) | pub fn new_long_ary2(elms: Vec<i64>) -> Oop {
    method new_const_utf8 (line 208) | pub fn new_const_utf8(v: BytesRef) -> Self {
    method new_null (line 212) | pub fn new_null() -> Self {
    method new_inst (line 216) | pub fn new_inst(cls_obj: ClassRef) -> Oop {
    method new_mirror (line 224) | pub fn new_mirror(target: ClassRef) -> Oop {
    method new_prim_mirror (line 236) | pub fn new_prim_mirror(value_type: ValueType, target: Option<ClassRef>...
    method new_ary_mirror (line 248) | pub fn new_ary_mirror(target: ClassRef, value_type: ValueType) -> Oop {
    method new_ref_ary (line 263) | pub fn new_ref_ary(ary_cls_obj: ClassRef, len: usize) -> Oop {
    method new_ref_ary2 (line 268) | pub fn new_ref_ary2(ary_cls_obj: ClassRef, elms: Vec<Oop>) -> Oop {
    method new_ref (line 276) | fn new_ref(v: RefKind) -> Oop {
    method hash_code (line 286) | pub fn hash_code(&self) -> i32 {
    method is_null (line 302) | pub fn is_null(&self) -> bool {
    method extract_int (line 310) | pub fn extract_int(&self) -> i32 {
    method extract_float (line 318) | pub fn extract_float(&self) -> f32 {
    method extract_long (line 326) | pub fn extract_long(&self) -> i64 {
    method extract_double (line 334) | pub fn extract_double(&self) -> f64 {
    method extract_ref (line 342) | pub fn extract_ref(&self) -> Arc<OopPtr> {
  type OopPtr (line 48) | pub struct OopPtr(u64);
    method get_raw_ptr (line 351) | pub fn get_raw_ptr(&self) -> *const RefKindDesc {
    method get_mut_raw_ptr (line 355) | pub fn get_mut_raw_ptr(&self) -> *mut RefKindDesc {
    method extract_inst (line 361) | pub fn extract_inst(&self) -> &InstOopDesc {
    method extract_array (line 366) | pub fn extract_array(&self) -> &ArrayOopDesc {
    method extract_mut_array (line 371) | pub fn extract_mut_array(&self) -> &mut ArrayOopDesc {
    method extract_type_array (line 376) | pub fn extract_type_array(&self) -> &TypeArrayDesc {
    method extract_mut_type_array (line 381) | pub fn extract_mut_type_array(&self) -> &mut TypeArrayDesc {
    method extract_mirror (line 386) | pub fn extract_mirror(&self) -> &MirrorOopDesc {
    method monitor_enter (line 393) | pub fn monitor_enter(&self) {
    method monitor_exit (line 398) | pub fn monitor_exit(&self) {
    method notify_all (line 403) | pub fn notify_all(&self) {
    method wait (line 408) | pub fn wait(&self) {
    method wait_timeout (line 413) | pub fn wait_timeout(&self, duration: std::time::Duration) {
    method is_eq (line 420) | pub fn is_eq(l: &Oop, r: &Oop) -> bool {
    method is_java_lang_string (line 443) | pub fn is_java_lang_string(rf: Arc<Self>) -> bool {
    method is_java_lang_string_eq (line 456) | fn is_java_lang_string_eq(l: Arc<Self>, r: Arc<Self>) -> bool {
    method java_lang_string (line 474) | pub fn java_lang_string(rf: Arc<Self>) -> String {
    method java_lang_string_value (line 480) | pub fn java_lang_string_value(rf: Arc<Self>) -> Vec<u16> {
    method java_lang_string_hash (line 488) | pub fn java_lang_string_hash(rf: Arc<Self>) -> i32 {
    method java_lang_integer_value (line 504) | pub fn java_lang_integer_value(rf: Arc<Self>) -> i32 {
    method java_lang_thread_eetop (line 510) | pub fn java_lang_thread_eetop(rf: Arc<Self>) -> i64 {
  method drop (line 523) | fn drop(&mut self) {
  function init (line 528) | pub fn init() {

FILE: crates/vm/src/oop/reference.rs
  type RefKind (line 8) | pub enum RefKind {
    method extract_inst (line 79) | pub fn extract_inst(&self) -> &InstOopDesc {
    method extract_array (line 86) | pub fn extract_array(&self) -> &ArrayOopDesc {
    method extract_mut_array (line 93) | pub fn extract_mut_array(&mut self) -> &mut ArrayOopDesc {
    method extract_type_array (line 101) | pub fn extract_type_array(&self) -> &TypeArrayDesc {
    method extract_mut_type_array (line 108) | pub fn extract_mut_type_array(&mut self) -> &mut TypeArrayDesc {
    method extract_mirror (line 116) | pub fn extract_mirror(&self) -> &MirrorOopDesc {
  type RefKindDesc (line 15) | pub struct RefKindDesc {
    method new (line 24) | pub fn new(v: RefKind) -> Self {
    method monitor_enter (line 47) | pub fn monitor_enter(&self) {
    method monitor_exit (line 53) | pub fn monitor_exit(&self) {
    method wait (line 59) | pub fn wait(&self) {
    method wait_timeout (line 65) | pub fn wait_timeout(&self, duration: Duration) {
    method notify_all (line 71) | pub fn notify_all(&self) {
    method fmt (line 133) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
  method drop (line 125) | fn drop(&mut self) {

FILE: crates/vm/src/oop/values.rs
  type ValueType (line 4) | pub enum ValueType {
    method from (line 19) | fn from(v: &u8) -> Self {
    method into (line 42) | fn into(self) -> &'static [u8] {
    method parse_wrap (line 60) | pub fn parse_wrap(class_loader: Option<ClassLoader>, desc: &str) -> Se...
    method get_primitive_name (line 73) | pub fn get_primitive_name(&self) -> &'static [u8] {

FILE: crates/vm/src/runtime/class_loader.rs
  type ClassLoader (line 12) | pub enum ClassLoader {
    method load_class (line 33) | fn load_class(&self, name: &[u8]) -> Option<ClassRef> {
    method load_array_class (line 73) | fn load_array_class(&self, name: &[u8]) -> Option<ClassRef> {
    method load_class_from_path (line 158) | fn load_class_from_path(&self, name: &[u8]) -> Option<ClassRef> {
  function require_class (line 17) | pub fn require_class(class_loader: Option<ClassLoader>, name: &BytesRef)...
  function require_class2 (line 21) | pub fn require_class2(index: U2, cp: &ConstantPool) -> Option<ClassRef> {
  function require_class3 (line 27) | pub fn require_class3(class_loader: Option<ClassLoader>, name: &[u8]) ->...
  function calc_dimension (line 176) | fn calc_dimension(name: &[u8]) -> Option<usize> {
  function is_array (line 184) | fn is_array(name: &[u8]) -> bool {
  function t_basic (line 191) | fn t_basic() {

FILE: crates/vm/src/runtime/class_path_manager.rs
  function init (line 12) | pub fn init() {
  function find_class (line 16) | pub fn find_class(name: &str) -> Result<ClassPathResult, io::Error> {
  function add_path (line 21) | pub fn add_path(path: &str) {
  function add_paths (line 26) | pub fn add_paths(path: &str) {
  type ClassPathResult (line 32) | pub struct ClassPathResult(pub String, pub Vec<u8>);
  type ZipRef (line 34) | type ZipRef = Arc<Mutex<Box<ZipArchive<File>>>>;
  type ClassSource (line 36) | enum ClassSource {
  type ClassPathEntry (line 41) | struct ClassPathEntry(ClassSource, String);
  type ClassPathManager (line 43) | struct ClassPathManager {
    method new (line 48) | fn new() -> Self {
    method add_class_path (line 54) | pub fn add_class_path(&mut self, path: &str) -> Result<(), io::Error> {
    method add_class_paths (line 70) | pub fn add_class_paths(&mut self, path: &str) {
    method search_class (line 78) | pub fn search_class(&self, name: &str) -> Result<ClassPathResult, io::...
    method size (line 119) | pub fn size(&self) -> usize {
  function t_basic_zip (line 128) | fn t_basic_zip() {
  function t_replace_all (line 140) | fn t_replace_all() {
  function t_add_cls_path (line 146) | fn t_add_cls_path() {
  function t_add_cls_paths (line 159) | fn t_add_cls_paths() {
  function t_search_cls (line 166) | fn t_search_cls() {
  function t_search_cls2 (line 173) | fn t_search_cls2() {

FILE: crates/vm/src/runtime/cmp.rs
  function instance_of (line 7) | pub fn instance_of(s: ClassRef, t: ClassRef) -> bool {
  function check_inherit (line 121) | pub fn check_inherit(s: ClassRef, t: ClassRef) -> bool {

FILE: crates/vm/src/runtime/constant_pool.rs
  type CacheType (line 11) | enum CacheType {
    method extract_field (line 17) | fn extract_field(&self) -> FieldIdRef {
    method extract_method (line 24) | fn extract_method(&self) -> MethodIdRef {
  type ConstantPoolCache (line 32) | pub struct ConstantPoolCache {
    method new (line 38) | pub fn new(cp: ConstantPool) -> Self {
    method get_field (line 45) | pub fn get_field(&self, idx: usize, is_static: bool) -> FieldIdRef {
    method cache_field (line 59) | fn cache_field(&self, k: usize, v: FieldIdRef) {
    method get_method (line 65) | pub fn get_method(&self, idx: usize) -> MethodIdRef {
    method cache_method (line 79) | fn cache_method(&self, k: usize, v: MethodIdRef) {

FILE: crates/vm/src/runtime/consts.rs
  constant THREAD_MAX_STACK_FRAMES (line 1) | pub const THREAD_MAX_STACK_FRAMES: usize = 512;

FILE: crates/vm/src/runtime/dataarea.rs
  type DataArea (line 24) | pub struct DataArea {
    method new (line 32) | pub fn new(max_stack: usize) -> Self {

FILE: crates/vm/src/runtime/exception.rs
  function new (line 7) | pub fn new(name: &[u8], msg: Option<String>) -> Oop {
  function meet_ex (line 36) | pub fn meet_ex(cls_name: &'static [u8], msg: Option<String>) {

FILE: crates/vm/src/runtime/frame.rs
  type Frame (line 7) | pub struct Frame {
    method new (line 26) | pub fn new(mir: MethodIdRef, frame_id: usize) -> Self {

FILE: crates/vm/src/runtime/init_vm.rs
  function initialize_jvm (line 15) | pub fn initialize_jvm() {
  function initialize_vm_structs (line 103) | fn initialize_vm_structs() {
  function hack_classes (line 145) | fn hack_classes() {

FILE: crates/vm/src/runtime/interp.rs
  type Interp (line 223) | pub struct Interp<'a> {
  function new (line 232) | pub fn new(frame: RwLockReadGuard<'a, Box<Frame>>, local: Local) -> Self {
  function debug_op (line 247) | fn debug_op(&self, code: u8, op: OpCode) {
  function run (line 261) | pub fn run(&mut self) {
  function load_constant (line 727) | fn load_constant(&self, pos: usize) {
  function goto_abs (line 770) | fn goto_abs(&self, pc: i32) {
  function goto_by_offset (line 775) | fn goto_by_offset(&self, branch: i32) {
  function goto_by_offset_with_occupied (line 780) | fn goto_by_offset_with_occupied(&self, branch: i32, occupied: i32) {
  function goto_by_offset_hardcoded (line 786) | fn goto_by_offset_hardcoded(&self, occupied: i32) {
  function goto_abs_with_occupied (line 797) | fn goto_abs_with_occupied(&self, pc: i32, occupied: i32) {
  function set_return (line 802) | fn set_return(&self, v: Option<Oop>) {
  function get_field_helper (line 807) | fn get_field_helper(&self, receiver: Oop, idx: usize, is_static: bool) {
  function pop_value (line 828) | fn pop_value(&self, vt: ValueType) -> Oop {
  function put_field_helper (line 856) | fn put_field_helper(&self, idx: usize, is_static: bool) {
  function invoke_helper (line 879) | fn invoke_helper(&self, is_static: bool, idx: usize, force_no_resolve: b...
  function check_cast_helper (line 892) | pub fn check_cast_helper(&self, is_cast: bool) {
  function opcode_pos (line 982) | fn opcode_pos(&mut self) -> usize {
  function try_handle_exception (line 997) | fn try_handle_exception(&self, ex: Oop) -> Result<(), Oop> {
  function sipush (line 1048) | fn sipush(&self) {
  function bipush (line 1057) | fn bipush(&self) {
  function ldc (line 1066) | fn ldc(&self) {
  function ldc_w (line 1074) | fn ldc_w(&self) {
  function ldc2_w (line 1082) | fn ldc2_w(&self) {
  function iaload (line 1087) | fn iaload(&self) {
  function saload (line 1103) | fn saload(&self) {
  function caload (line 1119) | fn caload(&self) {
  function baload (line 1135) | fn baload(&self) {
  function laload (line 1170) | fn laload(&self) {
  function faload (line 1193) | fn faload(&self) {
  function daload (line 1216) | fn daload(&self) {
  function aaload (line 1239) | fn aaload(&self) {
  function bastore (line 1263) | fn bastore(&self) {
  function castore (line 1294) | fn castore(&self) {
  function sastore (line 1314) | fn sastore(&self) {
  function iastore (line 1334) | fn iastore(&self) {
  function lastore (line 1353) | fn lastore(&self) {
  function fastore (line 1372) | fn fastore(&self) {
  function dastore (line 1391) | fn dastore(&self) {
  function aastore (line 1410) | fn aastore(&self) {
  function pop (line 1429) | fn pop(&self) {
  function pop2 (line 1435) | fn pop2(&self) {
  function dup (line 1442) | fn dup(&self) {
  function dup_x1 (line 1448) | fn dup_x1(&self) {
  function dup_x2 (line 1454) | fn dup_x2(&self) {
  function dup2 (line 1460) | fn dup2(&self) {
  function dup2_x1 (line 1466) | fn dup2_x1(&self) {
  function dup2_x2 (line 1472) | fn dup2_x2(&self) {
  function swap (line 1478) | fn swap(&self) {
  function idiv (line 1484) | fn idiv(&self) {
  function ldiv (line 1500) | fn ldiv(&self) {
  function fdiv (line 1516) | fn fdiv(&self) {
  function ddiv (line 1532) | fn ddiv(&self) {
  function irem (line 1548) | fn irem(&self) {
  function lrem (line 1564) | fn lrem(&self) {
  function frem (line 1580) | fn frem(&self) {
  function drem (line 1585) | fn drem(&self) {
  function ineg (line 1590) | fn ineg(&self) {
  function lneg (line 1597) | fn lneg(&self) {
  function fneg (line 1604) | fn fneg(&self) {
  function dneg (line 1609) | fn dneg(&self) {
  function ishl (line 1614) | fn ishl(&self) {
  function lshl (line 1623) | fn lshl(&self) {
  function ishr (line 1632) | fn ishr(&self) {
  function lshr (line 1641) | fn lshr(&self) {
  function iushr (line 1650) | fn iushr(&self) {
  function lushr (line 1659) | fn lushr(&self) {
  function iinc (line 1668) | fn iinc(&mut self) {
  function i2l (line 1689) | fn i2l(&self) {
  function i2f (line 1696) | fn i2f(&self) {
  function i2d (line 1703) | fn i2d(&self) {
  function l2i (line 1710) | fn l2i(&self) {
  function l2f (line 1717) | fn l2f(&self) {
  function l2d (line 1724) | fn l2d(&self) {
  function f2i (line 1731) | fn f2i(&self) {
  function f2l (line 1748) | fn f2l(&self) {
  function f2d (line 1765) | fn f2d(&self) {
  function d2i (line 1772) | fn d2i(&self) {
  function d2l (line 1789) | fn d2l(&self) {
  function d2f (line 1806) | fn d2f(&self) {
  function i2b (line 1813) | fn i2b(&self) {
  function i2c (line 1821) | fn i2c(&self) {
  function i2s (line 1829) | fn i2s(&self) {
  function lcmp (line 1837) | fn lcmp(&self) {
  function fcmpl (line 1850) | fn fcmpl(&self) {
  function fcmpg (line 1867) | fn fcmpg(&self) {
  function dcmpl (line 1884) | fn dcmpl(&self) {
  function dcmpg (line 1901) | fn dcmpg(&self) {
  function if_acmpeq (line 1917) | fn if_acmpeq(&self) {
  function if_acmpne (line 1930) | fn if_acmpne(&self) {
  function goto (line 1943) | fn goto(&self) {
  function jsr (line 1948) | fn jsr(&self) {
  function ret (line 1954) | fn ret(&mut self) {
  function table_switch (line 1968) | fn table_switch(&self) {
  function lookup_switch (line 2027) | fn lookup_switch(&self) {
  function ireturn (line 2077) | fn ireturn(&self) {
  function lreturn (line 2087) | fn lreturn(&self) {
  function freturn (line 2097) | fn freturn(&self) {
  function dreturn (line 2107) | fn dreturn(&self) {
  function areturn (line 2117) | fn areturn(&self) {
  function return_void (line 2126) | fn return_void(&self) {
  function get_static (line 2131) | fn get_static(&self) {
  function put_static (line 2139) | fn put_static(&self) {
  function get_field (line 2147) | fn get_field(&self) {
  function put_field (line 2167) | fn put_field(&self) {
  function invoke_virtual (line 2175) | fn invoke_virtual(&self) {
  function invoke_special (line 2183) | fn invoke_special(&self) {
  function invoke_static (line 2191) | fn invoke_static(&self) {
  function invoke_interface (line 2199) | fn invoke_interface(&self) {
  function invoke_dynamic (line 2213) | fn invoke_dynamic(&self) {
  function new_ (line 2219) | fn new_(&self) {
  function new_array (line 2242) | fn new_array(&self) {
  function anew_array (line 2259) | fn anew_array(&self) {
  function array_length (line 2324) | fn array_length(&self) {
  function athrow (line 2354) | fn athrow(&self, jt: JavaThreadRef) {
  function check_cast (line 2363) | fn check_cast(&self) {
  function instance_of (line 2368) | fn instance_of(&self) {
  function monitor_enter (line 2373) | fn monitor_enter(&self) {
  function monitor_exit (line 2388) | fn monitor_exit(&self) {
  function wide (line 2403) | fn wide(&mut self) {
  function multi_anew_array (line 2408) | fn multi_anew_array(&self) {
  function if_null (line 2431) | fn if_null(&self) {
  function if_non_null (line 2448) | fn if_non_null(&self) {
  function goto_w (line 2465) | fn goto_w(&self) {
  function jsr_w (line 2472) | fn jsr_w(&self) {
  function other_wise (line 2479) | fn other_wise(&self) {
  function new_multi_object_array_helper (line 2491) | fn new_multi_object_array_helper(cls: ClassRef, lens: &[i32], idx: usize...

FILE: crates/vm/src/runtime/invoke.rs
  type JavaCall (line 14) | pub struct JavaCall {
    method new_with_args (line 31) | pub fn new_with_args(mir: MethodIdRef, args: Vec<Oop>) -> Self {
    method new (line 40) | pub fn new(caller: &DataArea, mir: MethodIdRef) -> Result<JavaCall, ()> {
    method invoke (line 79) | pub fn invoke(&mut self, caller: Option<&DataArea>, force_no_resolve: ...
    method invoke_java (line 102) | fn invoke_java(&mut self, caller: Option<&DataArea>) {
    method invoke_native (line 139) | fn invoke_native(&mut self, caller: Option<&DataArea>) {
    method prepare_sync (line 184) | fn prepare_sync(&mut self) {
    method fin_sync (line 197) | fn fin_sync(&mut self) {
    method prepare_frame (line 210) | fn prepare_frame(&mut self) -> Result<FrameRef, Oop> {
    method build_local (line 224) | fn build_local(&self) -> Local {
    method resolve_virtual_method (line 259) | fn resolve_virtual_method(&mut self, force_no_resolve: bool) {
    method debug (line 310) | fn debug(&self) {
  function invoke_ctor (line 20) | pub fn invoke_ctor(cls: ClassRef, desc: BytesRef, args: Vec<Oop>) {
  function build_args_from_caller_stack (line 321) | fn build_args_from_caller_stack(caller: &DataArea, sig: &MethodSignature...
  function set_return (line 361) | pub fn set_return(caller: &DataArea, return_type: &SignatureType, v: Oop) {

FILE: crates/vm/src/runtime/local.rs
  type Local (line 5) | pub struct Local {
    method new (line 10) | pub fn new(size: usize) -> Self {
    method set_int (line 17) | pub fn set_int(&mut self, pos: usize, v: i32) {
    method set_long (line 22) | pub fn set_long(&mut self, pos: usize, v: i64) {
    method set_float (line 27) | pub fn set_float(&mut self, pos: usize, v: f32) {
    method set_double (line 32) | pub fn set_double(&mut self, pos: usize, v: f64) {
    method set_ref (line 37) | pub fn set_ref(&mut self, pos: usize, v: Oop) {
    method get_int (line 42) | pub fn get_int(&self, pos: usize) -> i32 {
    method get_long (line 51) | pub fn get_long(&self, pos: usize) -> i64 {
    method get_float (line 60) | pub fn get_float(&self, pos: usize) -> f32 {
    method get_double (line 69) | pub fn get_double(&self, pos: usize) -> f64 {
    method get_ref (line 78) | pub fn get_ref(&self, pos: usize) -> Oop {

FILE: crates/vm/src/runtime/method.rs
  function get_method_ref (line 20) | pub fn get_method_ref(cp: &ConstantPool, idx: usize) -> Result<MethodIdR...
  type MethodId (line 55) | pub struct MethodId {
    method new (line 62) | pub fn new(offset: usize, method: Method) -> Arc<Self> {
    method fmt (line 260) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
  type Method (line 81) | pub struct Method {
    method new (line 97) | pub fn new(
    method get_max_locals (line 126) | pub fn get_max_locals(&self) -> usize {
    method get_max_stack (line 133) | pub fn get_max_stack(&self) -> usize {
    method build_local (line 140) | pub fn build_local(&self) -> Local {
    method build_stack (line 145) | pub fn build_stack(&self) -> Stack {
    method find_exception_handler (line 150) | pub fn find_exception_handler(&self, cp: &ConstantPool, pc: U2, ex: Cl...
    method get_line_num (line 170) | pub fn get_line_num(&self, pc: U2) -> i32 {
    method get_annotation (line 186) | pub fn get_annotation(&self) -> Option<Vec<u8>> {
    method get_param_annotation (line 191) | pub fn get_param_annotation(&self) -> Option<Vec<u8>> {
    method get_type_annotation (line 196) | pub fn get_type_annotation(&self) -> Option<Vec<u8>> {
    method get_annotation_default (line 201) | pub fn get_annotation_default(&self) -> Option<Vec<u8>> {
    method check_annotation (line 206) | pub fn check_annotation(&self, name: &[u8]) -> bool {
    method is_public (line 222) | pub fn is_public(&self) -> bool {
    method is_private (line 226) | pub fn is_private(&self) -> bool {
    method is_protected (line 230) | pub fn is_protected(&self) -> bool {
    method is_final (line 234) | pub fn is_final(&self) -> bool {
    method is_static (line 238) | pub fn is_static(&self) -> bool {
    method is_synchronized (line 242) | pub fn is_synchronized(&self) -> bool {
    method is_native (line 246) | pub fn is_native(&self) -> bool {
    method is_abstract (line 250) | pub fn is_abstract(&self) -> bool {
    method is_interface (line 254) | pub fn is_interface(&self) -> bool {
    method fmt (line 273) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {

FILE: crates/vm/src/runtime/mod.rs
  function init (line 37) | pub fn init() {

FILE: crates/vm/src/runtime/slot.rs
  type Slot (line 4) | pub enum Slot {

FILE: crates/vm/src/runtime/stack.rs
  type Stack (line 5) | pub struct Stack {
    method new (line 10) | pub fn new(size: usize) -> Self {
    method push_int (line 17) | pub fn push_int(&mut self, v: i32) {
    method push_int2 (line 22) | pub fn push_int2(&mut self, v: &[u8; 4]) {
    method push_float (line 28) | pub fn push_float(&mut self, v: f32) {
    method push_float2 (line 33) | pub fn push_float2(&mut self, v: &[u8; 4]) {
    method push_double (line 40) | pub fn push_double(&mut self, v: f64) {
    method push_double2 (line 46) | pub fn push_double2(&mut self, v: &[u8; 8]) {
    method push_long (line 53) | pub fn push_long(&mut self, v: i64) {
    method push_long2 (line 59) | pub fn push_long2(&mut self, v: &[u8; 8]) {
    method push_null (line 65) | pub fn push_null(&mut self) {
    method push_const_m1 (line 70) | pub fn push_const_m1(&mut self) {
    method push_const0 (line 78) | pub fn push_const0(&mut self, with_nop: bool) {
    method push_const1 (line 89) | pub fn push_const1(&mut self, with_nop: bool) {
    method push_const2 (line 97) | pub fn push_const2(&mut self) {
    method push_const3 (line 102) | pub fn push_const3(&mut self) {
    method push_const4 (line 107) | pub fn push_const4(&mut self) {
    method push_const5 (line 112) | pub fn push_const5(&mut self) {
    method push_ref (line 117) | pub fn push_ref(&mut self, v: Oop, with_nop: bool) {
    method pop_int (line 125) | pub fn pop_int(&mut self) -> i32 {
    method pop_float (line 141) | pub fn pop_float(&mut self) -> f32 {
    method pop_double (line 153) | pub fn pop_double(&mut self) -> f64 {
    method pop_long (line 170) | pub fn pop_long(&mut self) -> i64 {
    method pop_ref (line 187) | pub fn pop_ref(&mut self) -> Oop {
    method drop_top (line 195) | pub fn drop_top(&mut self) {
    method clear (line 199) | pub fn clear(&mut self) {
    method dup (line 204) | pub fn dup(&mut self) {
    method dup_x1 (line 211) | pub fn dup_x1(&mut self) {
    method dup_x2 (line 220) | pub fn dup_x2(&mut self) {
    method dup2 (line 231) | pub fn dup2(&mut self) {
    method dup2_x1 (line 241) | pub fn dup2_x1(&mut self) {
    method dup2_x2 (line 253) | pub fn dup2_x2(&mut self) {
    method swap (line 267) | pub fn swap(&mut self) {
    method push_nop (line 276) | fn push_nop(&mut self) {
    method pop_nop (line 280) | fn pop_nop(&mut self) {

FILE: crates/vm/src/runtime/sys_dic.rs
  type SystemDictionary (line 7) | type SystemDictionary = Mutex<FxHashMap<String, ClassRef>>;
  function put (line 13) | pub fn put(key: &[u8], klass: ClassRef) {
  function find (line 23) | pub fn find(key: &[u8]) -> Option<ClassRef> {
  function init (line 30) | pub fn init() {

FILE: crates/vm/src/runtime/thread/condvar.rs
  type Condvar (line 5) | pub struct Condvar {
    method new (line 26) | pub const fn new() -> Condvar {
    method init (line 43) | pub unsafe fn init(&mut self) {}
    method init (line 52) | pub unsafe fn init(&mut self) {
    method notify_one (line 68) | pub unsafe fn notify_one(&self) {
    method notify_all (line 76) | pub unsafe fn notify_all(&self) {
    method wait (line 84) | pub unsafe fn wait(&self, mutex: &ReentrantMutex) {
    method wait_timeout (line 99) | pub unsafe fn wait_timeout(&self, mutex: &ReentrantMutex, dur: Duratio...
    method wait_timeout (line 137) | pub unsafe fn wait_timeout(&self, mutex: &ReentrantMutex, mut dur: Dur...
    method destroy (line 199) | pub unsafe fn destroy(&self) {
    method destroy (line 206) | pub unsafe fn destroy(&self) {
  constant TIMESPEC_MAX (line 12) | const TIMESPEC_MAX: libc::timespec = libc::timespec {
  function saturating_cast_to_time_t (line 17) | fn saturating_cast_to_time_t(value: u64) -> libc::time_t {

FILE: crates/vm/src/runtime/thread/java_thread.rs
  function current_java_thread (line 12) | pub fn current_java_thread() -> JavaThreadRef {
  function is_meet_ex (line 17) | pub fn is_meet_ex() -> bool {
  function set_meet_ex (line 22) | fn set_meet_ex(val: bool) {
  type JavaThread (line 26) | pub struct JavaThread {
    method new (line 39) | pub fn new(tag: Option<String>, eetop: i64) -> JavaThreadRef {
    method main (line 54) | pub fn main() -> JavaThreadRef {
    method set_java_thread_obj (line 58) | pub fn set_java_thread_obj(&mut self, obj: Oop) {
    method set_ex (line 65) | pub fn set_ex(&mut self, ex: Oop) {
    method take_ex (line 70) | pub fn take_ex(&mut self) -> Option<Oop> {

FILE: crates/vm/src/runtime/thread/main.rs
  type MainThread (line 8) | pub struct MainThread {
    method new (line 15) | pub fn new(class: String, args: Vec<String>) -> Self {
    method run (line 23) | pub fn run(&mut self) {
    method build_main_arg (line 85) | fn build_main_arg(&self) -> Vec<Oop> {
    method uncaught_ex (line 97) | fn uncaught_ex(&mut self, main_cls: ClassRef) {
    method call_dispatch_uncaught_exception (line 106) | fn call_dispatch_uncaught_exception(&mut self, main_cls: ClassRef) {
    method uncaught_ex_internal (line 146) | fn uncaught_ex_internal(&mut self) {

FILE: crates/vm/src/runtime/thread/mutex.rs
  function raw (line 6) | pub unsafe fn raw(m: &ReentrantMutex) -> *mut libc::pthread_mutex_t {
  type ReentrantMutex (line 10) | pub struct ReentrantMutex {
    method uninitialized (line 20) | pub unsafe fn uninitialized() -> ReentrantMutex {
    method init (line 28) | pub unsafe fn init(&mut self) {
    method lock (line 44) | pub unsafe fn lock(&self) {
    method try_lock (line 52) | pub unsafe fn try_lock(&self) -> bool {
    method unlock (line 58) | pub unsafe fn unlock(&self) {
    method destroy (line 65) | pub unsafe fn destroy(&self) {

FILE: crates/vm/src/runtime/thread/thread_pool.rs
  type ThreadPool (line 6) | pub struct ThreadPool {
    method new (line 36) | pub fn new(size: usize) -> ThreadPool {
    method execute (line 52) | pub fn execute<F>(&self, f: F)
  type Message (line 11) | enum Message {
  type FnBox (line 16) | trait FnBox {
    method call_box (line 17) | fn call_box(self: Box<Self>);
    method call_box (line 21) | fn call_box(self: Box<F>) {
  type Job (line 26) | type Job = Box<dyn FnBox + Send + 'static>;
  method drop (line 62) | fn drop(&mut self) {
  type Worker (line 81) | struct Worker {
    method new (line 87) | fn new(id: usize, receiver: Arc<Mutex<mpsc::Receiver<Message>>>) -> Wo...

FILE: crates/vm/src/runtime/thread/threads.rs
  type Threads (line 8) | pub struct Threads {
    method new (line 16) | pub fn new(thread_pool_count: usize) -> Threads {
    method next_id (line 27) | pub fn next_id(&self) -> i64 {
    method attach_current_thread (line 31) | pub fn attach_current_thread(&self) {
    method attach_java_thread (line 38) | pub fn attach_java_thread(&self, thread: JavaThreadRef) {
    method detach_current_thread (line 43) | pub fn detach_current_thread(&self) {
    method find_java_thread (line 51) | pub fn find_java_thread(&self, eetop: i64) -> Option<JavaThreadRef> {
    method join_all (line 59) | pub fn join_all(&self) {
    method spawn_java_thread (line 67) | pub fn spawn_java_thread<F: FnOnce() + Send + 'static>(&self, f: F) {

FILE: crates/vm/src/runtime/vm.rs
  function get_vm (line 6) | pub fn get_vm() -> &'static VM {
  function set_vm (line 10) | pub fn set_vm(vm: &VM) {
  type VM (line 18) | pub struct VM {
    method new (line 23) | pub fn new(thread_pool_count: usize) -> Box<VM> {

FILE: crates/vm/src/types.rs
  type FieldIdRef (line 9) | pub type FieldIdRef = Arc<FieldId>;
  type MethodIdRef (line 10) | pub type MethodIdRef = Arc<MethodId>;
  type ClassRef (line 11) | pub type ClassRef = Arc<ClassPtr>;

FILE: crates/vm/src/util/attributes.rs
  function assemble_annotation (line 3) | pub fn assemble_annotation(attrs: &[AttributeType]) -> Option<Vec<u8>> {
  function assemble_param_annotation (line 22) | pub fn assemble_param_annotation(attrs: &[AttributeType]) -> Option<Vec<...
  function assemble_type_annotation (line 41) | pub fn assemble_type_annotation(attrs: &[AttributeType]) -> Option<Vec<u...
  function assemble_annotation_default (line 60) | pub fn assemble_annotation_default(attrs: &[AttributeType]) -> Option<Ve...
  function get_signature (line 72) | pub fn get_signature(attrs: &[AttributeType]) -> u16 {
  function do_assemble (line 82) | fn do_assemble(vis: Option<BytesRef>, in_vis: Option<BytesRef>) -> Optio...

FILE: crates/vm/src/util/debug.rs
  function print_stack_trace (line 7) | pub fn print_stack_trace(jt: &JavaThread) {

FILE: crates/vm/src/util/mod.rs
  function new_field_id (line 16) | pub fn new_field_id(cls: &[u8], name: &[u8], desc: &[u8]) -> BytesRef {

FILE: crates/vm/src/util/oop.rs
  function set_java_lang_string_value_offset (line 8) | pub fn set_java_lang_string_value_offset(offset: usize) {
  function set_java_lang_integer_value_offset (line 14) | pub fn set_java_lang_integer_value_offset(offset: usize) {
  function get_java_lang_string_value_offset (line 20) | pub fn get_java_lang_string_value_offset() -> usize {
  function get_java_lang_integer_value_offset (line 24) | pub fn get_java_lang_integer_value_offset() -> usize {
  function new_java_lang_string2 (line 28) | pub fn new_java_lang_string2(v: &str) -> Oop {
  function new_java_lang_string3 (line 42) | pub fn new_java_lang_string3(bs: &[u8]) -> Oop {

FILE: crates/vm/src/util/sys.rs
  constant FILE_SEP (line 3) | pub const FILE_SEP: &str = platform::FILE_SEP;
  constant PATH_SEP (line 4) | pub const PATH_SEP: &str = platform::PATH_SEP;
  constant LINE_SEP (line 5) | pub const LINE_SEP: &str = "\n";
  constant FILE_SEP (line 9) | pub const FILE_SEP: &str = "/";
  constant PATH_SEP (line 10) | pub const PATH_SEP: &str = ":";
  constant FILE_SEP (line 15) | pub const FILE_SEP: &str = "\\";
  constant PATH_SEP (line 16) | pub const PATH_SEP: &str = ";";

FILE: jvm/sample/HelloWorld.java
  class HelloWorld (line 1) | class HelloWorld
    method main (line 3) | public static void main(String[] args)

FILE: jvm/src/main.rs
  function main (line 10) | fn main() {

FILE: jvm/src/options.rs
  type Opt (line 5) | pub struct Opt {
  function parse (line 20) | pub fn parse() -> Opt {

FILE: libjvm/src/invocation.rs
  function JNI_GetDefaultJavaVMInitArgs (line 16) | extern "C" fn JNI_GetDefaultJavaVMInitArgs(args: *mut c_void) -> jint {
  type VMHolder (line 21) | struct VMHolder {
    method inner (line 28) | fn inner(&self) -> JavaVM {
  function DestroyJavaVM (line 38) | unsafe extern "system" fn DestroyJavaVM(_vm: *mut JavaVM) -> jint {
  function AttachCurrentThread (line 41) | unsafe extern "system" fn AttachCurrentThread(
  function DetachCurrentThread (line 48) | unsafe extern "system" fn DetachCurrentThread(_vm: *mut JavaVM) -> jint {
  function GetEnv (line 51) | unsafe extern "system" fn GetEnv(
  function AttachCurrentThreadAsDaemon (line 294) | unsafe extern "system" fn AttachCurrentThreadAsDaemon(
  type JavaVMOption (line 303) | struct JavaVMOption {
    method string (line 308) | fn string(&self) -> &std::ffi::CStr {
    method fmt (line 313) | fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
  type JavaVMInitArgs (line 321) | struct JavaVMInitArgs {
    method options (line 329) | fn options(&self) -> &[JavaVMOption] {
    method fmt (line 335) | fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
  function JNI_CreateJavaVM (line 345) | extern "C" fn JNI_CreateJavaVM(
  function JNI_GetCreatedJavaVMs (line 399) | extern "C" fn JNI_GetCreatedJavaVMs(

FILE: libjvm/src/native.rs
  type va_list (line 12) | pub type va_list = *mut c_void;
  function GetVersion (line 14) | pub unsafe extern "system" fn GetVersion(env: *mut JNIEnv) -> jint {
  function DefineClass (line 17) | pub unsafe extern "system" fn DefineClass(
  function FindClass (line 26) | pub unsafe extern "system" fn FindClass(env: *mut JNIEnv, name: *const c...
  function FromReflectedMethod (line 29) | pub unsafe extern "system" fn FromReflectedMethod(env: *mut JNIEnv, meth...
  function FromReflectedField (line 32) | pub unsafe extern "system" fn FromReflectedField(env: *mut JNIEnv, field...
  function ToReflectedMethod (line 35) | pub unsafe extern "system" fn ToReflectedMethod(
  function GetSuperclass (line 43) | pub unsafe extern "system" fn GetSuperclass(env: *mut JNIEnv, sub: jclas...
  function IsAssignableFrom (line 46) | pub unsafe extern "system" fn IsAssignableFrom(
  function ToReflectedField (line 53) | pub unsafe extern "system" fn ToReflectedField(
  function Throw (line 61) | pub unsafe extern "system" fn Throw(env: *mut JNIEnv, obj: jthrowable) -...
  function ThrowNew (line 64) | pub unsafe extern "system" fn ThrowNew(
  function ExceptionOccurred (line 71) | pub unsafe extern "system" fn ExceptionOccurred(env: *mut JNIEnv) -> jth...
  function ExceptionDescribe (line 74) | pub unsafe extern "system" fn ExceptionDescribe(env: *mut JNIEnv) {
  function ExceptionClear (line 77) | pub unsafe extern "system" fn ExceptionClear(env: *mut JNIEnv) {
  function FatalError (line 80) | pub unsafe extern "system" fn FatalError(env: *mut JNIEnv, msg: *const c...
  function PushLocalFrame (line 83) | pub unsafe extern "system" fn PushLocalFrame(env: *mut JNIEnv, capacity:...
  function PopLocalFrame (line 86) | pub unsafe extern "system" fn PopLocalFrame(env: *mut JNIEnv, result: jo...
  function NewGlobalRef (line 89) | pub unsafe extern "system" fn NewGlobalRef(env: *mut JNIEnv, lobj: jobje...
  function DeleteGlobalRef (line 92) | pub unsafe extern "system" fn DeleteGlobalRef(env: *mut JNIEnv, gref: jo...
  function DeleteLocalRef (line 95) | pub unsafe extern "system" fn DeleteLocalRef(env: *mut JNIEnv, obj: jobj...
  function IsSameObject (line 98) | pub unsafe extern "system" fn IsSameObject(
  function NewLocalRef (line 105) | pub unsafe extern "system" fn NewLocalRef(env: *mut JNIEnv, ref_: jobjec...
  function EnsureLocalCapacity (line 108) | pub unsafe extern "system" fn EnsureLocalCapacity(env: *mut JNIEnv, capa...
  function AllocObject (line 111) | pub unsafe extern "system" fn AllocObject(env: *mut JNIEnv, clazz: jclas...
  function NewObject (line 114) | pub unsafe extern "C" fn NewObject(
  function NewObjectV (line 122) | pub unsafe extern "system" fn NewObjectV(
  function NewObjectA (line 130) | pub unsafe extern "system" fn NewObjectA(
  function GetObjectClass (line 138) | pub unsafe extern "system" fn GetObjectClass(env: *mut JNIEnv, obj: jobj...
  function IsInstanceOf (line 141) | pub unsafe extern "system" fn IsInstanceOf(
  function GetMethodID (line 148) | pub unsafe extern "system" fn GetMethodID(
  function CallObjectMethod (line 156) | pub unsafe extern "C" fn CallObjectMethod(
  function CallObjectMethodV (line 164) | pub unsafe extern "system" fn CallObjectMethodV(
  function CallObjectMethodA (line 172) | pub unsafe extern "system" fn CallObjectMethodA(
  function CallBooleanMethod (line 180) | pub unsafe extern "C" fn CallBooleanMethod(
  function CallBooleanMethodV (line 188) | pub unsafe extern "system" fn CallBooleanMethodV(
  function CallBooleanMethodA (line 196) | pub unsafe extern "system" fn CallBooleanMethodA(
  function CallByteMethod (line 204) | pub unsafe extern "C" fn CallByteMethod(
  function CallByteMethodV (line 212) | pub unsafe extern "system" fn CallByteMethodV(
  function CallByteMethodA (line 220) | pub unsafe extern "system" fn CallByteMethodA(
  function CallCharMethod (line 228) | pub unsafe extern "C" fn CallCharMethod(
  function CallCharMethodV (line 236) | pub unsafe extern "system" fn CallCharMethodV(
  function CallCharMethodA (line 244) | pub unsafe extern "system" fn CallCharMethodA(
  function CallShortMethod (line 252) | pub unsafe extern "C" fn CallShortMethod(
  function CallShortMethodV (line 260) | pub unsafe extern "system" fn CallShortMethodV(
  function CallShortMethodA (line 268) | pub unsafe extern "system" fn CallShortMethodA(
  function CallIntMethod (line 276) | pub unsafe extern "C" fn CallIntMethod(
  function CallIntMethodV (line 284) | pub unsafe extern "system" fn CallIntMethodV(
  function CallIntMethodA (line 292) | pub unsafe extern "system" fn CallIntMethodA(
  function CallLongMethod (line 300) | pub unsafe extern "C" fn CallLongMethod(
  function CallLongMethodV (line 308) | pub unsafe extern "system" fn CallLongMethodV(
  function CallLongMethodA (line 316) | pub unsafe extern "system" fn CallLongMethodA(
  function CallFloatMethod (line 324) | pub unsafe extern "C" fn CallFloatMethod(
  function CallFloatMethodV (line 332) | pub unsafe extern "system" fn CallFloatMethodV(
  function CallFloatMethodA (line 340) | pub unsafe extern "system" fn CallFloatMethodA(
  function CallDoubleMethod (line 348) | pub unsafe extern "C" fn CallDoubleMethod(
  function CallDoubleMethodV (line 356) | pub unsafe extern "system" fn CallDoubleMethodV(
  function CallDoubleMethodA (line 364) | pub unsafe extern "system" fn CallDoubleMethodA(
  function CallVoidMethod (line 372) | pub unsafe extern "C" fn CallVoidMethod(env: *mut JNIEnv, obj: jobject, ...
  function CallVoidMethodV (line 375) | pub unsafe extern "system" fn CallVoidMethodV(
  function CallVoidMethodA (line 383) | pub unsafe extern "system" fn CallVoidMethodA(
  function CallNonvirtualObjectMethod (line 391) | pub unsafe extern "C" fn CallNonvirtualObjectMethod(
  function CallNonvirtualObjectMethodV (line 400) | pub unsafe extern "system" fn CallNonvirtualObjectMethodV(
  function CallNonvirtualObjectMethodA (line 409) | pub unsafe extern "system" fn CallNonvirtualObjectMethodA(
  function CallNonvirtualBooleanMethod (line 418) | pub unsafe extern "C" fn CallNonvirtualBooleanMethod(
  function CallNonvirtualBooleanMethodV (line 427) | pub unsafe extern "system" fn CallNonvirtualBooleanMethodV(
  function CallNonvirtualBooleanMethodA (line 436) | pub unsafe extern "system" fn CallNonvirtualBooleanMethodA(
  function CallNonvirtualByteMethod (line 445) | pub unsafe extern "C" fn CallNonvirtualByteMethod(
  function CallNonvirtualByteMethodV (line 454) | pub unsafe extern "system" fn CallNonvirtualByteMethodV(
  function CallNonvirtualByteMethodA (line 463) | pub unsafe extern "system" fn CallNonvirtualByteMethodA(
  function CallNonvirtualCharMethod (line 472) | pub unsafe extern "C" fn CallNonvirtualCharMethod(
  function CallNonvirtualCharMethodV (line 481) | pub unsafe extern "system" fn CallNonvirtualCharMethodV(
  function CallNonvirtualCharMethodA (line 490) | pub unsafe extern "system" fn CallNonvirtualCharMethodA(
  function CallNonvirtualShortMethod (line 499) | pub unsafe extern "C" fn CallNonvirtualShortMethod(
  function CallNonvirtualShortMethodV (line 508) | pub unsafe extern "system" fn CallNonvirtualShortMethodV(
  function CallNonvirtualShortMethodA (line 517) | pub unsafe extern "system" fn CallNonvirtualShortMethodA(
  function CallNonvirtualIntMethod (line 526) | pub unsafe extern "C" fn CallNonvirtualIntMethod(
  function CallNonvirtualIntMethodV (line 535) | pub unsafe extern "system" fn CallNonvirtualIntMethodV(
  function CallNonvirtualIntMethodA (line 544) | pub unsafe extern "system" fn CallNonvirtualIntMethodA(
  function CallNonvirtualLongMethod (line 553) | pub unsafe extern "C" fn CallNonvirtualLongMethod(
  function CallNonvirtualLongMethodV (line 562) | pub unsafe extern "system" fn CallNonvirtualLongMethodV(
  function CallNonvirtualLongMethodA (line 571) | pub unsafe extern "system" fn CallNonvirtualLongMethodA(
  function CallNonvirtualFloatMethod (line 580) | pub unsafe extern "C" fn CallNonvirtualFloatMethod(
  function CallNonvirtualFloatMethodV (line 589) | pub unsafe extern "system" fn CallNonvirtualFloatMethodV(
  function CallNonvirtualFloatMethodA (line 598) | pub unsafe extern "system" fn CallNonvirtualFloatMethodA(
  function CallNonvirtualDoubleMethod (line 607) | pub unsafe extern "C" fn CallNonvirtualDoubleMethod(
  function CallNonvirtualDoubleMethodV (line 616) | pub unsafe extern "system" fn CallNonvirtualDoubleMethodV(
  function CallNonvirtualDoubleMethodA (line 625) | pub unsafe extern "system" fn CallNonvirtualDoubleMethodA(
  function CallNonvirtualVoidMethod (line 634) | pub unsafe extern "C" fn CallNonvirtualVoidMethod(
  function CallNonvirtualVoidMethodV (line 643) | pub unsafe extern "system" fn CallNonvirtualVoidMethodV(
  function CallNonvirtualVoidMethodA (line 652) | pub unsafe extern "system" fn CallNonvirtualVoidMethodA(
  function GetFieldID (line 661) | pub unsafe extern "system" fn GetFieldID(
  function GetObjectField (line 669) | pub unsafe extern "system" fn GetObjectField(
  function GetBooleanField (line 676) | pub unsafe extern "system" fn GetBooleanField(
  function GetByteField (line 683) | pub unsafe extern "system" fn GetByteField(
  function GetCharField (line 690) | pub unsafe extern "system" fn GetCharField(
  function GetShortField (line 697) | pub unsafe extern "system" fn GetShortField(
  function GetIntField (line 704) | pub unsafe extern "system" fn GetIntField(
  function GetLongField (line 711) | pub unsafe extern "system" fn GetLongField(
  function GetFloatField (line 718) | pub unsafe extern "system" fn GetFloatField(
  function GetDoubleField (line 725) | pub unsafe extern "system" fn GetDoubleField(
  function SetObjectField (line 732) | pub unsafe extern "system" fn SetObjectField(
  function SetBooleanField (line 740) | pub unsafe extern "system" fn SetBooleanField(
  function SetByteField (line 748) | pub unsafe extern "system" fn SetByteField(
  function SetCharField (line 756) | pub unsafe extern "system" fn SetCharField(
  function SetShortField (line 764) | pub unsafe extern "system" fn SetShortField(
  function SetIntField (line 772) | pub unsafe extern "system" fn SetIntField(
  function SetLongField (line 780) | pub unsafe extern "system" fn SetLongField(
  function SetFloatField (line 788) | pub unsafe extern "system" fn SetFloatField(
  function SetDoubleField (line 796) | pub unsafe extern "system" fn SetDoubleField(
  function GetStaticMethodID (line 804) | pub unsafe extern "system" fn GetStaticMethodID(
  function CallStaticObjectMethod (line 812) | pub unsafe extern "C" fn CallStaticObjectMethod(
  function CallStaticObjectMethodV (line 820) | pub unsafe extern "system" fn CallStaticObjectMethodV(
  function CallStaticObjectMethodA (line 828) | pub unsafe extern "system" fn CallStaticObjectMethodA(
  function CallStaticBooleanMethod (line 836) | pub unsafe extern "C" fn CallStaticBooleanMethod(
  function CallStaticBooleanMethodV (line 844) | pub unsafe extern "system" fn CallStaticBooleanMethodV(
  function CallStaticBooleanMethodA (line 852) | pub unsafe extern "system" fn CallStaticBooleanMethodA(
  function CallStaticByteMethod (line 860) | pub unsafe extern "C" fn CallStaticByteMethod(
  function CallStaticByteMethodV (line 868) | pub unsafe extern "system" fn CallStaticByteMethodV(
  function CallStaticByteMethodA (line 876) | pub unsafe extern "system" fn CallStaticByteMethodA(
  function CallStaticCharMethod (line 884) | pub unsafe extern "C" fn CallStaticCharMethod(
  function CallStaticCharMethodV (line 892) | pub unsafe extern "system" fn CallStaticCharMethodV(
  function CallStaticCharMethodA (line 900) | pub unsafe extern "system" fn CallStaticCharMethodA(
  function CallStaticShortMethod (line 908) | pub unsafe extern "C" fn CallStaticShortMethod(
  function CallStaticShortMethodV (line 916) | pub unsafe extern "system" fn CallStaticShortMethodV(
  function CallStaticShortMethodA (line 924) | pub unsafe extern "system" fn CallStaticShortMethodA(
  function CallStaticIntMethod (line 932) | pub unsafe extern "C" fn CallStaticIntMethod(
  function CallStaticIntMethodV (line 940) | pub unsafe extern "system" fn CallStaticIntMethodV(
  function CallStaticIntMethodA (line 948) | pub unsafe extern "system" fn CallStaticIntMethodA(
  function CallStaticLongMethod (line 956) | pub unsafe extern "C" fn CallStaticLongMethod(
  function CallStaticLongMethodV (line 964) | pub unsafe extern "system" fn CallStaticLongMethodV(
  function CallStaticLongMethodA (line 972) | pub unsafe extern "system" fn CallStaticLongMethodA(
  function CallStaticFloatMethod (line 980) | pub unsafe extern "C" fn CallStaticFloatMethod(
  function CallStaticFloatMethodV (line 988) | pub unsafe extern "system" fn CallStaticFloatMethodV(
  function CallStaticFloatMethodA (line 996) | pub unsafe extern "system" fn CallStaticFloatMethodA(
  function CallStaticDoubleMethod (line 1004) | pub unsafe extern "C" fn CallStaticDoubleMethod(
  function CallStaticDoubleMethodV (line 1012) | pub unsafe extern "system" fn CallStaticDoubleMethodV(
  function CallStaticDoubleMethodA (line 1020) | pub unsafe extern "system" fn CallStaticDoubleMethodA(
  function CallStaticVoidMethod (line 1028) | pub unsafe extern "C" fn CallStaticVoidMethod(
  function CallStaticVoidMethodV (line 1036) | pub unsafe extern "system" fn CallStaticVoidMethodV(
  function CallStaticVoidMethodA (line 1044) | pub unsafe extern "system" fn CallStaticVoidMethodA(
  function GetStaticFieldID (line 1052) | pub unsafe extern "system" fn GetStaticFieldID(
  function GetStaticObjectField (line 1060) | pub unsafe extern "system" fn GetStaticObjectField(
  function GetStaticBooleanField (line 1067) | pub unsafe extern "system" fn GetStaticBooleanField(
  function GetStaticByteField (line 1074) | pub unsafe extern "system" fn GetStaticByteField(
  function GetStaticCharField (line 1081) | pub unsafe extern "system" fn GetStaticCharField(
  function GetStaticShortField (line 1088) | pub unsafe extern "system" fn GetStaticShortField(
  function GetStaticIntField (line 1095) | pub unsafe extern "system" fn GetStaticIntField(
  function GetStaticLongField (line 1102) | pub unsafe extern "system" fn GetStaticLongField(
  function GetStaticFloatField (line 1109) | pub unsafe extern "system" fn GetStaticFloatField(
  function GetStaticDoubleField (line 1116) | pub unsafe extern "system" fn GetStaticDoubleField(
  function SetStaticObjectField (line 1123) | pub unsafe extern "system" fn SetStaticObjectField(
  function SetStaticBooleanField (line 1131) | pub unsafe extern "system" fn SetStaticBooleanField(
  function SetStaticByteField (line 1139) | pub unsafe extern "system" fn SetStaticByteField(
  function SetStaticCharField (line 1147) | pub unsafe extern "system" fn SetStaticCharField(
  function SetStaticShortField (line 1155) | pub unsafe extern "system" fn SetStaticShortField(
  function SetStaticIntField (line 1163) | pub unsafe extern "system" fn SetStaticIntField(
  function SetStaticLongField (line 1171) | pub unsafe extern "system" fn SetStaticLongField(
  function SetStaticFloatField (line 1179) | pub unsafe extern "system" fn SetStaticFloatField(
  function SetStaticDoubleField (line 1187) | pub unsafe extern "system" fn SetStaticDoubleField(
  function NewString (line 1195) | pub unsafe extern "system" fn NewString(
  function GetStringLength (line 1202) | pub unsafe extern "system" fn GetStringLength(env: *mut JNIEnv, str: jst...
  function GetStringChars (line 1205) | pub unsafe extern "system" fn GetStringChars(
  function ReleaseStringChars (line 1212) | pub unsafe extern "system" fn ReleaseStringChars(
  function NewStringUTF (line 1219) | pub unsafe extern "system" fn NewStringUTF(env: *mut JNIEnv, utf: *const...
  function GetStringUTFLength (line 1222) | pub unsafe extern "system" fn GetStringUTFLength(env: *mut JNIEnv, str: ...
  function GetStringUTFChars (line 1225) | pub unsafe extern "system" fn GetStringUTFChars(
  function ReleaseStringUTFChars (line 1232) | pub unsafe extern "system" fn ReleaseStringUTFChars(
  function GetArrayLength (line 1239) | pub unsafe extern "system" fn GetArrayLength(env: *mut JNIEnv, array: ja...
  function NewObjectArray (line 1242) | pub unsafe extern "system" fn NewObjectArray(
  function GetObjectArrayElement (line 1250) | pub unsafe extern "system" fn GetObjectArrayElement(
  function SetObjectArrayElement (line 1257) | pub unsafe extern "system" fn SetObjectArrayElement(
  function NewBooleanArray (line 1265) | pub unsafe extern "system" fn NewBooleanArray(env: *mut JNIEnv, len: jsi...
  function NewByteArray (line 1268) | pub unsafe extern "system" fn NewByteArray(env: *mut JNIEnv, len: jsize)...
  function NewCharArray (line 1271) | pub unsafe extern "system" fn NewCharArray(env: *mut JNIEnv, len: jsize)...
  function NewShortArray (line 1274) | pub unsafe extern "system" fn NewShortArray(env: *mut JNIEnv, len: jsize...
  function NewIntArray (line 1277) | pub unsafe extern "system" fn NewIntArray(env: *mut JNIEnv, len: jsize) ...
  function NewLongArray (line 1280) | pub unsafe extern "system" fn NewLongArray(env: *mut JNIEnv, len: jsize)...
  function NewFloatArray (line 1283) | pub unsafe extern "system" fn NewFloatArray(env: *mut JNIEnv, len: jsize...
  function NewDoubleArray (line 1286) | pub unsafe extern "system" fn NewDoubleArray(env: *mut JNIEnv, len: jsiz...
  function GetBooleanArrayElements (line 1289) | pub unsafe extern "system" fn GetBooleanArrayElements(
  function GetByteArrayElements (line 1296) | pub unsafe extern "system" fn GetByteArrayElements(
  function GetCharArrayElements (line 1303) | pub unsafe extern "system" fn GetCharArrayElements(
  function GetShortArrayElements (line 1310) | pub unsafe extern "system" fn GetShortArrayElements(
  function GetIntArrayElements (line 1317) | pub unsafe extern "system" fn GetIntArrayElements(
  function GetLongArrayElements (line 1324) | pub unsafe extern "system" fn GetLongArrayElements(
  function GetFloatArrayElements (line 1331) | pub unsafe extern "system" fn GetFloatArrayElements(
  function GetDoubleArrayElements (line 1338) | pub unsafe extern "system" fn GetDoubleArrayElements(
  function ReleaseBooleanArrayElements (line 1345) | pub unsafe extern "system" fn ReleaseBooleanArrayElements(
  function ReleaseByteArrayElements (line 1353) | pub unsafe extern "system" fn ReleaseByteArrayElements(
  function ReleaseCharArrayElements (line 1361) | pub unsafe extern "system" fn ReleaseCharArrayElements(
  function ReleaseShortArrayElements (line 1369) | pub unsafe extern "system" fn ReleaseShortArrayElements(
  function ReleaseIntArrayElements (line 1377) | pub unsafe extern "system" fn ReleaseIntArrayElements(
  function ReleaseLongArrayElements (line 1385) | pub unsafe extern "system" fn ReleaseLongArrayElements(
  function ReleaseFloatArrayElements (line 1393) | pub unsafe extern "system" fn ReleaseFloatArrayElements(
  function ReleaseDoubleArrayElements (line 1401) | pub unsafe extern "system" fn ReleaseDoubleArrayElements(
  function GetBooleanArrayRegion (line 1409) | pub unsafe extern "system" fn GetBooleanArrayRegion(
  function GetByteArrayRegion (line 1418) | pub unsafe extern "system" fn GetByteArrayRegion(
  function GetCharArrayRegion (line 1427) | pub unsafe extern "system" fn GetCharArrayRegion(
  function GetShortArrayRegion (line 1436) | pub unsafe extern "system" fn GetShortArrayRegion(
  function GetIntArrayRegion (line 1445) | pub unsafe extern "system" fn GetIntArrayRegion(
  function GetLongArrayRegion (line 1454) | pub unsafe extern "system" fn GetLongArrayRegion(
  function GetFloatArrayRegion (line 1463) | pub unsafe extern "system" fn GetFloatArrayRegion(
  function GetDoubleArrayRegion (line 1472) | pub unsafe extern "system" fn GetDoubleArrayRegion(
  function SetBooleanArrayRegion (line 1481) | pub unsafe extern "system" fn SetBooleanArrayRegion(
  function SetByteArrayRegion (line 1490) | pub unsafe extern "system" fn SetByteArrayRegion(
  function SetCharArrayRegion (line 1499) | pub unsafe extern "system" fn SetCharArrayRegion(
  function SetShortArrayRegion (line 1508) | pub unsafe extern "system" fn SetShortArrayRegion(
  function SetIntArrayRegion (line 1517) | pub unsafe extern "system" fn SetIntArrayRegion(
  function SetLongArrayRegion (line 1526) | pub unsafe extern "system" fn SetLongArrayRegion(
  function SetFloatArrayRegion (line 1535) | pub unsafe extern "system" fn SetFloatArrayRegion(
  function SetDoubleArrayRegion (line 1544) | pub unsafe extern "system" fn SetDoubleArrayRegion(
  function RegisterNatives (line 1553) | pub unsafe extern "system" fn RegisterNatives(
  function UnregisterNatives (line 1561) | pub unsafe extern "system" fn UnregisterNatives(env: *mut JNIEnv, clazz:...
  function MonitorEnter (line 1564) | pub unsafe extern "system" fn MonitorEnter(env: *mut JNIEnv, obj: jobjec...
  function MonitorExit (line 1567) | pub unsafe extern "system" fn MonitorExit(env: *mut JNIEnv, obj: jobject...
  function GetJavaVM (line 1570) | pub unsafe extern "system" fn GetJavaVM(env: *mut JNIEnv, vm: *mut *mut ...
  function GetStringRegion (line 1573) | pub unsafe extern "system" fn GetStringRegion(
  function GetStringUTFRegion (line 1582) | pub unsafe extern "system" fn GetStringUTFRegion(
  function GetPrimitiveArrayCritical (line 1591) | pub unsafe extern "system" fn GetPrimitiveArrayCritical(
  function ReleasePrimitiveArrayCritical (line 1598) | pub unsafe extern "system" fn ReleasePrimitiveArrayCritical(
  function GetStringCritical (line 1606) | pub unsafe extern "system" fn GetStringCritical(
  function ReleaseStringCritical (line 1613) | pub unsafe extern "system" fn ReleaseStringCritical(
  function NewWeakGlobalRef (line 1620) | pub unsafe extern "system" fn NewWeakGlobalRef(env: *mut JNIEnv, obj: jo...
  function DeleteWeakGlobalRef (line 1623) | pub unsafe extern "system" fn DeleteWeakGlobalRef(env: *mut JNIEnv, ref_...
  function ExceptionCheck (line 1626) | pub unsafe extern "system" fn ExceptionCheck(env: *mut JNIEnv) -> jboole...
  function NewDirectByteBuffer (line 1629) | pub unsafe extern "system" fn NewDirectByteBuffer(
  function GetDirectBufferAddress (line 1636) | pub unsafe extern "system" fn GetDirectBufferAddress(
  function GetDirectBufferCapacity (line 1642) | pub unsafe extern "system" fn GetDirectBufferCapacity(env: *mut JNIEnv, ...
  function GetObjectRefType (line 1645) | pub unsafe extern "system" fn GetObjectRefType(env: *mut JNIEnv, obj: jo...

FILE: libjvm/src/private.rs
  function JVM_FindClassFromBootLoader (line 7) | pub unsafe extern "system" fn JVM_FindClassFromBootLoader(

FILE: libjvm/src/util.rs
  function class_ref_to_jclass (line 6) | pub fn class_ref_to_jclass(class_ref: Option<vm::types::ClassRef>) -> jc...

FILE: tools/javap/src/cmd/disassemble.rs
  type Disassemble (line 13) | pub struct Disassemble {
    method new (line 24) | pub fn new(m: &ArgMatches) -> Option<Self> {
    method do_render (line 52) | fn do_render(&self, si: &SysInfo, cf: ClassFile) {
    method build_show_access_flags (line 98) | fn build_show_access_flags(m: &ArgMatches) -> u16 {
    method build_class_define (line 116) | fn build_class_define(&self, cf: &ClassFile) -> String {
    method build_sys_info (line 181) | fn build_sys_info(&self, si: &SysInfo, cf: &ClassFile) -> SysInfoSerde {
    method build_fields (line 196) | fn build_fields(&self, cf: &ClassFile) -> Vec<FieldInfoSerde> {
    method build_methods (line 214) | fn build_methods(&self, cf: &ClassFile) -> Vec<MethodInfoSerde> {
  method run (line 46) | fn run(&self, si: &SysInfo, cf: ClassFile) {

FILE: tools/javap/src/cmd/mod.rs
  type Cmd (line 8) | pub trait Cmd {
    method run (line 9) | fn run(&self, si: &SysInfo, cf: ClassFile);

FILE: tools/javap/src/main.rs
  function main (line 56) | fn main() {
  function init (line 164) | fn init() {

FILE: tools/javap/src/misc/class_path_manager.rs
  function init (line 15) | pub fn init() {
  function find_class (line 19) | pub fn find_class(name: &str) -> Result<ClassPathResult, io::Error> {
  function add_path (line 24) | pub fn add_path(path: &str) {
  function add_paths (line 29) | pub fn add_paths(path: &str) {
  type ClassPathResult (line 36) | pub struct ClassPathResult(pub SysInfo, pub Vec<u8>);
  type ZipRef (line 38) | type ZipRef = Arc<Mutex<Box<ZipArchive<File>>>>;
  type ClassSource (line 40) | enum ClassSource {
  type ClassPathManager (line 45) | struct ClassPathManager {
    method new (line 50) | fn new() -> Self {
    method add_class_path (line 56) | pub fn add_class_path(&mut self, path: &str) -> Result<(), io::Error> {
    method add_class_paths (line 72) | pub fn add_class_paths(&mut self, path: &str) {
    method search_class (line 80) | pub fn search_class(&self, name: &str) -> Result<ClassPathResult, io::...
    method size (line 156) | pub fn size(&self) -> usize {

FILE: tools/javap/src/misc/sys_info.rs
  type SysInfo (line 2) | pub struct SysInfo {

FILE: tools/javap/src/sd/mod.rs
  type ClassInfoSerde (line 2) | pub struct ClassInfoSerde {
  type MethodInfoSerde (line 22) | pub struct MethodInfoSerde {
  type CodeSerde (line 50) | pub struct CodeSerde {
  type FieldInfoSerde (line 60) | pub struct FieldInfoSerde {
  type LineNumberSerde (line 75) | pub struct LineNumberSerde {
  type SysInfoSerde (line 81) | pub struct SysInfoSerde {
  type ClassVersionSerde (line 90) | pub struct ClassVersionSerde {
  type StackMapTableSerde (line 96) | pub struct StackMapTableSerde {
  type StackMapFrameSerde (line 102) | pub struct StackMapFrameSerde {
  method default (line 108) | fn default() -> Self {
  method default (line 120) | fn default() -> Self {
  method default (line 133) | fn default() -> Self {
  method default (line 142) | fn default() -> Self {

FILE: tools/javap/src/strategy.rs
  function choose (line 6) | pub fn choose(m: &ArgMatches) -> Box<dyn Cmd> {
  function setup_classpath (line 13) | pub fn setup_classpath(matches: &ArgMatches) {

FILE: tools/javap/src/template.rs
  constant PART_COMPILED_FROM (line 3) | pub const PART_COMPILED_FROM: &str = "Compiled from \"{{source_file}}\"";
  constant PART_SYS_INFO (line 4) | pub const PART_SYS_INFO: &str = "
  constant PART_FIELDS (line 10) | pub const PART_FIELDS: &str = "
  constant PART_METHODS (line 27) | pub const PART_METHODS: &str = "
  constant PART_CP (line 87) | pub const PART_CP: &str = "
  constant CLASS (line 94) | pub const CLASS: &str = "
  function get_engine (line 127) | pub fn get_engine() -> Handlebars<'static> {

FILE: tools/javap/src/trans/access_flag.rs
  type Translator (line 3) | pub struct Translator {
    method new (line 8) | pub fn new(flags: AccessFlag) -> Self {
    method class_access_flags (line 14) | pub fn class_access_flags(&self, only_flag: bool) -> String {
    method method_access_flags (line 47) | pub fn method_access_flags(&self) -> String {
    method field_access_flags (line 76) | pub fn field_access_flags(&self) -> String {
    method access_flag_inner (line 99) | pub fn access_flag_inner(&self) -> String {
  type AccessFlag (line 143) | type AccessFlag = u16;
  type AccessFlagHelper (line 145) | pub trait AccessFlagHelper {
    method is_public (line 146) | fn is_public(&self) -> bool;
    method is_final (line 147) | fn is_final(&self) -> bool;
    method is_super (line 148) | fn is_super(&self) -> bool;
    method is_interface (line 149) | fn is_interface(&self) -> bool;
    method is_abstract (line 150) | fn is_abstract(&self) -> bool;
    method is_synthetic (line 151) | fn is_synthetic(&self) -> bool;
    method is_annotation (line 152) | fn is_annotation(&self) -> bool;
    method is_enum (line 153) | fn is_enum(&self) -> bool;
    method is_private (line 154) | fn is_private(&self) -> bool;
    method is_protected (line 155) | fn is_protected(&self) -> bool;
    method is_static (line 156) | fn is_static(&self) -> bool;
    method is_synchronized (line 157) | fn is_synchronized(&self) -> bool;
    method is_bridge (line 158) | fn is_bridge(&self) -> bool;
    method is_varargs (line 159) | fn is_varargs(&self) -> bool;
    method is_native (line 160) | fn is_native(&self) -> bool;
    method is_strict (line 161) | fn is_strict(&self) -> bool;
    method is_package (line 162) | fn is_package(&self) -> bool;
    method compare (line 163) | fn compare(&self, other: u16) -> i32;
    method is_public (line 167) | fn is_public(&self) -> bool {
    method is_final (line 171) | fn is_final(&self) -> bool {
    method is_super (line 175) | fn is_super(&self) -> bool {
    method is_interface (line 179) | fn is_interface(&self) -> bool {
    method is_abstract (line 183) | fn is_abstract(&self) -> bool {
    method is_synthetic (line 187) | fn is_synthetic(&self) -> bool {
    method is_annotation (line 191) | fn is_annotation(&self) -> bool {
    method is_enum (line 195) | fn is_enum(&self) -> bool {
    method is_private (line 199) | fn is_private(&self) -> bool {
    method is_protected (line 203) | fn is_protected(&self) -> bool {
    method is_static (line 207) | fn is_static(&self) -> bool {
    method is_synchronized (line 211) | fn is_synchronized(&self) -> bool {
    method is_bridge (line 215) | fn is_bridge(&self) -> bool {
    method is_varargs (line 219) | fn is_varargs(&self) -> bool {
    method is_native (line 223) | fn is_native(&self) -> bool {
    method is_strict (line 227) | fn is_strict(&self) -> bool {
    method is_package (line 231) | fn is_package(&self) -> bool {
    method compare (line 239) | fn compare(&self, other: u16) -> i32 {

FILE: tools/javap/src/trans/class_file.rs
  constant S_UNKNOWN (line 10) | const S_UNKNOWN: &str = "unknown";
  type Translator (line 12) | pub struct Translator<'a> {
  function new (line 17) | pub fn new(cf: &'a ClassFile) -> Self {
  function source_file (line 23) | pub fn source_file(&self) -> String {
  function this_class (line 40) | pub fn this_class(&self) -> String {
  function super_class (line 47) | pub fn super_class(&self) -> String {
  function parent_interfaces (line 54) | pub fn parent_interfaces(&self) -> Vec<String> {
  function access_flags (line 69) | pub fn access_flags(&self) -> String {
  function access_flags_name (line 75) | pub fn access_flags_name(&self) -> String {
  function signature_raw (line 81) | pub fn signature_raw(&self) -> Option<String> {
  function signature (line 89) | pub fn signature(&self) -> Option<Vec<SignatureType>> {
  function methods (line 105) | pub fn methods(
  function fields (line 128) | pub fn fields(&self, flags: u16) -> Vec<FieldTranslation> {
  function inner_classes (line 147) | pub fn inner_classes(&self) -> Vec<String> {

FILE: tools/javap/src/trans/code.rs
  type Translator (line 4) | pub struct Translator<'a> {
  function get (line 10) | pub fn get(&self) -> Vec<String> {
  function interp (line 21) | fn interp(&self) -> Vec<InstructionInfo> {

FILE: tools/javap/src/trans/constant_pool_trans.rs
  type Translator (line 4) | pub struct Translator<'a> {
  function get (line 9) | pub fn get(&self) -> Vec<String> {

FILE: tools/javap/src/trans/field.rs
  type FieldTranslation (line 9) | pub struct FieldTranslation {
  type Translator (line 17) | pub struct Translator<'a> {
  function new (line 23) | pub fn new(cf: &'a ClassFile, field: &'a FieldInfo) -> Self {
  function get (line 29) | pub fn get(&self) -> FieldTranslation {
  function access_flags (line 70) | fn access_flags(&self) -> String {
  function field_type (line 76) | fn field_type(&self) -> String {
  function name (line 82) | fn name(&self) -> String {
  function descriptor (line 87) | fn descriptor(&self) -> String {
  function signature (line 92) | fn signature(&self) -> String {
  function attr_signature (line 98) | fn attr_signature(&self) -> Option<(usize, BytesRef)> {
  function attr_constant_value (line 110) | fn attr_constant_value(&self) -> Option<String> {

FILE: tools/javap/src/trans/instruction/aaload.rs
  type Aaload (line 4) | pub struct Aaload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/aastore.rs
  type Aastore (line 4) | pub struct Aastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/aconst_null.rs
  type Aconst_Null (line 5) | pub struct Aconst_Null;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/aload.rs
  type Aload (line 4) | pub struct Aload {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/aload_0.rs
  type Aload_0 (line 5) | pub struct Aload_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/aload_1.rs
  type Aload_1 (line 5) | pub struct Aload_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/aload_2.rs
  type Aload_2 (line 5) | pub struct Aload_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/aload_3.rs
  type Aload_3 (line 5) | pub struct Aload_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/anewarray.rs
  type Anewarray (line 4) | pub struct Anewarray;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/areturn.rs
  type Areturn (line 4) | pub struct Areturn;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/arraylength.rs
  type Arraylength (line 4) | pub struct Arraylength;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/astore.rs
  type Astore (line 4) | pub struct Astore {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/astore_0.rs
  type Astore_0 (line 5) | pub struct Astore_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/astore_1.rs
  type Astore_1 (line 5) | pub struct Astore_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/astore_2.rs
  type Astore_2 (line 5) | pub struct Astore_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/astore_3.rs
  type Astore_3 (line 5) | pub struct Astore_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/athrow.rs
  type Athrow (line 4) | pub struct Athrow;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/baload.rs
  type Baload (line 4) | pub struct Baload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/bastore.rs
  type Bastore (line 4) | pub struct Bastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/bipush.rs
  type Bipush (line 4) | pub struct Bipush;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/caload.rs
  type Caload (line 4) | pub struct Caload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/castore.rs
  type Castore (line 4) | pub struct Castore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/checkcast.rs
  type Checkcast (line 4) | pub struct Checkcast;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/d2f.rs
  type D2F (line 4) | pub struct D2F;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/d2i.rs
  type D2I (line 4) | pub struct D2I;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/d2l.rs
  type D2L (line 4) | pub struct D2L;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dadd.rs
  type Dadd (line 4) | pub struct Dadd;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/daload.rs
  type Daload (line 4) | pub struct Daload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dastore.rs
  type Dastore (line 4) | pub struct Dastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dcmpg.rs
  type Dcmpg (line 4) | pub struct Dcmpg;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dcmpl.rs
  type Dcmpl (line 4) | pub struct Dcmpl;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dconst_0.rs
  type Dconst_0 (line 5) | pub struct Dconst_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dconst_1.rs
  type Dconst_1 (line 5) | pub struct Dconst_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ddiv.rs
  type Ddiv (line 4) | pub struct Ddiv;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dload.rs
  type Dload (line 4) | pub struct Dload {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/dload_0.rs
  type Dload_0 (line 5) | pub struct Dload_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dload_1.rs
  type Dload_1 (line 5) | pub struct Dload_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dload_2.rs
  type Dload_2 (line 5) | pub struct Dload_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dload_3.rs
  type Dload_3 (line 5) | pub struct Dload_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dmul.rs
  type Dmul (line 4) | pub struct Dmul;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dneg.rs
  type Dneg (line 4) | pub struct Dneg;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/drem.rs
  type Drem (line 4) | pub struct Drem;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dreturn.rs
  type Dreturn (line 4) | pub struct Dreturn;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dstore.rs
  type Dstore (line 4) | pub struct Dstore {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/dstore_0.rs
  type Dstore_0 (line 5) | pub struct Dstore_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dstore_1.rs
  type Dstore_1 (line 5) | pub struct Dstore_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dstore_2.rs
  type Dstore_2 (line 5) | pub struct Dstore_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dstore_3.rs
  type Dstore_3 (line 5) | pub struct Dstore_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dsub.rs
  type Dsub (line 4) | pub struct Dsub;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dup.rs
  type Dup (line 4) | pub struct Dup;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dup2.rs
  type Dup2 (line 4) | pub struct Dup2;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dup2_x1.rs
  type Dup2_X1 (line 5) | pub struct Dup2_X1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dup2_x2.rs
  type Dup2_X2 (line 5) | pub struct Dup2_X2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dup_x1.rs
  type Dup_X1 (line 5) | pub struct Dup_X1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/dup_x2.rs
  type Dup_X2 (line 5) | pub struct Dup_X2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/f2d.rs
  type F2D (line 4) | pub struct F2D;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/f2i.rs
  type F2I (line 4) | pub struct F2I;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/f2l.rs
  type F2L (line 4) | pub struct F2L;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fadd.rs
  type Fadd (line 4) | pub struct Fadd;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/faload.rs
  type Faload (line 4) | pub struct Faload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fastore.rs
  type Fastore (line 4) | pub struct Fastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fcmpg.rs
  type Fcmpg (line 4) | pub struct Fcmpg;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fcmpl.rs
  type Fcmpl (line 4) | pub struct Fcmpl;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fconst_0.rs
  type Fconst_0 (line 5) | pub struct Fconst_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fconst_1.rs
  type Fconst_1 (line 5) | pub struct Fconst_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fconst_2.rs
  type Fconst_2 (line 5) | pub struct Fconst_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fdiv.rs
  type Fdiv (line 4) | pub struct Fdiv;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fload.rs
  type Fload (line 4) | pub struct Fload {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/fload_0.rs
  type Fload_0 (line 5) | pub struct Fload_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fload_1.rs
  type Fload_1 (line 5) | pub struct Fload_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fload_2.rs
  type Fload_2 (line 5) | pub struct Fload_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fload_3.rs
  type Fload_3 (line 5) | pub struct Fload_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fmul.rs
  type Fmul (line 4) | pub struct Fmul;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fneg.rs
  type Fneg (line 4) | pub struct Fneg;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/frem.rs
  type Frem (line 4) | pub struct Frem;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/freturn.rs
  type Freturn (line 4) | pub struct Freturn;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fstore.rs
  type Fstore (line 4) | pub struct Fstore {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/fstore_0.rs
  type Fstore_0 (line 5) | pub struct Fstore_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fstore_1.rs
  type Fstore_1 (line 5) | pub struct Fstore_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fstore_2.rs
  type Fstore_2 (line 5) | pub struct Fstore_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fstore_3.rs
  type Fstore_3 (line 5) | pub struct Fstore_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/fsub.rs
  type Fsub (line 4) | pub struct Fsub;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/getfield.rs
  type Getfield (line 4) | pub struct Getfield;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/getstatic.rs
  type Getstatic (line 4) | pub struct Getstatic;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/goto.rs
  type Goto (line 4) | pub struct Goto;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/goto_w.rs
  type Goto_W (line 5) | pub struct Goto_W;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/i2b.rs
  type I2B (line 4) | pub struct I2B;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/i2c.rs
  type I2C (line 4) | pub struct I2C;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/i2d.rs
  type I2D (line 4) | pub struct I2D;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/i2f.rs
  type I2F (line 4) | pub struct I2F;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/i2l.rs
  type I2L (line 4) | pub struct I2L;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/i2s.rs
  type I2S (line 4) | pub struct I2S;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iadd.rs
  type Iadd (line 4) | pub struct Iadd;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iaload.rs
  type Iaload (line 4) | pub struct Iaload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iand.rs
  type Iand (line 4) | pub struct Iand;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iastore.rs
  type Iastore (line 4) | pub struct Iastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_0.rs
  type Iconst_0 (line 5) | pub struct Iconst_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_1.rs
  type Iconst_1 (line 5) | pub struct Iconst_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_2.rs
  type Iconst_2 (line 5) | pub struct Iconst_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_3.rs
  type Iconst_3 (line 5) | pub struct Iconst_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_4.rs
  type Iconst_4 (line 5) | pub struct Iconst_4;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_5.rs
  type Iconst_5 (line 5) | pub struct Iconst_5;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iconst_m1.rs
  type Iconst_M1 (line 5) | pub struct Iconst_M1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/idiv.rs
  type Idiv (line 4) | pub struct Idiv;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_acmpeq.rs
  type If_Acmpeq (line 5) | pub struct If_Acmpeq;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_acmpne.rs
  type If_Acmpne (line 5) | pub struct If_Acmpne;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_icmpeq.rs
  type If_Icmpeq (line 5) | pub struct If_Icmpeq;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_icmpge.rs
  type If_Icmpge (line 5) | pub struct If_Icmpge;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_icmpgt.rs
  type If_Icmpgt (line 5) | pub struct If_Icmpgt;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_icmple.rs
  type If_Icmple (line 5) | pub struct If_Icmple;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_icmplt.rs
  type If_Icmplt (line 5) | pub struct If_Icmplt;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/if_icmpne.rs
  type If_Icmpne (line 5) | pub struct If_Icmpne;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifeq.rs
  type Ifeq (line 4) | pub struct Ifeq;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifge.rs
  type Ifge (line 4) | pub struct Ifge;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifgt.rs
  type Ifgt (line 4) | pub struct Ifgt;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifle.rs
  type Ifle (line 4) | pub struct Ifle;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iflt.rs
  type Iflt (line 4) | pub struct Iflt;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifne.rs
  type Ifne (line 4) | pub struct Ifne;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifnonnull.rs
  type Ifnonnull (line 4) | pub struct Ifnonnull;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ifnull.rs
  type Ifnull (line 4) | pub struct Ifnull;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iinc.rs
  type Iinc (line 4) | pub struct Iinc {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/iload.rs
  type Iload (line 4) | pub struct Iload {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/iload_0.rs
  type Iload_0 (line 5) | pub struct Iload_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iload_1.rs
  type Iload_1 (line 5) | pub struct Iload_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iload_2.rs
  type Iload_2 (line 5) | pub struct Iload_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iload_3.rs
  type Iload_3 (line 5) | pub struct Iload_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/imul.rs
  type Imul (line 4) | pub struct Imul;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ineg.rs
  type Ineg (line 4) | pub struct Ineg;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/instanceof.rs
  type Instanceof (line 4) | pub struct Instanceof;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/invokedynamic.rs
  type Invokedynamic (line 4) | pub struct Invokedynamic;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/invokeinterface.rs
  type Invokeinterface (line 4) | pub struct Invokeinterface;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/invokespecial.rs
  type Invokespecial (line 4) | pub struct Invokespecial;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/invokestatic.rs
  type Invokestatic (line 4) | pub struct Invokestatic;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/invokevirtual.rs
  type Invokevirtual (line 4) | pub struct Invokevirtual;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ior.rs
  type Ior (line 4) | pub struct Ior;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/irem.rs
  type Irem (line 4) | pub struct Irem;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ireturn.rs
  type Ireturn (line 4) | pub struct Ireturn;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ishl.rs
  type Ishl (line 4) | pub struct Ishl;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ishr.rs
  type Ishr (line 4) | pub struct Ishr;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/istore.rs
  type Istore (line 4) | pub struct Istore {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/istore_0.rs
  type Istore_0 (line 5) | pub struct Istore_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/istore_1.rs
  type Istore_1 (line 5) | pub struct Istore_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/istore_2.rs
  type Istore_2 (line 5) | pub struct Istore_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/istore_3.rs
  type Istore_3 (line 5) | pub struct Istore_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/isub.rs
  type Isub (line 4) | pub struct Isub;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/iushr.rs
  type Iushr (line 4) | pub struct Iushr;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ixor.rs
  type Ixor (line 4) | pub struct Ixor;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/jsr.rs
  type Jsr (line 4) | pub struct Jsr;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/jsr_w.rs
  type Jsr_W (line 5) | pub struct Jsr_W;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/l2d.rs
  type L2D (line 4) | pub struct L2D;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/l2f.rs
  type L2F (line 4) | pub struct L2F;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/l2i.rs
  type L2I (line 4) | pub struct L2I;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ladd.rs
  type Ladd (line 4) | pub struct Ladd;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/laload.rs
  type Laload (line 4) | pub struct Laload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/land.rs
  type Land (line 4) | pub struct Land;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lastore.rs
  type Lastore (line 4) | pub struct Lastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lcmp.rs
  type Lcmp (line 4) | pub struct Lcmp;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lconst_0.rs
  type Lconst_0 (line 5) | pub struct Lconst_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lconst_1.rs
  type Lconst_1 (line 5) | pub struct Lconst_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ldc.rs
  type Ldc (line 4) | pub struct Ldc;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ldc2_w.rs
  type Ldc2_W (line 5) | pub struct Ldc2_W;
  method run (line 8) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ldc_w.rs
  type Ldc_W (line 5) | pub struct Ldc_W;
  method run (line 8) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ldiv.rs
  type Ldiv (line 4) | pub struct Ldiv;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lload.rs
  type Lload (line 4) | pub struct Lload {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/lload_0.rs
  type Lload_0 (line 5) | pub struct Lload_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lload_1.rs
  type Lload_1 (line 5) | pub struct Lload_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lload_2.rs
  type Lload_2 (line 5) | pub struct Lload_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lload_3.rs
  type Lload_3 (line 5) | pub struct Lload_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lmul.rs
  type Lmul (line 4) | pub struct Lmul;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lneg.rs
  type Lneg (line 4) | pub struct Lneg;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lookupswitch.rs
  type Lookupswitch (line 4) | pub struct Lookupswitch;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lor.rs
  type Lor (line 4) | pub struct Lor;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lrem.rs
  type Lrem (line 4) | pub struct Lrem;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lreturn.rs
  type Lreturn (line 4) | pub struct Lreturn;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lshl.rs
  type Lshl (line 4) | pub struct Lshl;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lshr.rs
  type Lshr (line 4) | pub struct Lshr;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lstore.rs
  type Lstore (line 4) | pub struct Lstore {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/lstore_0.rs
  type Lstore_0 (line 5) | pub struct Lstore_0;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lstore_1.rs
  type Lstore_1 (line 5) | pub struct Lstore_1;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lstore_2.rs
  type Lstore_2 (line 5) | pub struct Lstore_2;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lstore_3.rs
  type Lstore_3 (line 5) | pub struct Lstore_3;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lsub.rs
  type Lsub (line 4) | pub struct Lsub;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lushr.rs
  type Lushr (line 4) | pub struct Lushr;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/lxor.rs
  type Lxor (line 4) | pub struct Lxor;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/mod.rs
  type InstructionInfo (line 411) | pub struct InstructionInfo {
    method assemble (line 419) | pub fn assemble(&self, codes: &[u8], cp: &ConstantPool) -> String {
    method comment (line 504) | fn comment(&self, cp: &ConstantPool) -> String {
  function construct_usize (line 614) | fn construct_usize(codes: &[u8], pc: usize) -> usize {
  function construct_i16 (line 620) | fn construct_i16(codes: &[u8], pc: usize) -> i16 {
  type Instruction (line 626) | pub trait Instruction {
    method run (line 627) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize);
    method calc_cp_index_u16 (line 628) | fn calc_cp_index_u16(&self, codes: &[u8], pc: usize) -> usize {
    method set_wide (line 631) | fn set_wide(&mut self, _wide: bool) {
  function get_instructions (line 636) | pub fn get_instructions() -> Vec<Box<dyn Instruction>> {

FILE: tools/javap/src/trans/instruction/monitorenter.rs
  type Monitorenter (line 4) | pub struct Monitorenter;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/monitorexit.rs
  type Monitorexit (line 4) | pub struct Monitorexit;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/multianewarray.rs
  type Multianewarray (line 4) | pub struct Multianewarray;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/new.rs
  type New (line 4) | pub struct New;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/newarray.rs
  type Newarray (line 4) | pub struct Newarray;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/nop.rs
  type Nop (line 4) | pub struct Nop;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/pop.rs
  type Pop (line 4) | pub struct Pop;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/pop2.rs
  type Pop2 (line 4) | pub struct Pop2;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/putfield.rs
  type Putfield (line 4) | pub struct Putfield;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/putstatic.rs
  type Putstatic (line 4) | pub struct Putstatic;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/ret.rs
  type Ret (line 4) | pub struct Ret {
  method run (line 9) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {
  method set_wide (line 25) | fn set_wide(&mut self, wide: bool) {

FILE: tools/javap/src/trans/instruction/return_void.rs
  type Return_Void (line 5) | pub struct Return_Void;
  method run (line 8) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/saload.rs
  type Saload (line 4) | pub struct Saload;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/sastore.rs
  type Sastore (line 4) | pub struct Sastore;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/sipush.rs
  type Sipush (line 4) | pub struct Sipush;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/swap.rs
  type Swap (line 4) | pub struct Swap;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/tableswitch.rs
  type Tableswitch (line 4) | pub struct Tableswitch;
  method run (line 7) | fn run(&self, codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/instruction/wide.rs
  type Wide (line 4) | pub struct Wide;
  method run (line 7) | fn run(&self, _codes: &[u8], pc: usize) -> (InstructionInfo, usize) {

FILE: tools/javap/src/trans/method.rs
  type MethodTranslation (line 12) | pub struct MethodTranslation {
  type StackMapTableTranslation (line 26) | pub struct StackMapTableTranslation {
  type Translator (line 32) | pub struct Translator<'a> {
  function new (line 38) | pub fn new(cf: &'a ClassFile, method: &'a MethodInfo) -> Self {
  function get (line 44) | pub fn get(&self, with_line_num: bool, with_code: bool) -> MethodTransla...
  function build_desc (line 92) | fn build_desc(&self) -> String {
  function access_flags (line 152) | fn access_flags(&self) -> String {
  function return_type (line 158) | fn return_type(&self) -> String {
  function args (line 198) | fn args(&self) -> Vec<String> {
  function code (line 203) | fn code(&self) -> CodeSerde {
  function throws (line 228) | fn throws(&self) -> Option<String> {
  function ex_table (line 242) | fn ex_table(&self) -> Vec<String> {
  function stack_map_table (line 272) | fn stack_map_table(&self) -> Vec<StackMapTableTranslation> {
  function local_variable_table (line 377) | fn local_variable_table(&self) -> Vec<String> {
  function local_variable_type_table (line 384) | fn local_variable_type_table(&self) -> Vec<String> {
  function build_verification_type_infos (line 393) | fn build_verification_type_infos(&self, locals: &Vec<VerificationTypeInf...
  function build_variable_table (line 439) | fn build_variable_table(&self, local_vars: &Vec<LocalVariable>) -> Vec<S...
  function attr_signature (line 469) | fn attr_signature(&self) -> Option<(usize, BytesRef)> {
  function descriptor (line 484) | fn descriptor(&self) -> BytesRef {
  function method_signature (line 488) | fn method_signature(&self) -> MethodSignature {

FILE: tools/javap/src/trans/mod.rs
  function class_source_file (line 23) | pub fn class_source_file(cf: &ClassFile) -> String {
  function class_this_class (line 28) | pub fn class_this_class(cf: &ClassFile) -> String {
  function class_super_class (line 33) | pub fn class_super_class(cf: &ClassFile) -> String {
  function class_access_flags (line 38) | pub fn class_access_flags(cf: &ClassFile) -> String {
  function class_access_flags_name (line 43) | pub fn class_access_flags_name(cf: &ClassFile) -> String {
  function class_signature_raw (line 48) | pub fn class_signature_raw(cf: &ClassFile) -> Option<String> {
  function class_signature (line 53) | pub fn class_signature(cf: &ClassFile) -> Option<Vec<SignatureType>> {
  function class_fields (line 58) | pub fn class_fields(cf: &ClassFile, flags: u16) -> Vec<FieldTranslation> {
  function class_methods (line 63) | pub fn class_methods(
  function class_parent_interfaces (line 73) | pub fn class_parent_interfaces(cf: &ClassFile) -> Vec<String> {
  function class_constant_pool (line 78) | pub fn class_constant_pool(cf: &ClassFile) -> Vec<String> {
  function class_inner_classes (line 83) | pub fn class_inner_classes(cf: &ClassFile) -> Vec<String> {

FILE: tools/javap/src/trans/signature_type.rs
  type Translator (line 3) | pub trait Translator {
    method into_string (line 4) | fn into_string(&self) -> String;
    method into_string (line 8) | fn into_string(&self) -> String {
  function to_java_style (line 42) | fn to_java_style(desc: &[u8]) -> String {
  function t_parse (line 79) | fn t_parse() {

FILE: tools/javap/src/util/mod.rs
  constant JAR_FILE_PREFIX (line 5) | pub const JAR_FILE_PREFIX: &str = "jar:file:";

FILE: tools/javap/src/util/sys.rs
  constant FILE_SEP (line 6) | pub const FILE_SEP: &str = platform::FILE_SEP;
  constant PATH_SEP (line 7) | pub const PATH_SEP: &str = platform::PATH_SEP;
  constant LINE_SEP (line 8) | pub const LINE_SEP: &str = "\n";
  constant LAST_MODIFIED_FORMAT (line 9) | const LAST_MODIFIED_FORMAT: &str = "%b %-d, %Y";
  constant FILE_SEP (line 13) | pub const FILE_SEP: &str = "/";
  constant PATH_SEP (line 14) | pub const PATH_SEP: &str = ":";
  constant FILE_SEP (line 19) | pub const FILE_SEP: &str = "\\";
  constant PATH_SEP (line 20) | pub const PATH_SEP: &str = ";";
  function to_abs_path (line 23) | pub fn to_abs_path(src: &str) -> String {
  function md5_checksum (line 31) | pub fn md5_checksum(data: &[u8]) -> String {
  function format_time1 (line 36) | pub fn format_time1(t: SystemTime) -> String {
  function format_time2 (line 46) | pub fn format_time2(sec: i64) -> String {

FILE: tools/javap/test/AbstractGraphicObject.java
  class AbstractGraphicObject (line 1) | abstract class AbstractGraphicObject {
    method draw (line 4) | abstract void draw();

FILE: tools/javap/test/EnumMobile.java
  type EnumMobile (line 4) | public enum EnumMobile {
    method EnumMobile (line 8) | EnumMobile(int p) {
    method showPrice (line 11) | int showPrice() {

FILE: tools/javap/test/Football.java
  type Football (line 1) | public interface Football extends Sports {
    method homeTeamScored (line 2) | public void homeTeamScored(int points);
    method visitingTeamScored (line 3) | public void visitingTeamScored(int points);
    method endOfQuarter (line 4) | public void endOfQuarter(int quarter);

FILE: tools/javap/test/HelloWorld.java
  class HelloWorld (line 1) | public final class HelloWorld
    method HelloWorld (line 11) | public HelloWorld() {
    method main (line 15) | public static void main(String[] args)
    method private_method (line 31) | private void private_method() {
    method protected_method (line 35) | protected void protected_method() {
    method package_method (line 39) | void package_method() {
    method public_method (line 43) | public void public_method() {

FILE: tools/javap/test/Hockey.java
  type Hockey (line 1) | public interface Hockey extends Sports {
    method homeGoalScored (line 2) | public void homeGoalScored();
    method visitingGoalScored (line 3) | public void visitingGoalScored();
    method endOfPeriod (line 4) | public void endOfPeriod(int period);
    method overtimePeriod (line 5) | public void overtimePeriod(int ot);

FILE: tools/javap/test/Interface1.java
  type Interface1 (line 3) | public interface Interface1 {
    method print (line 7) | void print(byte[] b1, Object o1);
    method get_is (line 8) | InputStream get_is();
    method get_ary1 (line 9) | Object[][] get_ary1();
    method get_ary2 (line 10) | int[][] get_ary2();

FILE: tools/javap/test/Sports.java
  type Sports (line 1) | public interface Sports {
    method setHomeTeam (line 2) | public void setHomeTeam(String name);
    method setVisitingTeam (line 3) | public void setVisitingTeam(String name);

FILE: tools/misc/instruction.py
  function create_get_instructions (line 213) | def create_get_instructions(ary):
  function create_uses (line 225) | def create_uses(ary):
  function create_mod (line 235) | def create_mod(instruction):
Condensed preview — 349 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (783K chars).
[
  {
    "path": ".gitignore",
    "chars": 33,
    "preview": "/target\n**/*.rs.bk\n*.class\n.idea\n"
  },
  {
    "path": "Cargo.toml",
    "chars": 247,
    "preview": "[workspace]\nmembers = [\n  \"jvm\",\n  \"libjvm\",\n  \"crates/classfile\",\n  \"crates/class-parser\",\n  \"crates/vm\",\n  \"tools/java"
  },
  {
    "path": "LICENSE",
    "chars": 1088,
    "preview": "MIT License\n\nCopyright (c) 2021 douchuan and other contributors\n\nPermission is hereby granted, free of charge, to any pe"
  },
  {
    "path": "README.md",
    "chars": 1319,
    "preview": "Have a great goal is a very important thing, such as Moon Landing.\nWhat is the meaning of this plan? \nThat's the process"
  },
  {
    "path": "crates/class-parser/Cargo.toml",
    "chars": 296,
    "preview": "[package]\nname = \"class-parser\"\nversion = \"0.1.0\"\nauthors = [\"Dou Chuan <1843657913@qq.com>\"]\nedition = \"2018\"\n\n# See mo"
  },
  {
    "path": "crates/class-parser/README.md",
    "chars": 164,
    "preview": "## JVM class parser\nThis is the `class-parser` crate, which contains parser\nof `.class`. \n\nThe binary format parser base"
  },
  {
    "path": "crates/class-parser/src/class.rs",
    "chars": 25937,
    "preview": "use classfile::{\n    attributes::{self, Tag as AttrTag, TargetInfo, TypeAnnotation},\n    constant_pool, AttributeType, C"
  },
  {
    "path": "crates/class-parser/src/lib.rs",
    "chars": 154,
    "preview": "#![allow(unused)]\n\nmod class;\nmod signature;\n\npub use class::parse as parse_class;\npub use signature::{ClassSignature, F"
  },
  {
    "path": "crates/class-parser/src/signature.rs",
    "chars": 21159,
    "preview": "use classfile::BytesRef;\nuse classfile::SignatureType as Type;\n\nuse nom::bytes::complete::{take, take_till};\nuse nom::ch"
  },
  {
    "path": "crates/class-verification/Cargo.toml",
    "chars": 231,
    "preview": "[package]\nname = \"class-verification\"\nversion = \"0.1.0\"\nauthors = [\"Dou Chuan <1843657913@qq.com>\"]\nedition = \"2018\"\n\n# "
  },
  {
    "path": "crates/class-verification/src/checker.rs",
    "chars": 885,
    "preview": "use crate::types::ConstantPool;\n\n#[derive(Debug, Clone, Copy, PartialEq)]\npub enum Err {\n    InvalidCpClassNameIdx,\n    "
  },
  {
    "path": "crates/class-verification/src/lib.rs",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "crates/classfile/Cargo.toml",
    "chars": 365,
    "preview": "[package]\nname = \"classfile\"\nversion = \"0.1.0\"\nauthors = [\"Dou Chuan <1843657913@qq.com>\"]\nedition = \"2018\"\nlicense = \"M"
  },
  {
    "path": "crates/classfile/README.md",
    "chars": 159,
    "preview": "## JVM class file\nThis is the `classfile` crate, which contains definition of\nclass file format of Java Virtual Machine."
  },
  {
    "path": "crates/classfile/src/attributes.rs",
    "chars": 9672,
    "preview": "use crate::{BytesRef, U1, U2, U4};\nuse std::sync::Arc;\n\n#[derive(Debug, Clone)]\npub enum Type {\n    ConstantValue {\n    "
  },
  {
    "path": "crates/classfile/src/classfile.rs",
    "chars": 965,
    "preview": "use crate::attributes::InnerClass;\nuse crate::{attributes::Type, field_info::FieldInfo, method_info::MethodInfo, version"
  },
  {
    "path": "crates/classfile/src/constant_pool.rs",
    "chars": 6534,
    "preview": "use crate::consts::{\n    CONSTANT_INTERFACE_METHOD_REF_TAG, CONSTANT_METHOD_REF_TAG, METHOD_NAME_CLINIT,\n    METHOD_NAME"
  },
  {
    "path": "crates/classfile/src/consts.rs",
    "chars": 2286,
    "preview": "use crate::U4;\n\npub const MAGIC: U4 = 0xCAFEBABE;\n\npub const METHOD_NAME_INIT: &[u8] = b\"<init>\";\npub const METHOD_NAME_"
  },
  {
    "path": "crates/classfile/src/field_info.rs",
    "chars": 184,
    "preview": "use crate::attributes::Type;\nuse crate::U2;\n\n#[derive(Debug)]\npub struct FieldInfo {\n    pub acc_flags: U2,\n    pub name"
  },
  {
    "path": "crates/classfile/src/flags.rs",
    "chars": 746,
    "preview": "use crate::U2;\n\nmacro_rules! def_acc {\n    ($name:ident, $v:expr) => {\n        pub const $name: U2 = $v;\n    };\n}\n\ndef_a"
  },
  {
    "path": "crates/classfile/src/lib.rs",
    "chars": 904,
    "preview": "#![allow(unused)]\n\n//! Provides types for working with class file.\n//!\n//! The `classfile` crate provides types for desc"
  },
  {
    "path": "crates/classfile/src/method_info.rs",
    "chars": 2641,
    "preview": "use crate::attributes::{Code, CodeException, LineNumber, LocalVariable, StackMapFrame, Type};\nuse crate::constant_pool;\n"
  },
  {
    "path": "crates/classfile/src/opcode.rs",
    "chars": 32911,
    "preview": "#![allow(non_camel_case_types)]\n\n#[repr(u8)]\n#[derive(Debug, PartialEq, Eq, Copy, Clone)]\npub enum OpCode {\n    //Consta"
  },
  {
    "path": "crates/classfile/src/signature.rs",
    "chars": 1516,
    "preview": "use crate::BytesRef;\nuse std::fmt::Formatter;\n\n#[derive(Clone, PartialEq)]\npub enum Type {\n    Byte,\n    Char,\n    Doubl"
  },
  {
    "path": "crates/classfile/src/version.rs",
    "chars": 94,
    "preview": "use crate::U2;\n\n#[derive(Debug)]\npub struct Version {\n    pub minor: U2,\n    pub major: U2,\n}\n"
  },
  {
    "path": "crates/vm/Cargo.toml",
    "chars": 461,
    "preview": "[package]\nname = \"vm\"\nversion = \"0.1.0\"\nauthors = [\"Dou Chuan <1843657913@qq.com>\"]\nedition = \"2018\"\n\n# See more keys an"
  },
  {
    "path": "crates/vm/README.md",
    "chars": 151,
    "preview": "## Java Virtual Machine\nThis is the `vm` crate, which contains implementation of Java Virtual Machine.\nThe implementatio"
  },
  {
    "path": "crates/vm/src/lib.rs",
    "chars": 371,
    "preview": "#[macro_use]\nextern crate lazy_static;\n#[macro_use]\nextern crate log;\n\n//contains macros, must be here\n#[macro_use]\npub "
  },
  {
    "path": "crates/vm/src/native/common/check_format.rs",
    "chars": 134,
    "preview": "// pub fn is_valid_class_name(s: &String) -> bool {\n//     if s.contains(\"/\") {\n//         return false;\n//     }\n//\n// "
  },
  {
    "path": "crates/vm/src/native/common/mod.rs",
    "chars": 35,
    "preview": "mod check_format;\npub mod reflect;\n"
  },
  {
    "path": "crates/vm/src/native/common/reflect.rs",
    "chars": 9765,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::java_lang_Class;\nuse crate::oop::{self, Class, Oop, OopPtr};\nuse crate::ru"
  },
  {
    "path": "crates/vm/src/native/java_io_FileDescriptor.rs",
    "chars": 303,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/java_io_FileInputStream.rs",
    "chars": 5054,
    "preview": "#![allow(non_snake_case)]\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{Class, Oop, "
  },
  {
    "path": "crates/vm/src/native/java_io_FileOutputStream.rs",
    "chars": 3254,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{Class, Oop,"
  },
  {
    "path": "crates/vm/src/native/java_io_UnixFileSystem.rs",
    "chars": 3693,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{Class, Oop,"
  },
  {
    "path": "crates/vm/src/native/java_lang_Class.rs",
    "chars": 28932,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{common, new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{sel"
  },
  {
    "path": "crates/vm/src/native/java_lang_ClassLoader.rs",
    "chars": 1730,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Oop, "
  },
  {
    "path": "crates/vm/src/native/java_lang_Double.rs",
    "chars": 836,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/java_lang_Float.rs",
    "chars": 505,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/java_lang_Object.rs",
    "chars": 2203,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Oop};"
  },
  {
    "path": "crates/vm/src/native/java_lang_Runtime.rs",
    "chars": 544,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/java_lang_String.rs",
    "chars": 392,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/java_lang_System.rs",
    "chars": 13811,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{self, new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self,"
  },
  {
    "path": "crates/vm/src/native/java_lang_Thread.rs",
    "chars": 3677,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::new_br;\nuse crate"
  },
  {
    "path": "crates/vm/src/native/java_lang_Throwable.rs",
    "chars": 6018,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Class"
  },
  {
    "path": "crates/vm/src/native/java_lang_reflect_Array.rs",
    "chars": 2678,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Oop, "
  },
  {
    "path": "crates/vm/src/native/java_lang_reflect_Proxy.rs",
    "chars": 1814,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native;\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate"
  },
  {
    "path": "crates/vm/src/native/java_security_AccessController.rs",
    "chars": 2214,
    "preview": "#![allow(non_snake_case)]\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Oop};\n"
  },
  {
    "path": "crates/vm/src/native/java_util_concurrent_atomic_AtomicLong.rs",
    "chars": 338,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/mod.rs",
    "chars": 5613,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::oop::Oop;\nuse crate::types::ClassRef;\nuse rustc_hash::FxHashMap;\nuse std::sync::{A"
  },
  {
    "path": "crates/vm/src/native/sun_misc_Signal.rs",
    "chars": 593,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/sun_misc_URLClassPath.rs",
    "chars": 423,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Oop};"
  },
  {
    "path": "crates/vm/src/native/sun_misc_Unsafe.rs",
    "chars": 15215,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{java_lang_System, new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate:"
  },
  {
    "path": "crates/vm/src/native/sun_misc_VM.rs",
    "chars": 312,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\n\npub fn"
  },
  {
    "path": "crates/vm/src/native/sun_nio_cs_StreamEncoder.rs",
    "chars": 1554,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::new_br;\nuse crate"
  },
  {
    "path": "crates/vm/src/native/sun_reflect_ConstantPool.rs",
    "chars": 1132,
    "preview": "#![allow(non_snake_case)]\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::{self, Oop};\n"
  },
  {
    "path": "crates/vm/src/native/sun_reflect_NativeConstructorAccessorImpl.rs",
    "chars": 1468,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{common, new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;"
  },
  {
    "path": "crates/vm/src/native/sun_reflect_NativeMethodAccessorImpl.rs",
    "chars": 3804,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::new_br;\nuse crate"
  },
  {
    "path": "crates/vm/src/native/sun_reflect_Reflection.rs",
    "chars": 1582,
    "preview": "#![allow(non_snake_case)]\n\nuse crate::native::{self, new_fn, JNIEnv, JNINativeMethod, JNIResult};\nuse crate::oop::Oop;\nu"
  },
  {
    "path": "crates/vm/src/oop/ary.rs",
    "chars": 4571,
    "preview": "use crate::oop::{class, Oop};\nuse crate::types::*;\n\n#[derive(Debug, Clone)]\npub struct ArrayOopDesc {\n    pub class: Cla"
  },
  {
    "path": "crates/vm/src/oop/class.rs",
    "chars": 31573,
    "preview": "use std::fmt::{self, Debug, Error, Formatter};\nuse std::ops::{Deref, DerefMut};\nuse std::sync::atomic::Ordering;\nuse std"
  },
  {
    "path": "crates/vm/src/oop/consts.rs",
    "chars": 636,
    "preview": "use crate::oop::Oop;\nuse std::sync::Arc;\n\nlazy_static! {\n    static ref INT0: Oop = { Oop::new_int(0) };\n    static ref "
  },
  {
    "path": "crates/vm/src/oop/field.rs",
    "chars": 6826,
    "preview": "use crate::oop::{self, consts as oop_consts, Oop, ValueType};\nuse crate::runtime::require_class2;\nuse crate::types::Clas"
  },
  {
    "path": "crates/vm/src/oop/inst.rs",
    "chars": 384,
    "preview": "use crate::oop::{field, Oop};\nuse crate::types::ClassRef;\n\n#[derive(Debug, Clone)]\npub struct InstOopDesc {\n    pub clas"
  },
  {
    "path": "crates/vm/src/oop/mirror.rs",
    "chars": 316,
    "preview": "use crate::oop::{Oop, ValueType};\nuse crate::types::ClassRef;\n\n#[derive(Debug, Clone)]\npub struct MirrorOopDesc {\n    pu"
  },
  {
    "path": "crates/vm/src/oop/mod.rs",
    "chars": 14146,
    "preview": "#![allow(unused)]\n\nuse std::fmt;\nuse std::sync::{Arc, Condvar, Mutex, RwLock};\n\nuse classfile::{BytesRef, ClassFile};\n\nu"
  },
  {
    "path": "crates/vm/src/oop/reference.rs",
    "chars": 2953,
    "preview": "use crate::oop::{ArrayOopDesc, InstOopDesc, MirrorOopDesc, TypeArrayDesc};\nuse crate::runtime::thread::{Condvar, Reentra"
  },
  {
    "path": "crates/vm/src/oop/values.rs",
    "chars": 2445,
    "preview": "use crate::runtime::ClassLoader;\n\n#[derive(Debug, Clone, Copy, PartialOrd, PartialEq)]\npub enum ValueType {\n    BYTE,\n  "
  },
  {
    "path": "crates/vm/src/runtime/class_loader.rs",
    "chars": 7359,
    "preview": "use crate::native;\nuse crate::oop::class::ClassPtr;\nuse crate::oop::{self, Class, ValueType};\nuse crate::runtime::{self,"
  },
  {
    "path": "crates/vm/src/runtime/class_path_manager.rs",
    "chars": 5077,
    "preview": "use crate::util;\nuse std::fs::File;\nuse std::io::{self, BufReader, Cursor, Read, Seek};\nuse std::path::{self, Path};\nuse"
  },
  {
    "path": "crates/vm/src/runtime/cmp.rs",
    "chars": 4766,
    "preview": "use crate::oop;\nuse crate::runtime::require_class3;\nuse crate::types::ClassRef;\nuse classfile::consts as cls_consts;\nuse"
  },
  {
    "path": "crates/vm/src/runtime/constant_pool.rs",
    "chars": 2095,
    "preview": "use std::cell::RefCell;\n\nuse rustc_hash::FxHashMap;\n\nuse classfile::ConstantPool;\n\nuse crate::oop::field;\nuse crate::typ"
  },
  {
    "path": "crates/vm/src/runtime/consts.rs",
    "chars": 104,
    "preview": "pub const THREAD_MAX_STACK_FRAMES: usize = 512;\n// pub const WARN_THREAD_MAX_STACK_FRAMES: usize = 512;\n"
  },
  {
    "path": "crates/vm/src/runtime/dataarea.rs",
    "chars": 1356,
    "preview": "use crate::oop::Oop;\nuse crate::runtime::local::Local;\nuse crate::runtime::stack::Stack;\nuse std::cell::RefCell;\nuse std"
  },
  {
    "path": "crates/vm/src/runtime/exception.rs",
    "chars": 1360,
    "preview": "use crate::oop::{self, Oop};\nuse crate::runtime::{self, require_class3};\nuse crate::types::JavaThreadRef;\nuse crate::{ne"
  },
  {
    "path": "crates/vm/src/runtime/frame.rs",
    "chars": 1796,
    "preview": "use crate::oop;\nuse crate::runtime::DataArea;\nuse crate::types::*;\nuse classfile::{ConstantPool, U1};\nuse std::sync::Arc"
  },
  {
    "path": "crates/vm/src/runtime/init_vm.rs",
    "chars": 7092,
    "preview": "use crate::oop;\nuse crate::oop::{Class, Oop};\nuse crate::runtime::{self, require_class3};\nuse crate::types::JavaThreadRe"
  },
  {
    "path": "crates/vm/src/runtime/interp.rs",
    "chars": 78786,
    "preview": "use crate::oop::{\n    self, consts as oop_consts, field, Class, ClassKind, Oop, OopPtr, TypeArrayDesc, ValueType,\n};\nuse"
  },
  {
    "path": "crates/vm/src/runtime/invoke.rs",
    "chars": 12366,
    "preview": "use crate::native;\nuse crate::native::JNINativeMethodStruct;\nuse crate::oop::{self, Oop, ValueType};\nuse crate::runtime:"
  },
  {
    "path": "crates/vm/src/runtime/local.rs",
    "chars": 1976,
    "preview": "use crate::oop::{Oop, OopPtr};\nuse crate::runtime::Slot;\nuse crate::util;\n\npub struct Local {\n    locals: Vec<Slot>,\n}\n\n"
  },
  {
    "path": "crates/vm/src/runtime/method.rs",
    "chars": 8349,
    "preview": "use crate::native::JNINativeMethod;\nuse crate::oop::{self, ValueType};\nuse crate::runtime::local::Local;\nuse crate::runt"
  },
  {
    "path": "crates/vm/src/runtime/mod.rs",
    "chars": 887,
    "preview": "#![allow(unused)]\n\npub use class_loader::{require_class, require_class2, require_class3, ClassLoader};\npub use class_pat"
  },
  {
    "path": "crates/vm/src/runtime/slot.rs",
    "chars": 253,
    "preview": "use crate::oop::Oop;\n\n#[derive(Debug, Clone)]\npub enum Slot {\n    ConstM1,\n    Const0,\n    Const1,\n    Const2,\n    Const"
  },
  {
    "path": "crates/vm/src/runtime/stack.rs",
    "chars": 6828,
    "preview": "use crate::oop::{consts, Oop};\nuse crate::runtime::Slot;\n\n#[derive(Debug)]\npub struct Stack {\n    inner: Vec<Slot>,\n}\n\ni"
  },
  {
    "path": "crates/vm/src/runtime/sys_dic.rs",
    "chars": 828,
    "preview": "use crate::types::ClassRef;\nuse crate::util;\n\nuse rustc_hash::FxHashMap;\nuse std::sync::{Arc, Mutex};\n\ntype SystemDictio"
  },
  {
    "path": "crates/vm/src/runtime/thread/condvar.rs",
    "chars": 7416,
    "preview": "use crate::runtime::thread::{mutex_raw, ReentrantMutex};\nuse std::cell::UnsafeCell;\nuse std::time::Duration;\n\npub struct"
  },
  {
    "path": "crates/vm/src/runtime/thread/java_thread.rs",
    "chars": 1726,
    "preview": "use crate::oop::{self, consts, Oop};\nuse crate::types::{FrameRef, JavaThreadRef};\nuse std::cell::RefCell;\nuse std::sync:"
  },
  {
    "path": "crates/vm/src/runtime/thread/main.rs",
    "chars": 5558,
    "preview": "use crate::oop::{self, Class, Oop, OopPtr};\nuse crate::runtime::thread::thread_pool;\nuse crate::runtime::{self, init_vm,"
  },
  {
    "path": "crates/vm/src/runtime/thread/mod.rs",
    "chars": 395,
    "preview": "mod condvar;\nmod java_thread;\nmod main;\nmod mutex;\nmod thread_pool;\nmod threads;\n\npub use condvar::Condvar;\npub use java"
  },
  {
    "path": "crates/vm/src/runtime/thread/mutex.rs",
    "chars": 2145,
    "preview": "use std::cell::UnsafeCell;\nuse std::mem;\nuse std::mem::MaybeUninit;\n\n/// # Safety\npub unsafe fn raw(m: &ReentrantMutex) "
  },
  {
    "path": "crates/vm/src/runtime/thread/thread_pool.rs",
    "chars": 2500,
    "preview": "use crate::types::JavaThreadRef;\nuse std::sync::mpsc;\nuse std::sync::{Arc, Condvar, Mutex};\nuse std::thread;\n\npub struct"
  },
  {
    "path": "crates/vm/src/runtime/thread/threads.rs",
    "chars": 2022,
    "preview": "use crate::runtime;\nuse crate::runtime::thread::ThreadPool;\nuse crate::types::JavaThreadRef;\nuse std::borrow::Borrow;\nus"
  },
  {
    "path": "crates/vm/src/runtime/vm.rs",
    "chars": 542,
    "preview": "use crate::runtime::thread::Threads;\nuse std::ptr;\n\nstatic mut VM_GLOBAL: *const u8 = ptr::null();\n\npub fn get_vm() -> &"
  },
  {
    "path": "crates/vm/src/types.rs",
    "chars": 691,
    "preview": "use crate::oop::class::ClassPtr;\nuse crate::oop::field::FieldId;\nuse crate::runtime::method::MethodId;\nuse crate::runtim"
  },
  {
    "path": "crates/vm/src/util/attributes.rs",
    "chars": 2411,
    "preview": "use classfile::{AttributeType, BytesRef};\n\npub fn assemble_annotation(attrs: &[AttributeType]) -> Option<Vec<u8>> {\n    "
  },
  {
    "path": "crates/vm/src/util/consts.rs",
    "chars": 1541,
    "preview": "use crate::new_br;\nuse classfile::BytesRef;\n\nlazy_static! {\n    pub static ref S_INIT: BytesRef = new_br(\"<init>\");\n    "
  },
  {
    "path": "crates/vm/src/util/debug.rs",
    "chars": 876,
    "preview": "#![allow(unused)]\n\nuse crate::runtime::thread::JavaThread;\nuse std::fmt::Write;\nuse std::sync::atomic::Ordering;\n\npub fn"
  },
  {
    "path": "crates/vm/src/util/macros.rs",
    "chars": 787,
    "preview": "#[macro_export]\nmacro_rules! def_sync_ref {\n    ($name:ident, $t:ty) => {\n        pub type $name = std::sync::Arc<std::s"
  },
  {
    "path": "crates/vm/src/util/mod.rs",
    "chars": 330,
    "preview": "#[macro_use]\npub mod macros;\n\npub mod attributes;\nmod consts;\npub mod debug;\npub mod oop;\nmod sys;\n\npub use self::consts"
  },
  {
    "path": "crates/vm/src/util/oop.rs",
    "chars": 1677,
    "preview": "use crate::oop::Oop;\nuse crate::runtime::{self, require_class3};\nuse crate::util;\n\nstatic mut JAVA_LANG_STRING_VALUE_OFF"
  },
  {
    "path": "crates/vm/src/util/sys.rs",
    "chars": 356,
    "preview": "#![allow(unused)]\n\npub const FILE_SEP: &str = platform::FILE_SEP;\npub const PATH_SEP: &str = platform::PATH_SEP;\npub con"
  },
  {
    "path": "jvm/Cargo.toml",
    "chars": 380,
    "preview": "[package]\nname = \"jvm\"\nversion = \"0.2.0\"\nauthors = [\"douchuan <1843657913@qq.com>\"]\nedition = \"2018\"\n\n[dependencies]\ncla"
  },
  {
    "path": "jvm/README.md",
    "chars": 207,
    "preview": "## jvm \n\nThe executable program of jvm.\n\n## Usage\n\nModify the run.sh script according to your environment.\n\nIf you insta"
  },
  {
    "path": "jvm/r.sh",
    "chars": 724,
    "preview": "#########################################\n#modify to according to your env\n#\n#If you installed JDK, but can not find jre"
  },
  {
    "path": "jvm/sample/HelloWorld.java",
    "chars": 119,
    "preview": "class HelloWorld\n{\n    public static void main(String[] args)\n    {\n    \tSystem.out.println(\"Hello, World.\");\n    }\n} \n"
  },
  {
    "path": "jvm/src/main.rs",
    "chars": 602,
    "preview": "extern crate clap;\nextern crate env_logger;\n\nmod options;\n\nuse vm;\nuse vm::runtime::{self, thread::MainThread};\nuse vm::"
  },
  {
    "path": "jvm/src/options.rs",
    "chars": 419,
    "preview": "use clap::Clap;\n\n#[derive(Clap, Debug)]\n#[clap(version)]\npub struct Opt {\n    /// class search path of directories and z"
  },
  {
    "path": "jvm/t.sh",
    "chars": 5850,
    "preview": "\n#########################################\n###modify to according to your env\nJAVA_HOME=/Library/Java/JavaVirtualMachine"
  },
  {
    "path": "libjvm/Cargo.toml",
    "chars": 423,
    "preview": "[package]\nname = \"libjvm\"\nversion = \"0.1.0\"\nauthors = [\"Лач <iam@lach.pw>\"]\nedition = \"2018\"\n\n# See more keys and their "
  },
  {
    "path": "libjvm/README.md",
    "chars": 125,
    "preview": "## jvm\n\nDrop-in implementation of libjvm.so/jvm.dll\n\n## Usage\n\nCompile and copy to `openjdk root/lib/amd64/server/libjvm"
  },
  {
    "path": "libjvm/src/invocation.rs",
    "chars": 17596,
    "preview": "#![allow(non_snake_case)]\n#![allow(unused_imports)]\n\n//https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/i"
  },
  {
    "path": "libjvm/src/lib.rs",
    "chars": 92,
    "preview": "#![feature(c_variadic)]\n\npub mod invocation;\npub mod native;\npub mod private;\npub mod util;\n"
  },
  {
    "path": "libjvm/src/native.rs",
    "chars": 32001,
    "preview": "#![allow(non_snake_case)]\n#![allow(unused_variables)]\n#![allow(unused_imports)]\n\nuse jni_sys::{\n\tjarray, jboolean, jbool"
  },
  {
    "path": "libjvm/src/private.rs",
    "chars": 411,
    "preview": "#![allow(unused_variables)]\n\nuse jni_sys::{jclass, JNIEnv};\n\n/// Used by java launcher as entry point\n#[no_mangle]\npub u"
  },
  {
    "path": "libjvm/src/util.rs",
    "chars": 297,
    "preview": "#![allow(unused_imports)]\n\n/// Conversions between jvm and jni api\nuse jni_sys::{jclass, JNIEnv};\n\npub fn class_ref_to_j"
  },
  {
    "path": "note.txt",
    "chars": 3059,
    "preview": "char\n-----------------------\nChar in Java: 16-bit unsigned integers\nchar in Rust: four bytes in size\n\n\nproblem\n---------"
  },
  {
    "path": "tools/javap/Cargo.toml",
    "chars": 558,
    "preview": "[package]\nname = \"javap\"\nversion = \"0.2.1\"\nauthors = [\"Dou Chuan <1843657913@qq.com>\"]\nedition = \"2018\"\n\n# See more keys"
  },
  {
    "path": "tools/javap/run.sh",
    "chars": 2248,
    "preview": "export RUST_LOG=trace\n#export RUST_LOG=info\n#export RUST_LOG=warn\nexport RUST_BACKTRACE=full\n\n### version\n#cargo run -q "
  },
  {
    "path": "tools/javap/src/cmd/disassemble.rs",
    "chars": 12253,
    "preview": "use crate::cmd::Cmd;\nuse crate::misc::SysInfo;\nuse crate::sd::{\n    ClassInfoSerde, ClassVersionSerde, FieldInfoSerde, L"
  },
  {
    "path": "tools/javap/src/cmd/mod.rs",
    "chars": 172,
    "preview": "use crate::misc::SysInfo;\nuse classfile::ClassFile;\n\nmod disassemble;\n\npub use disassemble::Disassemble;\n\npub trait Cmd "
  },
  {
    "path": "tools/javap/src/main.rs",
    "chars": 4999,
    "preview": "#[macro_use]\nextern crate serde_derive;\n#[macro_use]\nextern crate serde_json;\nextern crate handlebars;\n#[macro_use]\nexte"
  },
  {
    "path": "tools/javap/src/misc/class_path_manager.rs",
    "chars": 5026,
    "preview": "#![allow(unused)]\n\nuse crate::misc::SysInfo;\nuse crate::util;\nuse std::fs::File;\nuse std::io::{self, Read};\nuse std::pat"
  },
  {
    "path": "tools/javap/src/misc/mod.rs",
    "chars": 212,
    "preview": "mod class_path_manager;\nmod sys_info;\n\npub use class_path_manager::add_path as add_cp_path;\npub use class_path_manager::"
  },
  {
    "path": "tools/javap/src/misc/sys_info.rs",
    "chars": 153,
    "preview": "#[derive(Debug, Clone)]\npub struct SysInfo {\n    pub class_file: String,\n    pub last_modified: String,\n    pub size: us"
  },
  {
    "path": "tools/javap/src/sd/mod.rs",
    "chars": 3227,
    "preview": "#[derive(Serialize)]\npub struct ClassInfoSerde {\n    pub sys_info: SysInfoSerde,\n    pub version: ClassVersionSerde,\n   "
  },
  {
    "path": "tools/javap/src/strategy.rs",
    "chars": 717,
    "preview": "use crate::cmd::{Cmd, Disassemble};\nuse crate::misc;\nuse crate::util;\nuse clap::ArgMatches;\n\npub fn choose(m: &ArgMatche"
  },
  {
    "path": "tools/javap/src/template.rs",
    "chars": 3231,
    "preview": "use handlebars::Handlebars;\n\npub const PART_COMPILED_FROM: &str = \"Compiled from \\\"{{source_file}}\\\"\";\npub const PART_SY"
  },
  {
    "path": "tools/javap/src/trans/access_flag.rs",
    "chars": 5914,
    "preview": "use classfile::flags as class_flags;\n\npub struct Translator {\n    flags: AccessFlag,\n}\n\nimpl Translator {\n    pub fn new"
  },
  {
    "path": "tools/javap/src/trans/class_file.rs",
    "chars": 7579,
    "preview": "use super::FieldTranslator;\nuse super::{MethodTranslation, MethodTranslator};\nuse crate::trans::AccessFlagsTranslator;\nu"
  },
  {
    "path": "tools/javap/src/trans/code.rs",
    "chars": 1397,
    "preview": "use super::instruction::{get_instructions, InstructionInfo};\nuse classfile::{attributes::Code, ClassFile, OpCode};\n\npub "
  },
  {
    "path": "tools/javap/src/trans/constant_pool_trans.rs",
    "chars": 8524,
    "preview": "use classfile::constant_pool::{self, Type};\nuse classfile::{ClassFile, ConstantPoolType};\n\npub struct Translator<'a> {\n "
  },
  {
    "path": "tools/javap/src/trans/field.rs",
    "chars": 4879,
    "preview": "use crate::trans::AccessFlagsTranslator;\nuse crate::trans::SignatureTypeTranslator;\nuse class_parser::FieldSignature;\nus"
  },
  {
    "path": "tools/javap/src/trans/instruction/aaload.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aaload;\n\nimpl Instruction for Aaload {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/aastore.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aastore;\n\nimpl Instruction for Aastore {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/aconst_null.rs",
    "chars": 416,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aconst_Nul"
  },
  {
    "path": "tools/javap/src/trans/instruction/aload.rs",
    "chars": 583,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aload {\n    pub wide: bool,\n}\n\nimpl Instru"
  },
  {
    "path": "tools/javap/src/trans/instruction/aload_0.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aload_0;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/aload_1.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aload_1;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/aload_2.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aload_2;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/aload_3.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Aload_3;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/anewarray.rs",
    "chars": 409,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Anewarray;\n\nimpl Instruction for Anewarray"
  },
  {
    "path": "tools/javap/src/trans/instruction/areturn.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Areturn;\n\nimpl Instruction for Areturn {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/arraylength.rs",
    "chars": 384,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Arraylength;\n\nimpl Instruction for Arrayle"
  },
  {
    "path": "tools/javap/src/trans/instruction/astore.rs",
    "chars": 586,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Astore {\n    pub wide: bool,\n}\n\nimpl Instr"
  },
  {
    "path": "tools/javap/src/trans/instruction/astore_0.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Astore_0;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/astore_1.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Astore_1;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/astore_2.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Astore_2;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/astore_3.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Astore_3;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/athrow.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Athrow;\n\nimpl Instruction for Athrow {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/baload.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Baload;\n\nimpl Instruction for Baload {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/bastore.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Bastore;\n\nimpl Instruction for Bastore {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/bipush.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Bipush;\n\nimpl Instruction for Bipush {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/caload.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Caload;\n\nimpl Instruction for Caload {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/castore.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Castore;\n\nimpl Instruction for Castore {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/checkcast.rs",
    "chars": 409,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Checkcast;\n\nimpl Instruction for Checkcast"
  },
  {
    "path": "tools/javap/src/trans/instruction/d2f.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct D2F;\n\nimpl Instruction for D2F {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/d2i.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct D2I;\n\nimpl Instruction for D2I {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/d2l.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct D2L;\n\nimpl Instruction for D2L {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/dadd.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dadd;\n\nimpl Instruction for Dadd {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/daload.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Daload;\n\nimpl Instruction for Daload {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/dastore.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dastore;\n\nimpl Instruction for Dastore {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/dcmpg.rs",
    "chars": 366,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dcmpg;\n\nimpl Instruction for Dcmpg {\n    f"
  },
  {
    "path": "tools/javap/src/trans/instruction/dcmpl.rs",
    "chars": 366,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dcmpl;\n\nimpl Instruction for Dcmpl {\n    f"
  },
  {
    "path": "tools/javap/src/trans/instruction/dconst_0.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dconst_0;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dconst_1.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dconst_1;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/ddiv.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Ddiv;\n\nimpl Instruction for Ddiv {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/dload.rs",
    "chars": 583,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dload {\n    pub wide: bool,\n}\n\nimpl Instru"
  },
  {
    "path": "tools/javap/src/trans/instruction/dload_0.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dload_0;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dload_1.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dload_1;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dload_2.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dload_2;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dload_3.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dload_3;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dmul.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dmul;\n\nimpl Instruction for Dmul {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/dneg.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dneg;\n\nimpl Instruction for Dneg {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/drem.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Drem;\n\nimpl Instruction for Drem {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/dreturn.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dreturn;\n\nimpl Instruction for Dreturn {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/dstore.rs",
    "chars": 586,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dstore {\n    pub wide: bool,\n}\n\nimpl Instr"
  },
  {
    "path": "tools/javap/src/trans/instruction/dstore_0.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dstore_0;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dstore_1.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dstore_1;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dstore_2.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dstore_2;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dstore_3.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dstore_3;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dsub.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dsub;\n\nimpl Instruction for Dsub {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/dup.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dup;\n\nimpl Instruction for Dup {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/dup2.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dup2;\n\nimpl Instruction for Dup2 {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/dup2_x1.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dup2_X1;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dup2_x2.rs",
    "chars": 404,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dup2_X2;\n\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/dup_x1.rs",
    "chars": 401,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dup_X1;\n\ni"
  },
  {
    "path": "tools/javap/src/trans/instruction/dup_x2.rs",
    "chars": 401,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Dup_X2;\n\ni"
  },
  {
    "path": "tools/javap/src/trans/instruction/f2d.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct F2D;\n\nimpl Instruction for F2D {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/f2i.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct F2I;\n\nimpl Instruction for F2I {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/f2l.rs",
    "chars": 360,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct F2L;\n\nimpl Instruction for F2L {\n    fn ru"
  },
  {
    "path": "tools/javap/src/trans/instruction/fadd.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fadd;\n\nimpl Instruction for Fadd {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/faload.rs",
    "chars": 369,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Faload;\n\nimpl Instruction for Faload {\n   "
  },
  {
    "path": "tools/javap/src/trans/instruction/fastore.rs",
    "chars": 372,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fastore;\n\nimpl Instruction for Fastore {\n "
  },
  {
    "path": "tools/javap/src/trans/instruction/fcmpg.rs",
    "chars": 366,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fcmpg;\n\nimpl Instruction for Fcmpg {\n    f"
  },
  {
    "path": "tools/javap/src/trans/instruction/fcmpl.rs",
    "chars": 366,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fcmpl;\n\nimpl Instruction for Fcmpl {\n    f"
  },
  {
    "path": "tools/javap/src/trans/instruction/fconst_0.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fconst_0;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/fconst_1.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fconst_1;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/fconst_2.rs",
    "chars": 407,
    "preview": "#![allow(non_camel_case_types)]\nuse super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fconst_2;\n"
  },
  {
    "path": "tools/javap/src/trans/instruction/fdiv.rs",
    "chars": 363,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fdiv;\n\nimpl Instruction for Fdiv {\n    fn "
  },
  {
    "path": "tools/javap/src/trans/instruction/fload.rs",
    "chars": 583,
    "preview": "use super::{Instruction, InstructionInfo};\nuse classfile::OpCode;\n\npub struct Fload {\n    pub wide: bool,\n}\n\nimpl Instru"
  }
]

// ... and 149 more files (download for full content)

About this extraction

This page contains the full source code of the douchuan/jvm GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 349 files (710.7 KB), approximately 196.7k tokens, and a symbol index with 1780 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!