OLD | NEW |
---|---|
(Empty) | |
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 #include "vm/vtune.h" | |
6 | |
7 #if defined(DART_VTUNE_SUPPORT) | |
8 # include <jitprofiling.h> | |
9 #endif | |
10 | |
11 namespace dart { | |
12 | |
13 #if defined(DART_VTUNE_SUPPORT) | |
14 bool VTuneCodeObserver::IsActive() const { | |
15 return (iJIT_IsProfilingActive() == iJIT_SAMPLING_ON); | |
16 } | |
17 | |
18 | |
19 void VTuneCodeObserver::Notify(const char* name, | |
20 uword base, | |
21 uword prologue_offset, | |
22 uword size, | |
23 bool optimized) { | |
24 ASSERT(IsActive()); | |
25 iJIT_Method_Load jmethod; | |
26 memset(&jmethod, 0, sizeof(jmethod)); | |
27 jmethod.method_id = iJIT_GetNewMethodID(); | |
28 jmethod.method_name = const_cast<char*>(name); | |
29 jmethod.method_load_address = reinterpret_cast<void*>(base); | |
30 jmethod.method_size = size; | |
31 iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &jmethod); | |
32 } | |
33 #else | |
34 bool VTuneCodeObserver::IsActive() const { | |
Ivan Posva
2012/11/27 09:11:20
Do you even need to supply these UNREACHABLE metho
Vyacheslav Egorov (Google)
2012/11/27 16:26:12
Done.
| |
35 UNREACHABLE(); | |
36 return false; | |
37 } | |
38 | |
39 | |
40 void VTuneCodeObserver::Notify(const char* name, | |
41 uword base, | |
42 uword prologue_offset, | |
43 uword size, | |
44 bool optimized) { | |
45 UNREACHABLE(); | |
46 } | |
47 #endif | |
48 | |
49 | |
50 } // namespace dart | |
OLD | NEW |