mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 10:33:28 +00:00
[vm] Remove "Impl" suffix from VM implementation classes.
This makes things nicer to read in places that display implementation names, such as stack traces, debuggers, profilers and inspectors. TEST=ci Change-Id: I959f70d9e51be59801c4455f8c5ccac3c214c21a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270502 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
parent
bdb782ba8f
commit
9a5dd4707f
|
@ -105,7 +105,7 @@ final tests = <IsolateTest>[
|
|||
[equals('Regular'), anything], // Internal mech. ..
|
||||
[equals('Regular'), anything],
|
||||
[equals('Regular'), anything],
|
||||
[equals('Regular'), endsWith(' _RawReceivePortImpl._handleMessage')],
|
||||
[equals('Regular'), endsWith(' _RawReceivePort._handleMessage')],
|
||||
]);
|
||||
|
||||
expectFrames(result.asyncCausalFrames, [
|
||||
|
|
|
@ -63,7 +63,7 @@ Throw of null.
|
|||
#1 foo (file:///.../sdk/throws.dart:5)
|
||||
#2 main (file:///.../sdk/throws.dart:7)
|
||||
#3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307)
|
||||
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
#4 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
|
||||
$ out/ReleaseX64/dart_precompiled_runtime dwarf_snapshot.so
|
||||
Unhandled exception:
|
||||
|
@ -158,7 +158,7 @@ isolate_instructions: 7fc7ad076000 vm_instructions: 0
|
|||
#1 foo (file:///.../sdk/throws.dart:5)
|
||||
#2 main (file:///.../sdk/throws.dart:7)
|
||||
#3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307)
|
||||
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
#4 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
|
||||
# Using the separately saved debugging information and piping all output to the tool's stdin.
|
||||
$ out/ReleaseX64/dart_precompiled_runtime dwarf_snapshot.so |& out/ReleaseX64/dart pkg/native_stack_traces/bin/decode.dart -e debug.data
|
||||
|
@ -172,7 +172,7 @@ isolate_instructions: 7f0df76e1000 vm_instructions: 0
|
|||
#1 foo (file:///.../sdk/throws.dart:5)
|
||||
#2 main (file:///.../sdk/throws.dart:7)
|
||||
#3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307)
|
||||
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
#4 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
|
||||
# Saving all output to the file "output.txt".
|
||||
$ out/ReleaseX64/dart_precompiled_runtime dwarf_snapshot.so >output.txt 2>&1
|
||||
|
@ -189,7 +189,7 @@ isolate_instructions: 7f524b090000 vm_instructions: 0
|
|||
#1 foo (file:///.../sdk/throws.dart:5)
|
||||
#2 main (file:///.../sdk/throws.dart:7)
|
||||
#3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307)
|
||||
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
#4 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
|
||||
# Output the converted input to the file "converted.txt" instead of stdout.
|
||||
$ out/ReleaseX64/dart pkg/native_stack_traces/bin/decode.dart -e debug.data -i output.txt -o converted.txt
|
||||
|
@ -205,7 +205,7 @@ isolate_instructions: 7f524b090000 vm_instructions: 0
|
|||
#1 foo (file:///.../sdk/throws.dart:5)
|
||||
#2 main (file:///.../sdk/throws.dart:7)
|
||||
#3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:307)
|
||||
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
#4 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:174)
|
||||
```
|
||||
|
||||
> **Note**: As seen here, only lines that contain stack trace frames are
|
||||
|
|
|
@ -31,20 +31,20 @@
|
|||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_NATIVE_ENTRY(CapabilityImpl_factory, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(Capability_factory, 0, 1) {
|
||||
ASSERT(
|
||||
TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(0)).IsNull());
|
||||
uint64_t id = isolate->random()->NextUInt64();
|
||||
return Capability::New(id);
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(CapabilityImpl_equals, 0, 2) {
|
||||
DEFINE_NATIVE_ENTRY(Capability_equals, 0, 2) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(Capability, recv, arguments->NativeArgAt(0));
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(Capability, other, arguments->NativeArgAt(1));
|
||||
return (recv.Id() == other.Id()) ? Bool::True().ptr() : Bool::False().ptr();
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(CapabilityImpl_get_hashcode, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(Capability_get_hashcode, 0, 1) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(Capability, cap, arguments->NativeArgAt(0));
|
||||
int64_t id = cap.Id();
|
||||
int32_t hi = static_cast<int32_t>(id >> 32);
|
||||
|
@ -53,7 +53,7 @@ DEFINE_NATIVE_ENTRY(CapabilityImpl_get_hashcode, 0, 1) {
|
|||
return Smi::New(hash);
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_factory, 0, 2) {
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePort_factory, 0, 2) {
|
||||
ASSERT(
|
||||
TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(0)).IsNull());
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(String, debug_name, arguments->NativeArgAt(1));
|
||||
|
@ -61,24 +61,24 @@ DEFINE_NATIVE_ENTRY(RawReceivePortImpl_factory, 0, 2) {
|
|||
return ReceivePort::New(port_id, debug_name, false /* not control port */);
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_get_id, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePort_get_id, 0, 1) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
|
||||
return Integer::New(port.Id());
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_get_sendport, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePort_get_sendport, 0, 1) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
|
||||
return port.send_port();
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_closeInternal, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePort_closeInternal, 0, 1) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
|
||||
Dart_Port id = port.Id();
|
||||
PortMap::ClosePort(id);
|
||||
return Integer::New(id);
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePortImpl_setActive, 0, 2) {
|
||||
DEFINE_NATIVE_ENTRY(RawReceivePort_setActive, 0, 2) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(ReceivePort, port, arguments->NativeArgAt(0));
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(Bool, active, arguments->NativeArgAt(1));
|
||||
Dart_Port id = port.Id();
|
||||
|
@ -87,12 +87,12 @@ DEFINE_NATIVE_ENTRY(RawReceivePortImpl_setActive, 0, 2) {
|
|||
return Object::null();
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(SendPortImpl_get_id, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(SendPort_get_id, 0, 1) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
|
||||
return Integer::New(port.Id());
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(SendPortImpl_get_hashcode, 0, 1) {
|
||||
DEFINE_NATIVE_ENTRY(SendPort_get_hashcode, 0, 1) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
|
||||
int64_t id = port.Id();
|
||||
int32_t hi = static_cast<int32_t>(id >> 32);
|
||||
|
@ -109,7 +109,7 @@ static bool InSameGroup(Isolate* sender, const SendPort& receiver) {
|
|||
return sender->origin_id() == receiver.origin_id();
|
||||
}
|
||||
|
||||
DEFINE_NATIVE_ENTRY(SendPortImpl_sendInternal_, 0, 2) {
|
||||
DEFINE_NATIVE_ENTRY(SendPort_sendInternal_, 0, 2) {
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
|
||||
GET_NON_NULL_NATIVE_ARGUMENT(Instance, obj, arguments->NativeArgAt(1));
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class Analysis {
|
|||
late final _nonGrowableListCid = _findClassId('_List');
|
||||
late final _immutableListCid = _findClassId('_ImmutableList');
|
||||
late final _weakPropertyCid = _findClassId('_WeakProperty');
|
||||
late final _weakReferenceCid = _findClassId('_WeakReferenceImpl');
|
||||
late final _weakReferenceCid = _findClassId('_WeakReference');
|
||||
late final _patchClassCid = _findClassId('PatchClass');
|
||||
late final _finalizerEntryCid = _findClassId('FinalizerEntry');
|
||||
|
||||
|
|
|
@ -53,17 +53,17 @@ namespace dart {
|
|||
V(Integer_ushrFromInteger, 2) \
|
||||
V(Bool_fromEnvironment, 3) \
|
||||
V(Bool_hasEnvironment, 2) \
|
||||
V(CapabilityImpl_factory, 1) \
|
||||
V(CapabilityImpl_equals, 2) \
|
||||
V(CapabilityImpl_get_hashcode, 1) \
|
||||
V(RawReceivePortImpl_factory, 2) \
|
||||
V(RawReceivePortImpl_get_id, 1) \
|
||||
V(RawReceivePortImpl_get_sendport, 1) \
|
||||
V(RawReceivePortImpl_closeInternal, 1) \
|
||||
V(RawReceivePortImpl_setActive, 2) \
|
||||
V(SendPortImpl_get_id, 1) \
|
||||
V(SendPortImpl_get_hashcode, 1) \
|
||||
V(SendPortImpl_sendInternal_, 2) \
|
||||
V(Capability_factory, 1) \
|
||||
V(Capability_equals, 2) \
|
||||
V(Capability_get_hashcode, 1) \
|
||||
V(RawReceivePort_factory, 2) \
|
||||
V(RawReceivePort_get_id, 1) \
|
||||
V(RawReceivePort_get_sendport, 1) \
|
||||
V(RawReceivePort_closeInternal, 1) \
|
||||
V(RawReceivePort_setActive, 2) \
|
||||
V(SendPort_get_id, 1) \
|
||||
V(SendPort_get_hashcode, 1) \
|
||||
V(SendPort_sendInternal_, 2) \
|
||||
V(Smi_bitNegate, 1) \
|
||||
V(Smi_bitLength, 1) \
|
||||
V(SuspendState_instantiateClosureWithFutureTypeArgument, 2) \
|
||||
|
|
|
@ -262,8 +262,8 @@ namespace dart {
|
|||
V(_WeakProperty, set:key, WeakProperty_setKey, 0x963a095f) \
|
||||
V(_WeakProperty, get:value, WeakProperty_getValue, 0xd2f28aae) \
|
||||
V(_WeakProperty, set:value, WeakProperty_setValue, 0x8b2bafab) \
|
||||
V(_WeakReferenceImpl, get:target, WeakReference_getTarget, 0xc990118a) \
|
||||
V(_WeakReferenceImpl, set:_target, WeakReference_setTarget, 0xc729697a) \
|
||||
V(_WeakReference, get:target, WeakReference_getTarget, 0xc990118a) \
|
||||
V(_WeakReference, set:_target, WeakReference_setTarget, 0xc729697a) \
|
||||
V(::, _classRangeCheck, ClassRangeCheck, 0x09f5fc7a) \
|
||||
V(::, _abi, FfiAbi, 0x7c4ab3b4) \
|
||||
V(::, _asFunctionInternal, FfiAsFunctionInternal, 0x631b1071) \
|
||||
|
|
|
@ -1873,15 +1873,15 @@ ErrorPtr Object::Init(IsolateGroup* isolate_group,
|
|||
ASSERT(isolate_lib.ptr() == Library::IsolateLibrary());
|
||||
|
||||
cls = Class::New<Capability, RTN::Capability>(isolate_group);
|
||||
RegisterPrivateClass(cls, Symbols::_CapabilityImpl(), isolate_lib);
|
||||
RegisterPrivateClass(cls, Symbols::_Capability(), isolate_lib);
|
||||
pending_classes.Add(cls);
|
||||
|
||||
cls = Class::New<ReceivePort, RTN::ReceivePort>(isolate_group);
|
||||
RegisterPrivateClass(cls, Symbols::_RawReceivePortImpl(), isolate_lib);
|
||||
RegisterPrivateClass(cls, Symbols::_RawReceivePort(), isolate_lib);
|
||||
pending_classes.Add(cls);
|
||||
|
||||
cls = Class::New<SendPort, RTN::SendPort>(isolate_group);
|
||||
RegisterPrivateClass(cls, Symbols::_SendPortImpl(), isolate_lib);
|
||||
RegisterPrivateClass(cls, Symbols::_SendPort(), isolate_lib);
|
||||
pending_classes.Add(cls);
|
||||
|
||||
cls = Class::New<TransferableTypedData, RTN::TransferableTypedData>(
|
||||
|
@ -2007,7 +2007,7 @@ ErrorPtr Object::Init(IsolateGroup* isolate_group,
|
|||
RTN::WeakReference::type_arguments_offset());
|
||||
cls.set_num_type_arguments_unsafe(1);
|
||||
object_store->set_weak_reference_class(cls);
|
||||
RegisterPrivateClass(cls, Symbols::_WeakReferenceImpl(), core_lib);
|
||||
RegisterPrivateClass(cls, Symbols::_WeakReference(), core_lib);
|
||||
|
||||
// Pre-register the mirrors library so we can place the vm class
|
||||
// MirrorReference there rather than the core library.
|
||||
|
|
|
@ -11767,6 +11767,7 @@ class Closure : public Instance {
|
|||
friend class Class;
|
||||
};
|
||||
|
||||
// Corresponds to _Capability in dart:isolate.
|
||||
class Capability : public Instance {
|
||||
public:
|
||||
uint64_t Id() const { return untag()->id_; }
|
||||
|
@ -11781,6 +11782,7 @@ class Capability : public Instance {
|
|||
friend class Class;
|
||||
};
|
||||
|
||||
// Corresponds to _RawReceivePort in dart:isolate.
|
||||
class ReceivePort : public Instance {
|
||||
public:
|
||||
SendPortPtr send_port() const { return untag()->send_port(); }
|
||||
|
@ -11810,6 +11812,7 @@ class ReceivePort : public Instance {
|
|||
friend class Class;
|
||||
};
|
||||
|
||||
// Corresponds to _SendPort in dart:isolate.
|
||||
class SendPort : public Instance {
|
||||
public:
|
||||
Dart_Port Id() const { return untag()->id_; }
|
||||
|
@ -12257,6 +12260,7 @@ class RegExp : public Instance {
|
|||
friend class Class;
|
||||
};
|
||||
|
||||
// Corresponds to _WeakProperty in dart:core.
|
||||
class WeakProperty : public Instance {
|
||||
public:
|
||||
ObjectPtr key() const { return untag()->key(); }
|
||||
|
@ -12288,6 +12292,7 @@ class WeakProperty : public Instance {
|
|||
friend class Class;
|
||||
};
|
||||
|
||||
// Corresponds to _WeakReference in dart:core.
|
||||
class WeakReference : public Instance {
|
||||
public:
|
||||
ObjectPtr target() const { return untag()->target(); }
|
||||
|
|
|
@ -581,7 +581,7 @@ void ObjectStore::LazyInitIsolateMembers() {
|
|||
ASSERT(!cls.IsNull());
|
||||
transferable_class_.store(cls.ptr());
|
||||
|
||||
cls = isolate_lib.LookupClassAllowPrivate(Symbols::_RawReceivePortImpl());
|
||||
cls = isolate_lib.LookupClassAllowPrivate(Symbols::_RawReceivePort());
|
||||
ASSERT(!cls.IsNull());
|
||||
const auto& error = cls.EnsureIsFinalized(thread);
|
||||
ASSERT(error == Error::null());
|
||||
|
|
|
@ -277,7 +277,7 @@ class ObjectPointerVisitor;
|
|||
V(_ByteBuffer, "_ByteBuffer") \
|
||||
V(_ByteBufferDot_New, "_ByteBuffer._New") \
|
||||
V(_ByteDataView, "_ByteDataView") \
|
||||
V(_CapabilityImpl, "_CapabilityImpl") \
|
||||
V(_Capability, "_Capability") \
|
||||
V(_ClassMirror, "_ClassMirror") \
|
||||
V(_Closure, "_Closure") \
|
||||
V(_ClosureCall, "_Closure.call") \
|
||||
|
@ -361,11 +361,11 @@ class ObjectPointerVisitor;
|
|||
V(_NativeFinalizer, "_NativeFinalizer") \
|
||||
V(_ParameterMirror, "_ParameterMirror") \
|
||||
V(_Random, "_Random") \
|
||||
V(_RawReceivePortImpl, "_RawReceivePortImpl") \
|
||||
V(_RawReceivePort, "_RawReceivePort") \
|
||||
V(_Record, "_Record") \
|
||||
V(_RecordType, "_RecordType") \
|
||||
V(_RegExp, "_RegExp") \
|
||||
V(_SendPortImpl, "_SendPortImpl") \
|
||||
V(_SendPort, "_SendPort") \
|
||||
V(_Set, "_Set") \
|
||||
V(_Smi, "_Smi") \
|
||||
V(_SourceLocation, "_SourceLocation") \
|
||||
|
@ -416,7 +416,7 @@ class ObjectPointerVisitor;
|
|||
V(_Utf8Decoder, "_Utf8Decoder") \
|
||||
V(_VariableMirror, "_VariableMirror") \
|
||||
V(_WeakProperty, "_WeakProperty") \
|
||||
V(_WeakReferenceImpl, "_WeakReferenceImpl") \
|
||||
V(_WeakReference, "_WeakReference") \
|
||||
V(_await, "_await") \
|
||||
V(_classRangeCheck, "_classRangeCheck") \
|
||||
V(_current, "_current") \
|
||||
|
|
|
@ -157,12 +157,12 @@ class Expando<T> {
|
|||
@patch
|
||||
class WeakReference<T extends Object> {
|
||||
@patch
|
||||
factory WeakReference(T target) = _WeakReferenceImpl<T>;
|
||||
factory WeakReference(T target) = _WeakReference<T>;
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _WeakReferenceImpl<T extends Object> implements WeakReference<T> {
|
||||
_WeakReferenceImpl(T target) {
|
||||
class _WeakReference<T extends Object> implements WeakReference<T> {
|
||||
_WeakReference(T target) {
|
||||
checkValidWeakTarget(target, 'target');
|
||||
_target = target;
|
||||
}
|
||||
|
|
|
@ -1030,7 +1030,7 @@ extension AbiSpecificIntegerArray on Array<AbiSpecificInteger> {
|
|||
|
||||
extension NativePort on SendPort {
|
||||
@patch
|
||||
@pragma("vm:external-name", "SendPortImpl_get_id")
|
||||
@pragma("vm:external-name", "SendPort_get_id")
|
||||
external int get nativePort;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,25 +34,25 @@ class ReceivePort {
|
|||
@pragma("vm:entry-point")
|
||||
class Capability {
|
||||
@patch
|
||||
factory Capability() => new _CapabilityImpl();
|
||||
factory Capability() => new _Capability();
|
||||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _CapabilityImpl implements Capability {
|
||||
@pragma("vm:external-name", "CapabilityImpl_factory")
|
||||
external factory _CapabilityImpl();
|
||||
class _Capability implements Capability {
|
||||
@pragma("vm:external-name", "Capability_factory")
|
||||
external factory _Capability();
|
||||
|
||||
bool operator ==(Object other) {
|
||||
return (other is _CapabilityImpl) && _equals(other);
|
||||
return (other is _Capability) && _equals(other);
|
||||
}
|
||||
|
||||
int get hashCode {
|
||||
return _get_hashcode();
|
||||
}
|
||||
|
||||
@pragma("vm:external-name", "CapabilityImpl_equals")
|
||||
@pragma("vm:external-name", "Capability_equals")
|
||||
external bool _equals(Object other);
|
||||
@pragma("vm:external-name", "CapabilityImpl_get_hashcode")
|
||||
@pragma("vm:external-name", "Capability_get_hashcode")
|
||||
external int _get_hashcode();
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class RawReceivePort {
|
|||
*/
|
||||
@patch
|
||||
factory RawReceivePort([Function? handler, String debugName = '']) {
|
||||
_RawReceivePortImpl result = new _RawReceivePortImpl(debugName);
|
||||
_RawReceivePort result = new _RawReceivePort(debugName);
|
||||
result.handler = handler;
|
||||
return result;
|
||||
}
|
||||
|
@ -132,17 +132,17 @@ Function _getIsolateScheduleImmediateClosure() {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _RawReceivePortImpl implements RawReceivePort {
|
||||
factory _RawReceivePortImpl(String debugName) {
|
||||
final port = _RawReceivePortImpl._(debugName);
|
||||
class _RawReceivePort implements RawReceivePort {
|
||||
factory _RawReceivePort(String debugName) {
|
||||
final port = _RawReceivePort._(debugName);
|
||||
_portMap[port._get_id()] = <String, dynamic>{
|
||||
'port': port,
|
||||
};
|
||||
return port;
|
||||
}
|
||||
|
||||
@pragma("vm:external-name", "RawReceivePortImpl_factory")
|
||||
external factory _RawReceivePortImpl._(String debugName);
|
||||
@pragma("vm:external-name", "RawReceivePort_factory")
|
||||
external factory _RawReceivePort._(String debugName);
|
||||
|
||||
close() {
|
||||
// Close the port and remove it from the handler map.
|
||||
|
@ -154,8 +154,7 @@ class _RawReceivePortImpl implements RawReceivePort {
|
|||
}
|
||||
|
||||
bool operator ==(var other) {
|
||||
return (other is _RawReceivePortImpl) &&
|
||||
(this._get_id() == other._get_id());
|
||||
return (other is _RawReceivePort) && (this._get_id() == other._get_id());
|
||||
}
|
||||
|
||||
int get hashCode {
|
||||
|
@ -163,9 +162,9 @@ class _RawReceivePortImpl implements RawReceivePort {
|
|||
}
|
||||
|
||||
/**** Internal implementation details ****/
|
||||
@pragma("vm:external-name", "RawReceivePortImpl_get_id")
|
||||
@pragma("vm:external-name", "RawReceivePort_get_id")
|
||||
external int _get_id();
|
||||
@pragma("vm:external-name", "RawReceivePortImpl_get_sendport")
|
||||
@pragma("vm:external-name", "RawReceivePort_get_sendport")
|
||||
external SendPort _get_sendport();
|
||||
|
||||
// Called from the VM to retrieve the handler for a message.
|
||||
|
@ -196,14 +195,14 @@ class _RawReceivePortImpl implements RawReceivePort {
|
|||
}
|
||||
|
||||
// Call into the VM to close the VM maintained mappings.
|
||||
@pragma("vm:external-name", "RawReceivePortImpl_closeInternal")
|
||||
@pragma("vm:external-name", "RawReceivePort_closeInternal")
|
||||
external int _closeInternal();
|
||||
|
||||
// Set this port as active or inactive in the VM. If inactive, this port
|
||||
// will not be considered live even if it hasn't been explicitly closed.
|
||||
// TODO(bkonyi): determine if we want to expose this as an option through
|
||||
// RawReceivePort.
|
||||
@pragma("vm:external-name", "RawReceivePortImpl_setActive")
|
||||
@pragma("vm:external-name", "RawReceivePort_setActive")
|
||||
external _setActive(bool active);
|
||||
|
||||
void set handler(Function? value) {
|
||||
|
@ -220,8 +219,8 @@ class _RawReceivePortImpl implements RawReceivePort {
|
|||
}
|
||||
|
||||
@pragma("vm:entry-point")
|
||||
class _SendPortImpl implements SendPort {
|
||||
factory _SendPortImpl._uninstantiable() {
|
||||
class _SendPort implements SendPort {
|
||||
factory _SendPort._uninstantiable() {
|
||||
throw "Unreachable";
|
||||
}
|
||||
|
||||
|
@ -232,7 +231,7 @@ class _SendPortImpl implements SendPort {
|
|||
}
|
||||
|
||||
bool operator ==(var other) {
|
||||
return (other is _SendPortImpl) && (this._get_id() == other._get_id());
|
||||
return (other is _SendPort) && (this._get_id() == other._get_id());
|
||||
}
|
||||
|
||||
int get hashCode {
|
||||
|
@ -240,13 +239,13 @@ class _SendPortImpl implements SendPort {
|
|||
}
|
||||
|
||||
/*--- private implementation ---*/
|
||||
@pragma("vm:external-name", "SendPortImpl_get_id")
|
||||
@pragma("vm:external-name", "SendPort_get_id")
|
||||
external _get_id();
|
||||
@pragma("vm:external-name", "SendPortImpl_get_hashcode")
|
||||
@pragma("vm:external-name", "SendPort_get_hashcode")
|
||||
external _get_hashcode();
|
||||
|
||||
// Forward the implementation of sending messages to the VM.
|
||||
@pragma("vm:external-name", "SendPortImpl_sendInternal_")
|
||||
@pragma("vm:external-name", "SendPort_sendInternal_")
|
||||
external void _sendInternal(var message);
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ class _Timer implements Timer {
|
|||
static const _ID_MASK = 0x1fffffff;
|
||||
static int _idCount = 0;
|
||||
|
||||
static _RawReceivePortImpl? _receivePort;
|
||||
static _RawReceivePort? _receivePort;
|
||||
static SendPort? _sendPort;
|
||||
static bool _receivePortActive = false;
|
||||
static int _scheduledWakeupTime = 0;
|
||||
|
@ -455,7 +455,7 @@ class _Timer implements Timer {
|
|||
var receivePort = _receivePort;
|
||||
if (receivePort == null) {
|
||||
assert(_sendPort == null);
|
||||
final port = _RawReceivePortImpl('Timer');
|
||||
final port = _RawReceivePort('Timer');
|
||||
port.handler = _handleMessage;
|
||||
_sendPort = port.sendPort;
|
||||
_receivePort = port;
|
||||
|
|
Loading…
Reference in a new issue