Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
profiler.cc
Go to the documentation of this file.
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
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(tag_label);
23}
24
25DEFINE_NATIVE_ENTRY(UserTag_label, 0, 1) {
26 const UserTag& self = UserTag::CheckedHandle(zone, arguments->NativeArgAt(0));
27 return self.label();
28}
29
30DEFINE_NATIVE_ENTRY(UserTag_makeCurrent, 0, 1) {
31 const UserTag& self = UserTag::CheckedHandle(zone, arguments->NativeArgAt(0));
32 return self.MakeActive();
33}
34
35DEFINE_NATIVE_ENTRY(UserTag_defaultTag, 0, 0) {
36 if (FLAG_trace_intrinsified_natives) {
37 OS::PrintErr("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("Profiler_getCurrentTag\n");
45 }
46 return isolate->current_tag();
47}
48
49} // namespace dart
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
static UserTagPtr New(const String &label, Heap::Space space=Heap::kOld)
Definition object.cc:27028
#define ASSERT(E)
#define DEFINE_NATIVE_ENTRY(name, type_argument_count, argument_count)
#define GET_NON_NULL_NATIVE_ARGUMENT(type, name, value)