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

Side by Side Diff: runtime/lib/profiler.cc

Issue 230863005: Initial UserTag and dart:profiler library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months 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 | « no previous file | runtime/lib/profiler.dart » ('j') | 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) 2014, 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/bootstrap_natives.h"
6
7 #include "include/dart_api.h"
8
9 #include "vm/bigint_operations.h"
10 #include "vm/exceptions.h"
11 #include "vm/native_entry.h"
12 #include "vm/object.h"
13 #include "vm/object_store.h"
14
15 namespace dart {
16
17 // dart:profiler.
18
19 DEFINE_NATIVE_ENTRY(UserTag_new, 2) {
20 ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
21 GET_NON_NULL_NATIVE_ARGUMENT(String, tag_label, arguments->NativeArgAt(1));
22 return UserTag::New(tag_label);
23 }
24
25
26 DEFINE_NATIVE_ENTRY(UserTag_label, 1) {
27 const UserTag& self = UserTag::CheckedHandle(arguments->NativeArgAt(0));
28 return self.label();
29 }
30
31
32 DEFINE_NATIVE_ENTRY(UserTag_makeCurrent, 1) {
33 const UserTag& self = UserTag::CheckedHandle(arguments->NativeArgAt(0));
34 self.MakeActive();
35 return Object::null();
36 }
37
38
39 DEFINE_NATIVE_ENTRY(Profiler_getCurrentTag, 0) {
40 return isolate->current_tag();
41 }
42
43
44 DEFINE_NATIVE_ENTRY(Profiler_clearCurrentTag, 0) {
45 // Use a NoGCScope to avoid creating a handle for the old current.
46 NoGCScope no_gc;
47 RawUserTag* old_current = isolate->current_tag();
48 UserTag::ClearActive();
49 return old_current;
50 }
51
52 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/profiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698