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

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: add vtune.{cc,h} Created 8 years, 1 month 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/vm.gypi ('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 VTune::IsActive() {
15 return (iJIT_IsProfilingActive() == iJIT_SAMPLING_ON);
16 }
17
18
19 void VTune::Register(const char* name, uword base, uword size) {
20 if (!IsActive()) return;
21
22 iJIT_Method_Load jmethod;
23 memset(&jmethod, 0, sizeof(jmethod));
24 jmethod.method_id = iJIT_GetNewMethodID();
25 jmethod.method_name = const_cast<char*>(name);
26 jmethod.method_load_address = reinterpret_cast<void*>(base);
27 jmethod.method_size = size;
28 iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &jmethod);
29 }
30 #else
31 bool VTune::IsActive() {
32 return false;
33 }
34
35
36 void VTune::Register(const char* name, uword base, uword size) {
37 /* Nothing to do */
38 }
39 #endif
40
41
42 } // namespace dart
OLDNEW
« runtime/vm/vm.gypi ('K') | « runtime/vm/vtune.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698