Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: runtime/vm/vtune.cc

Issue 11412106: Support VTune's JIT interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: introduce CodeObserver interface Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« runtime/vm/vtune.h ('K') | « runtime/vm/vtune.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« runtime/vm/vtune.h ('K') | « runtime/vm/vtune.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698