コード例 #1
0
ファイル: Perfmon.cpp プロジェクト: wxthss82/fr_public
sArray<sPerfMonBase::Record> *sPerfMonGpu::GetLastFrame(uint64 &freq)
{
    while(PendingFrames.GetCount()>0)
    {
        Frame *f = PendingFrames[0];
        if(CheckFrame(f))
        {
            PendingFrames.RemAtOrder(0);
            if(sPerfMonEnable)
            {
                FreeFrames.Add(MostRecentFrame);
                MostRecentFrame = f;
            }
            else
            {
                FreeFrames.Add(f);
            }
        }
        else
        {
            break;
        }
    }

    freq = MostRecentFrame->Frequency;
    return &MostRecentFrame->Data;
}
コード例 #2
0
void RegionExclude::testTwoRegions(BRegion *testRegionA, BRegion *testRegionB)
{
	BRegion tempRegion1(*testRegionA);
	CheckFrame(&tempRegion1);
	assert(RegionsAreEqual(&tempRegion1, testRegionA));
	
	tempRegion1.Exclude(testRegionB);
	CheckFrame(&tempRegion1);
	CheckExclude(&tempRegion1, testRegionA, testRegionB);
	
	tempRegion1 = *testRegionA;
	CheckFrame(&tempRegion1);
	assert(RegionsAreEqual(&tempRegion1, testRegionA));
	
	for(int i = 0; i < testRegionB->CountRects(); i++) {
		tempRegion1.Exclude(testRegionB->RectAt(i));
		CheckFrame(&tempRegion1);
	}
	CheckExclude(&tempRegion1, testRegionA, testRegionB);
}
コード例 #3
0
ファイル: checker.cpp プロジェクト: wh5a/xgill
// check a frame without any propagation. in this case the frame will be
// connected any existing caller until there is no existing caller, at which
// point a delayed heap propagation will be used if available.
bool CheckFrameSingle(CheckerState *state, CheckerFrame *frame, PPoint point)
{
  if (!TestErrorSatisfiable(state, frame, NULL))
    return false;

  state->PushContext();

  // push an empty propagation onto the stack for use in later display.
  CheckerPropagate propagate(frame, point, false);
  state->m_stack.PushBack(&propagate);

  if (CheckFrame(state, frame, NULL))
    return true;

  state->m_stack.PopBack();

  state->PopContext();
  return false;
}
コード例 #4
0
ファイル: RegionTestcase.cpp プロジェクト: mariuz/haiku
void RegionTestcase::PerformTest(void)
{
	int numItems = listOfRegions.CountItems();
	
	for(int i = 0; i < numItems; i++) {
		BRegion *testRegion = static_cast<BRegion *>(listOfRegions.ItemAt(i));
		
		CheckFrame(testRegion);
		testOneRegion(testRegion);
	}
	for(int i = 0; i < numItems; i++) {
		BRegion *testRegionA = static_cast<BRegion *>(listOfRegions.ItemAt(i));
		
		for(int j = 0; j < numItems; j++) {
			BRegion *testRegionB = static_cast<BRegion *>(listOfRegions.ItemAt(j));
			
			testTwoRegions(testRegionA, testRegionB);
		}
	}
}
コード例 #5
0
ファイル: checker.cpp プロジェクト: wh5a/xgill
// check propagation for each point bit in the specified frame. this is called
// both for the initial and intermediate checks of the assertion. assert_safe
// indicates that this is an initial check or an intermediate check of a heap
// invariant, and should be marked as a base bit/frame in the state.
bool CheckFrameList(CheckerState *state, CheckerFrame *frame,
                    PPoint point, bool allow_point, bool assert_safe,
                    Bit *base_bit, const GuardBitVector &point_list)
{
  // check if we are ignoring this function outright.
  BlockId *id = frame->CFG()->GetId();
  if (id->Kind() != B_Initializer && IgnoreFunction(id->BaseVar())) {
    if (checker_verbose.IsSpecified())
      logout << "CHECK: " << frame << ": Ignoring function" << endl;
    return false;
  }

  Solver *solver = state->GetSolver();

  if (!solver->IsSatisfiable()) {
    if (checker_verbose.IsSpecified())
      logout << "CHECK: " << frame << ": List unsatisfiable" << endl;
    return false;
  }

  for (size_t ind = 0; ind < point_list.Size(); ind++) {
    const GuardBit &gb = point_list[ind];

    state->PushContext();

    // the guard for the paths this safe bit takes are an extra assumed bit.
    frame->PushAssumedBit(gb.guard);

    // add side conditions and pending information from the bit.
    solver->AddSideConditions(frame->Id(), gb.bit);

    if (assert_safe)
      state->PushBaseBit(gb.bit, frame);

    if (TestErrorSatisfiable(state, frame, gb.bit)) {
      // error is feasible along these paths, construct a propagation
      // for the safe bit and continue exploration.
      CheckerPropagate propagate(frame, point, allow_point);
      propagate.m_id = state->GetPropagateId();

      propagate.FindTest(base_bit, gb.bit);

      state->m_stack.PushBack(&propagate);

      // check the frame against this propagation.
      if (CheckFrame(state, frame, &propagate))
        return true;

      // check if there was a soft timeout while we were finished
      // exploring this path. when the timeout occurs all satisfiable
      // queries become false so we will end up here.
      if (TimerAlarm::ActiveExpired()) {
        logout << "Timeout: ";
        PrintTime(TimerAlarm::ActiveElapsed());
        logout << endl;

        state->SetReport(RK_Timeout);
        return true;
      }

      state->m_stack.PopBack();
    }

    // no error along these paths, unwind the changes we made beforehand.
    if (assert_safe)
      state->PopBaseBit();
    frame->PopAssumedBit();
    state->PopContext();
  }

  return false;
}