V8 Project
instrument-arm64.h
Go to the documentation of this file.
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_ARM64_INSTRUMENT_ARM64_H_
6 #define V8_ARM64_INSTRUMENT_ARM64_H_
7 
8 #include "src/globals.h"
9 #include "src/utils.h"
10 
13 
14 namespace v8 {
15 namespace internal {
16 
17 const int kCounterNameMaxLength = 256;
18 const uint64_t kDefaultInstrumentationSamplingPeriod = 1 << 22;
19 
20 
24 };
25 
26 
28  Gauge = 0, // Gauge counters reset themselves after reading.
29  Cumulative = 1 // Cumulative counters keep their value after reading.
30 };
31 
32 
33 class Counter {
34  public:
35  explicit Counter(const char* name, CounterType type = Gauge);
36 
37  void Increment();
38  void Enable();
39  void Disable();
40  bool IsEnabled();
41  uint64_t count();
42  const char* name();
43  CounterType type();
44 
45  private:
47  uint64_t count_;
48  bool enabled_;
50 };
51 
52 
53 class Instrument: public DecoderVisitor {
54  public:
55  explicit Instrument(const char* datafile = NULL,
56  uint64_t sample_period = kDefaultInstrumentationSamplingPeriod);
57  ~Instrument();
58 
59  // Declare all Visitor functions.
60  #define DECLARE(A) void Visit##A(Instruction* instr);
62  #undef DECLARE
63 
64  private:
65  void Update();
66  void Enable();
67  void Disable();
68  void DumpCounters();
69  void DumpCounterNames();
70  void DumpEventMarker(unsigned marker);
71  void HandleInstrumentationEvent(unsigned event);
72  Counter* GetCounter(const char* name);
73 
74  void InstrumentLoadStore(Instruction* instr);
75  void InstrumentLoadStorePair(Instruction* instr);
76 
77  std::list<Counter*> counters_;
78 
80  uint64_t sample_period_;
81 };
82 
83 } } // namespace v8::internal
84 
85 #endif // V8_ARM64_INSTRUMENT_ARM64_H_
char name_[kCounterNameMaxLength]
Counter(const char *name, CounterType type=Gauge)
void HandleInstrumentationEvent(unsigned event)
void DumpEventMarker(unsigned marker)
std::list< Counter * > counters_
Counter * GetCounter(const char *name)
Instrument(const char *datafile=NULL, uint64_t sample_period=kDefaultInstrumentationSamplingPeriod)
void InstrumentLoadStore(Instruction *instr)
void InstrumentLoadStorePair(Instruction *instr)
#define VISITOR_LIST(V)
Definition: decoder-arm64.h:19
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DECLARE(A)
const int kCounterNameMaxLength
const uint64_t kDefaultInstrumentationSamplingPeriod
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20