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/exceptions.h"
10#include "vm/native_entry.h"
11#include "vm/object.h"
12#include "vm/object_store.h"
13
14namespace dart {
15
16// Native implementations of the profiler parts of the dart:developer library.
17
18DEFINE_NATIVE_ENTRY(UserTag_new, 0, 2) {
19 ASSERT(
20 TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(0)).IsNull());
21 GET_NON_NULL_NATIVE_ARGUMENT(String, tag_label, arguments->NativeArgAt(1));
22 return UserTag::New(label: tag_label);
23}
24
25DEFINE_NATIVE_ENTRY(UserTag_label, 0, 1) {
26 const UserTag& self = UserTag::CheckedHandle(zone, ptr: arguments->NativeArgAt(index: 0));
27 return self.label();
28}
29
30DEFINE_NATIVE_ENTRY(UserTag_makeCurrent, 0, 1) {
31 const UserTag& self = UserTag::CheckedHandle(zone, ptr: arguments->NativeArgAt(index: 0));
32 return self.MakeActive();
33}
34
35DEFINE_NATIVE_ENTRY(UserTag_defaultTag, 0, 0) {
36 if (FLAG_trace_intrinsified_natives) {
37 OS::PrintErr(format: "UserTag_defaultTag\n");
38 }
39 return isolate->default_tag();
40}
41
42DEFINE_NATIVE_ENTRY(Profiler_getCurrentTag, 0, 0) {
43 if (FLAG_trace_intrinsified_natives) {
44 OS::PrintErr(format: "Profiler_getCurrentTag\n");
45 }
46 return isolate->current_tag();
47}
48
49} // namespace dart
50

source code of flutter_engine/third_party/dart/runtime/lib/profiler.cc