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

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: Address comments 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
« no previous file with comments | « 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 #include <jitprofiling.h>
8
9 #include "platform/assert.h"
10
11 namespace dart {
12
13 bool VTuneCodeObserver::IsActive() const {
14 return (iJIT_IsProfilingActive() == iJIT_SAMPLING_ON);
15 }
16
17
18 void VTuneCodeObserver::Notify(const char* name,
19 uword base,
20 uword prologue_offset,
21 uword size,
22 bool optimized) {
23 ASSERT(IsActive());
24 iJIT_Method_Load jmethod;
25 memset(&jmethod, 0, sizeof(jmethod));
26 jmethod.method_id = iJIT_GetNewMethodID();
27 jmethod.method_name = const_cast<char*>(name);
28 jmethod.method_load_address = reinterpret_cast<void*>(base);
29 jmethod.method_size = size;
30 iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &jmethod);
31 }
32
33 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/vtune.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698