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

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') | runtime/vm/object.h » ('J')
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
14 namespace dart {
15
16 // dart:profiler.
17
18 DEFINE_NATIVE_ENTRY(UserTag_new, 2) {
19 ASSERT(TypeArguments::CheckedHandle(arguments->NativeArgAt(0)).IsNull());
20 GET_NON_NULL_NATIVE_ARGUMENT(String, tag_label, arguments->NativeArgAt(1));
21 if (UserTag::TagTableFull(isolate)) {
22 const String& error = String::Handle(
23 String::NewFormatted("UserTag instance limit (%" Pd ") reached.",
24 UserTagHelper::kMaxUserTags));
25 const Array& args = Array::Handle(Array::New(1));
26 args.SetAt(0, error);
27 Exceptions::ThrowByType(Exceptions::kUnsupported, args);
28 }
29 return UserTag::New(tag_label);
30 }
31
32
33 DEFINE_NATIVE_ENTRY(UserTag_label, 1) {
34 GET_NON_NULL_NATIVE_ARGUMENT(UserTag, self, arguments->NativeArgAt(0));
srdjan 2014/04/09 17:08:18 Use UserTag::CheckedHandle where type is known (e.
Cutch 2014/04/09 20:28:54 Done.
35 return self.label();
36 }
37
38
39 DEFINE_NATIVE_ENTRY(UserTag_makeCurrent, 1) {
40 GET_NON_NULL_NATIVE_ARGUMENT(UserTag, self, arguments->NativeArgAt(0));
srdjan 2014/04/09 17:08:18 ditto
Cutch 2014/04/09 20:28:54 Done.
41 isolate->set_user_tag(static_cast<uword>(self.tag()));
42 return Object::null();
43 }
44
45 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/profiler.dart » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698