<commit_before>
from archinfo.arch_soot import SootAddressTerminator

from ..sim_state import SimState
from .simos import SimOS
from ..engines.soot.values.arrayref import SimSootValue_ArrayRef
from ..engines.soot.values.local import SimSootValue_Local
from archinfo.arch_soot import SootAddressDescriptor, SootMethodDescriptor


class SimJavaVM(SimOS):
    def __init__(self, *args, **kwargs):
        super(SimJavaVM, self).__init__(*args, name='JavaVM', **kwargs)

    def state_blank(self, addr=None, initial_prefix=None, stack_size=None, **kwargs):
        if kwargs.get('mode', None) is None:
            kwargs['mode'] = self.project._default_analysis_mode
        if kwargs.get('arch', None) is None:
            kwargs['arch'] = self.arch
        if kwargs.get('os_name', None) is None:
            kwargs['os_name'] = self.name
        if kwargs.get('project', None) is None:
            kwargs['project'] = self.project


        state = SimState(self.project, **kwargs)

        if addr is None: addr = self.project.entry
        state.regs._ip = addr
        state.regs._ip_binary = self.project.loader.main_object  # FIXME: what if the java binary is not the main object?
        state.regs._invoke_return_target = None
        state.regs._invoke_return_variable = None<commit_msg>Revert "SimJavaVM: pass project object to SimState constructor"<commit_after>
from archinfo.arch_soot import SootAddressTerminator

from ..sim_state import SimState
from .simos import SimOS
from ..engines.soot.values.arrayref import SimSootValue_ArrayRef
from ..engines.soot.values.local import SimSootValue_Local
from archinfo.arch_soot import SootAddressDescriptor, SootMethodDescriptor


class SimJavaVM(SimOS):
    def __init__(self, *args, **kwargs):
        super(SimJavaVM, self).__init__(*args, name='JavaVM', **kwargs)

    def state_blank(self, addr=None, initial_prefix=None, stack_size=None, **kwargs):
        if kwargs.get('mode', None) is None:
            kwargs['mode'] = self.project._default_analysis_mode
        if kwargs.get('arch', None) is None:
            kwargs['arch'] = self.arch
        if kwargs.get('os_name', None) is None:
            kwargs['os_name'] = self.name

        state = SimState(self.project, **kwargs)

        if addr is None: addr = self.project.entry
        state.regs._ip = addr
        state.regs._ip_binary = self.project.loader.main_object  # FIXME: what if the java binary is not the main object?
        state.regs._invoke_return_target = None
        state.regs._invoke_return_variable = None
{'fraction_non_alphanumeric': 0.10455974842767296, 'fraction_numerical': 0.0, 'mean_word_length': 3.4260869565217393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6677059', 'n_tokens_mistral': 759, 'n_tokens_neox': 758, 'n_words': 195}