tools/profiler/LulDwarfSummariser.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/LulDwarfSummariser.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef LulDwarfSummariser_h
    1.11 +#define LulDwarfSummariser_h
    1.12 +
    1.13 +#include "LulMainInt.h"
    1.14 +
    1.15 +namespace lul {
    1.16 +
    1.17 +class Summariser
    1.18 +{
    1.19 +public:
    1.20 +  Summariser(SecMap* aSecMap, uintptr_t aTextBias, void(*aLog)(const char*));
    1.21 +
    1.22 +  void Entry(uintptr_t aAddress, uintptr_t aLength);
    1.23 +  void End();
    1.24 +  void Rule(uintptr_t aAddress,
    1.25 +            int aNewReg, int aOldReg, intptr_t aOffset, bool aDeref);
    1.26 +
    1.27 +private:
    1.28 +  // The SecMap in which we park the finished summaries (RuleSets).
    1.29 +  SecMap* mSecMap;
    1.30 +
    1.31 +  // Running state for the current summary (RuleSet) under construction.
    1.32 +  RuleSet mCurrRules;
    1.33 +
    1.34 +  // The start of the address range to which the RuleSet under
    1.35 +  // construction applies.
    1.36 +  uintptr_t mCurrAddr;
    1.37 +
    1.38 +  // The highest address, plus one, for which the RuleSet under
    1.39 +  // construction could possibly apply.  If there are no further
    1.40 +  // incoming events then mCurrRules will eventually be emitted
    1.41 +  // as-is, for the range mCurrAddr.. mMax1Addr - 1, if that is
    1.42 +  // nonempty.
    1.43 +  uintptr_t mMax1Addr;
    1.44 +
    1.45 +  // The bias value (to add to the SVMAs, to get AVMAs) to be used
    1.46 +  // when adding entries into mSecMap.
    1.47 +  uintptr_t mTextBias;
    1.48 +
    1.49 +  // A logging sink, for debugging.
    1.50 +  void (*mLog)(const char* aFmt);
    1.51 +};
    1.52 +
    1.53 +} // namespace lul
    1.54 +
    1.55 +#endif // LulDwarfSummariser_h

mercurial