Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
vm
code_observers.h
Go to the documentation of this file.
1
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#ifndef RUNTIME_VM_CODE_OBSERVERS_H_
6
#define RUNTIME_VM_CODE_OBSERVERS_H_
7
8
#include "
vm/allocation.h
"
9
#include "
vm/globals.h
"
10
11
#include "
include/dart_api.h
"
12
13
#if !defined(PRODUCT)
14
namespace
dart
{
15
16
class
CodeComments;
17
18
// Object observing code creation events. Used by external profilers and
19
// debuggers to map address ranges to function names.
20
class
CodeObserver
{
21
public
:
22
CodeObserver
() {}
23
24
virtual
~CodeObserver
() {}
25
26
// Returns true if this observer is active and should be notified
27
// about newly created code objects.
28
virtual
bool
IsActive
()
const
= 0;
29
30
// Notify code observer about a newly created code object with the
31
// given properties.
32
virtual
void
Notify
(
const
char
*
name
,
33
uword
base
,
34
uword
prologue_offset,
35
uword
size,
36
bool
optimized,
37
const
CodeComments* comments) = 0;
38
39
private
:
40
DISALLOW_COPY_AND_ASSIGN
(
CodeObserver
);
41
};
42
43
class
Mutex
;
44
45
class
CodeObservers
:
public
AllStatic
{
46
public
:
47
static
void
Init
();
48
49
static
void
RegisterExternal
(
Dart_CodeObserver
observer);
50
51
static
void
Register
(
CodeObserver
* observer);
52
53
// Notify all active code observers about a newly created code object.
54
static
void
NotifyAll
(
const
char
*
name
,
55
uword
base
,
56
uword
prologue_offset,
57
uword
size,
58
bool
optimized,
59
const
CodeComments* comments);
60
61
// Returns true if there is at least one active code observer.
62
static
bool
AreActive
();
63
64
static
void
Cleanup
();
65
66
static
Mutex
*
mutex
() {
return
mutex_; }
67
68
private
:
69
static
Mutex
* mutex_;
70
static
intptr_t observers_length_;
71
static
CodeObserver
** observers_;
72
};
73
74
}
// namespace dart
75
#endif
// !defined(PRODUCT)
76
77
#endif
// RUNTIME_VM_CODE_OBSERVERS_H_
dart::AllStatic
Definition
allocation.h:33
dart::CodeObserver
Definition
code_observers.h:20
dart::CodeObserver::~CodeObserver
virtual ~CodeObserver()
Definition
code_observers.h:24
dart::CodeObserver::IsActive
virtual bool IsActive() const =0
dart::CodeObserver::Notify
virtual void Notify(const char *name, uword base, uword prologue_offset, uword size, bool optimized, const CodeComments *comments)=0
dart::CodeObserver::CodeObserver
CodeObserver()
Definition
code_observers.h:22
dart::CodeObservers
Definition
code_observers.h:45
dart::CodeObservers::mutex
static Mutex * mutex()
Definition
code_observers.h:66
dart::CodeObservers::Cleanup
static void Cleanup()
Definition
code_observers.cc:71
dart::CodeObservers::RegisterExternal
static void RegisterExternal(Dart_CodeObserver observer)
Definition
code_observers.cc:38
dart::CodeObservers::NotifyAll
static void NotifyAll(const char *name, uword base, uword prologue_offset, uword size, bool optimized, const CodeComments *comments)
Definition
code_observers.cc:49
dart::CodeObservers::Init
static void Init()
Definition
code_observers.cc:80
dart::CodeObservers::AreActive
static bool AreActive()
Definition
code_observers.cc:64
dart::Mutex
Definition
os_thread.h:40
dart_api.h
base
Definition
ax_tree_id_registry.h:17
dart
Definition
dart_vm.cc:33
dart::name
const char *const name
Definition
method_recognizer.cc:324
dart::uword
uintptr_t uword
Definition
globals.h:501
dart::Register
Register
Definition
constants_arm.h:81
DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
globals.h:581
Dart_CodeObserver
Definition
dart_api.h:859
allocation.h
globals.h
Generated on Fri Apr 26 2024 06:14:47 for Flutter Engine by
1.9.8