Files
sdk/runtime/lib/profiler.cc
T
Ryan Macnak b1c09ecd8f [vm] Make naming more consistent when converting between handles, tagged and untagged pointers.
Currently we have things called XPtr which are not what you get from ptr().

Old world:
handle->raw() returns RawObject* (tagged)
raw_obj->ptr() returns RawObject* (untagged)

After 6fe15f6df9:
handle->raw() returns ObjectPtr
obj_ptr->ptr() returns ObjectLayout*

New world:
handle->ptr() returns ObjectPtr
obj_ptr->untag() returns UntaggedObject*

TEST=ci
Change-Id: I6c7f34014cf20737607caaf84979838300d12df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149367
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-15 23:32:02 +00:00

55 lines
1.6 KiB
C++

// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "vm/bootstrap_natives.h"
#include "include/dart_api.h"
#include "vm/exceptions.h"
#include "vm/native_entry.h"
#include "vm/object.h"
#include "vm/object_store.h"
namespace dart {
// Native implementations of the profiler parts of the dart:developer library.
DEFINE_NATIVE_ENTRY(UserTag_new, 0, 2) {
ASSERT(
TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(0)).IsNull());
GET_NON_NULL_NATIVE_ARGUMENT(String, tag_label, arguments->NativeArgAt(1));
return UserTag::New(tag_label);
}
DEFINE_NATIVE_ENTRY(UserTag_label, 0, 1) {
const UserTag& self = UserTag::CheckedHandle(zone, arguments->NativeArgAt(0));
return self.label();
}
DEFINE_NATIVE_ENTRY(UserTag_makeCurrent, 0, 1) {
const UserTag& self = UserTag::CheckedHandle(zone, arguments->NativeArgAt(0));
if (FLAG_trace_intrinsified_natives) {
OS::PrintErr("UserTag_makeCurrent: %s\n", self.ToCString());
}
const UserTag& old = UserTag::Handle(zone, isolate->current_tag());
self.MakeActive();
return old.ptr();
}
DEFINE_NATIVE_ENTRY(UserTag_defaultTag, 0, 0) {
if (FLAG_trace_intrinsified_natives) {
OS::PrintErr("UserTag_defaultTag\n");
}
return isolate->default_tag();
}
DEFINE_NATIVE_ENTRY(Profiler_getCurrentTag, 0, 0) {
if (FLAG_trace_intrinsified_natives) {
OS::PrintErr("Profiler_getCurrentTag\n");
}
return isolate->current_tag();
}
} // namespace dart