示例#1
0
static LoadStoreInfo lsi_from_proto(const flow_dep::LoadStoreInfo_Proto proto) {
  // get tid
  // get val
  // get is_load
  LoadStoreInfo lsi(proto.val(), proto.tid(), proto.is_load());

  assert(proto.tid() == lsi.get_tid());
  assert(proto.val() == lsi.get_val());
  assert(proto.is_load() == lsi.is_load());

  return lsi;

}
示例#2
0
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

	CefEnableHighDPISupport();

	CefScopedSandboxInfo scoped_sandbox;
	CefMainArgs main_args(hInstance);
	CefRefPtr<NgineSlackApp> app(new NgineSlackApp);
	int exit_code = CefExecuteProcess(main_args, app.get(), scoped_sandbox.sandbox_info());
	if (exit_code >= 0) 
	{
		return exit_code;
	}

	LimitSingleInstance lsi(NGINESLACK);
	if (lsi.IsAnotherInstanceRunning())
	{
		HWND hWnd = FindWindow(NGINESLACK, NULL);
		if( hWnd==NULL )
		{
			MessageBox(NULL, L"Already running. You need to terminate it manually.", NGINESLACK, MB_OK);
		} else {
			ShowWindow(hWnd, SW_SHOW);
			SetForegroundWindow(hWnd);
		}
		return 0;
	}

	_AtlBaseModule.SetResourceInstance(hInstance);
	GdiplusStartupInput gdiplusStartupInput;
	ULONG_PTR gdiplusToken;
	GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

	CefSettings settings;
	CefSetting_SetCachePath(settings);
	settings.persist_session_cookies = TRUE;
	settings.log_severity = LOGSEVERITY_DISABLE;
	settings.ignore_certificate_errors = TRUE;
	CefInitialize(main_args, settings, app.get(), scoped_sandbox.sandbox_info());
	CefRunMessageLoop();
	CefShutdown();

	return 0;
}
示例#3
0
BOOL CWSConfigAssistantApp::InitInstance()
{
    CLimitSingleInstance lsi(SINGLE_INSTANCE_MUTEX_NAME);
    if ( lsi.IsAnotherInstanceRunning() )
    {
        MessageBox(NULL, _T("An instance of Workshare Configuration Assistant is already running. Please close that to run another instance."), _T("Workshare"), MB_OK | MB_ICONWARNING);
        return FALSE;
    }

    if( m_pInstallAgent )
    {
        m_pInstallAgent->Initialize();

        // workaround for imanage f*****g up our current path
        // stores path internally.
        m_pInstallAgent->GetInstallDir();
    }

    // Ensure Windows Message box displayed when can not load Workshare Message component has correct title
    free((void*)m_pszAppName);
    m_pszAppName =_tcsdup(_T("Workshare Configuration Assistant"));

    CStdString sCmdLine(GetCommandLine());
    sCmdLine.MakeLower();

    bool bRunTests(sCmdLine.Find(_T("runtests")) != -1);
    bool bAutoRunTests(sCmdLine.Find(_T("autoruntests")) != -1);
    bool bRunFunctionalTests(sCmdLine.Find(_T("functionaltests")) != -1);

    if(bRunTests)
    {
        m_iRetCode = RunAppTestsEx(bAutoRunTests, bRunFunctionalTests, false, _T(""), false);
        CoFreeUnusedLibraries();
        return FALSE;
    }

    if( m_pInstallAgent && !m_pInstallAgent->WasCommandLineValid())
    {
        AfxMessageBox(m_pInstallAgent->GetCommandLineHelp(),MB_OK);
        return FALSE;
    }

    if(m_pInstallAgent && m_pInstallAgent->IsQuiet())
    {
        if(GetInstallAgent())
            GetInstallAgent()->LogEvent(_T("CWSConfigAssistantApp::OnInitDialog - Quiet Silent version of the application."));

        SafeDeleteSingleItem(m_pInstallAgent);
        m_pInstallAgent = NULL;

        CQuietProgressDlg dlg;
        dlg.DoModal();
        m_iRetCode = dlg.GetResult();
    }
    else if (!IsSilent())
    {
        if(GetInstallAgent())
            GetInstallAgent()->LogEvent(_T("CWSConfigAssistantApp::OnInitDialog - Running UI version of the application."));

        CWSConfigAssistantDlg dlg(_T("Workshare"));
        dlg.SetWizardMode();
        m_pMainWnd = &dlg;

        if( ::IsWindow(dlg.m_hWnd) )
            dlg.SetWindowPos(&CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

        INT_PTR ret = dlg.DoModal();
        if (ret == IDCANCEL)
        {
            m_iRetCode = 1602;
        }
    }
    else
    {
        if(GetInstallAgent())
            GetInstallAgent()->LogEvent(_T("CWSConfigAssistantApp::OnInitDialog - Running Silent version of the application."));

        SafeDeleteSingleItem(m_pInstallAgent);
        m_pInstallAgent = NULL;

        CStdString sResult;
        m_iRetCode = InstallAgent::Run(GetCommandLine(), sResult);
    }

    return FALSE;
}
void LIR_LocalCaching::cache_locals() {
  LoopList* loops = ir()->loops();
  BlockList* all_blocks = ir()->code();
  WordSizeList* local_name_to_offset_map = ir()->local_name_to_offset_map();

  if (loops == NULL) {
    // collect global scan information
    BlockListScanInfo gsi(ir()->code());
    RegisterManager* global_scan_info = gsi.info();

    // just cache registers globally.
    LocalMappingSetter setter(cache_locals_for_blocks(all_blocks, global_scan_info));
    all_blocks->iterate_forward(&setter);
  } else {
    assert(loops->length() != 0, "should be at least one loop");
    int i;

    // collect all the blocks that are outside of the loops
    BlockList* non_loop_blocks = new BlockList;
    for (i = 0; i < all_blocks->length(); i++) {
      BlockBegin* b = all_blocks->at(i);
      if (b->loop_index() == -1 && b->next()->as_CachingChange() == NULL) {
        non_loop_blocks->append(b);
      }
    }

    RegisterManager* global_scan_info = new RegisterManager();

    // scan each of the loops and the remaining blocks recording register usage
    // so we know what registers are free.
    RegisterManagerArray scan_infos(loops->length() + 1);
    for (i = 0; i < loops->length(); i++) {
      Loop* loop = loops->at(i);

      BlockListScanInfo lsi(loop->blocks());
      scan_infos.at_put(i, lsi.info());
      // accumulate the global state
      global_scan_info->merge(lsi.info());
    }

    BlockListScanInfo lsi(non_loop_blocks);
    scan_infos.at_put(loops->length(), lsi.info());
    // accumulate the global state
    global_scan_info->merge(lsi.info());
    
    // use the global mapping as a guide in the rest of the register selection process.
    LocalMapping* global = cache_locals_for_blocks(all_blocks, global_scan_info, true);
    LocalMapping* pref = new LocalMapping(local_name_to_offset_map);
    pref->merge(global);
    pref->merge(_preferred);
    _preferred = pref;

    for (i = 0; i < loops->length(); i++) {
      if (i < LIRCacheLoopStart || (uint)i >= (uint)LIRCacheLoopStop) {
        continue;
      }

      Loop* loop = loops->at(i);

      LocalMapping* mapping = cache_locals_for_blocks(loop->blocks(), scan_infos.at(i));
      LocalMappingSetter setter(mapping);
      loop->blocks()->iterate_forward(&setter);
      _preferred->merge(mapping);
      mapping->join(global);
    }

    LocalMapping* mapping = cache_locals_for_blocks(non_loop_blocks, scan_infos.at(loops->length()));
    mapping->join(global);
    LocalMappingSetter setter(mapping);
    non_loop_blocks->iterate_forward(&setter);
  }
}