Exemplo n.º 1
0
static Method* new_method(
    BytecodeConstantPool* cp, BytecodeBuffer* bytecodes, Symbol* name,
    Symbol* sig, AccessFlags flags, int max_stack, int params,
    ConstMethod::MethodType mt, TRAPS) {

  address code_start = 0;
  int code_length = 0;
  InlineTableSizes sizes;

  if (bytecodes != NULL && bytecodes->length() > 0) {
    code_start = static_cast<address>(bytecodes->adr_at(0));
    code_length = bytecodes->length();
  }

  Method* m = Method::allocate(cp->pool_holder()->class_loader_data(),
                               code_length, flags, &sizes,
                               mt, CHECK_NULL);

  m->set_constants(NULL); // This will get filled in later
  m->set_name_index(cp->utf8(name));
  m->set_signature_index(cp->utf8(sig));
#ifdef CC_INTERP
  ResultTypeFinder rtf(sig);
  m->set_result_index(rtf.type());
#endif
  m->set_size_of_parameters(params);
  m->set_max_stack(max_stack);
  m->set_max_locals(params);
  m->constMethod()->set_stackmap_data(NULL);
  m->set_code(code_start);

  return m;
}
Exemplo n.º 2
0
        void OnButton(wxCommandEvent &event){
        
           
            int id = event.GetId();
            long flags = 0;

            if(id == ID_GRTF){
                wxString rtf = textctrl->GetRTF();
                printf("%s\n\n", rtf.ToAscii());
                output->SetValue(converter.Convert(rtf, encoder));
                input->SetValue(rtf);
            }else if(id == ID_GVAL){
                wxString text = textctrl->GetValue();
                wxTextAttr style;
                textctrl->GetStyle(0, style);
                output->SetValue(converter.Convert(text, encoder, L"plaintext", &style));
                input->SetValue(text);
            }else if(id == ID_SEPR){
                printf("\n========\n\n");
            }else if(id == ID_RSIZ){
#if USEEXPANDO
                textctrl->SetMinHeight(wxGetNumberFromUser(_T("Input Height:"), _T(""),  _T("Set Input Height"), textctrl->GetMinHeight()));
                printf("%d\n", textctrl->GetMinSize().GetHeight());
#endif //USEEXPANDO
            }else if(id == ID_RTFG){
                if(rtfTemp.IsEmpty()){
                    rtfTemp = textctrl->GetRTF();
                    textctrl->Clear();
                }else{
                    textctrl->SetRTF(rtfTemp);
                    rtfTemp.Clear();
                }
            }else if(id == ID_SETV){
                wxString v = wxGetTextFromUser(L"Text?");
                textctrl->SetValue(v);
            }else if(id == ID_LINK){
                wxString rtf(L"{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fswiss\\fcharset0 Comic Sans MS;}{\\f1\\fnil\\fcharset0 MS Shell Dlg 2;}}\r\n{\\colortbl ;\\red255\\green0\\blue255;\\red0\\green255\\blue255;}\r\n{\\*\\generator Msftedit 5.41.21.2509;}\\viewkind4\\uc1\\pard\\cf1\\highlight2\\ul\\b\\i\\f0\\fs44 test 123\\cf0\\highlight0\\ulnone\\b0\\i0\\f1\\fs17\\par\\par I use {\\hl {\\hlloc  http://www.digsby.com/?utm_source=aim&utm_medium=aim&utm_campaign=aimprofilelink } {\\hlfr digsby} }\\par\r\n}");
                //printf("%s\n\n", rtf.ToAscii());
                output->SetValue(converter.Convert(rtf, encoder));
                input->SetValue(rtf);
            }else if(id == ID_NEW){
                CreateTestWindow((ExpandoApp*)wxTheApp, L"Spawn");
            }
            
            textctrl->SetFocus();
        }