Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Qualified methods #993

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
772b0ee
Usage of QualifiedMethod (InterfaceMethod in JS)
iskiselev May 31, 2016
a3a00ad
Code cleanup. Removed passing TypeReference/MethodReference where Typ…
iskiselev Jun 7, 2016
3d556da
CacheSignatures usage cleanup.
iskiselev Jun 8, 2016
fecc582
Fix: Allow search ne interface method in base types.
iskiselev Jun 8, 2016
7133024
Use signatures in FixupInterfaces to not initialize types before we n…
iskiselev Jun 8, 2016
941467c
QualifiedMethod added.
iskiselev Jun 8, 2016
73aa91b
Use InterfaceMethod.Of(...) instead of .Of(...).InterfaceMethod
iskiselev Jun 8, 2016
64e2ecc
Tests updated according to new generation patterns
iskiselev Jun 8, 2016
f39b07b
Use InterfaceMethod.CallStatic for static method calls.
iskiselev Jun 10, 2016
826ef49
Don't create InterfaceMethod for mangledName.
iskiselev Jun 10, 2016
d4efbe4
Test case updated.
iskiselev Jun 10, 2016
6257038
Corrected metod definition for JSIL.DefaultComparer.
iskiselev Jun 10, 2016
4efdd00
DCE fixed: we should preserve unused virtual method if derived method…
iskiselev Jun 10, 2016
6b08d48
Cleanup.
iskiselev Jun 11, 2016
b153957
Passed MemberReord information into InterfaceMethod.
iskiselev Jun 11, 2016
4c82560
MethodPointerInfo use InterfaceMethod now. #892 hidden of fixed.
iskiselev Jun 13, 2016
5f1988a
MethodPointerInfo proper caching.
iskiselev Jun 15, 2016
580a327
Moved test case to FailsOnMono.
iskiselev Jun 15, 2016
671ff0c
Tests fixed.
iskiselev Jun 15, 2016
21d4d08
Removed broken test of #624 with null path to instance method.
iskiselev Jun 15, 2016
1cb9e1c
InterfaceMethod now connected with MethodInfo.
iskiselev Jun 16, 2016
ca490e5
MethodOf expression use JSMethodPointerInfoExpression internally.
iskiselev Jun 16, 2016
da10b40
Libraries updated to use InterfaceMethod instead of MethodSignature.
iskiselev Jun 16, 2016
2549dbd
Cleanup of InterfaceMethod.
iskiselev Jun 17, 2016
cf5b23e
Fixed varinace signature resolution.
iskiselev Jun 17, 2016
13411dd
Use methodKey accessor to eliminate closures in signature calls.
iskiselev Jun 17, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncTaskMethodBuilder"
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();

var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.OnCompleted;
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
Expand All @@ -35,7 +35,7 @@ JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncTaskMethodBuilder"
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();

var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.OnCompleted;
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
Expand Down Expand Up @@ -102,7 +102,7 @@ JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncTaskMethodBuilder`
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();

var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.OnCompleted;
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
Expand All @@ -112,7 +112,7 @@ JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncTaskMethodBuilder`
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();

var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.OnCompleted;
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncVoidMethodBuilder"
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();

var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.OnCompleted;
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
Expand All @@ -27,7 +27,7 @@ JSIL.ImplementExternals("System.Runtime.CompilerServices.AsyncVoidMethodBuilder"
function AwaitOnCompleted(TAwaiter, TStateMachine, awaiter, stateMachine) {
stateMachine = stateMachine.get();

var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.OnCompleted;
var completedInterfaceMethod = $jsilcore.System.Runtime.CompilerServices.INotifyCompletion.$Methods.OnCompleted.InterfaceMethod;
completedInterfaceMethod.Call(awaiter.get(), null, $jsilcore.System.Action.New(stateMachine, stateMachine.MoveNext));
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}
);

$.Method({ Static: false, Public: true }, "Reset",
$.Method({ Static: false, Public: true, Virtual: true }, "Reset",
new JSIL.MethodSignature(null, []),
function () {
if (this._needDispose)
Expand All @@ -37,7 +37,7 @@
}
);

$.Method({ Static: false, Public: true }, "MoveNext",
$.Method({ Static: false, Public: true, Virtual: true }, "MoveNext",
new JSIL.MethodSignature("System.Boolean", []),
function () {
if (this._first) {
Expand All @@ -50,7 +50,7 @@
}
);

$.Method({ Static: false, Public: true }, "Dispose",
$.Method({ Static: false, Public: true, Virtual: true }, "Dispose",
new JSIL.MethodSignature(null, []),
function () {
if (this._needDispose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
);

$.Method({ Public: true, Static: false }, "Reset",
$.Method({ Public: true, Static: false, Virtual: true }, "Reset",
new JSIL.MethodSignature(null, []),
function () {
if (this._array === null)
Expand All @@ -31,14 +31,14 @@
}
);

$.Method({ Public: true, Static: false }, "MoveNext",
$.Method({ Public: true, Static: false, Virtual: true }, "MoveNext",
new JSIL.MethodSignature(System.Boolean, []),
function () {
return (++this._index < this._length);
}
);

$.Method({ Public: true, Static: false }, "Dispose",
$.Method({ Public: true, Static: false, Virtual: true }, "Dispose",
new JSIL.MethodSignature(null, []),
function () {
this._array = null;
Expand All @@ -55,7 +55,7 @@
)
.Overrides("System.Collections.IEnumerator", "get_Current");

$.Method({ Public: true, Static: false }, "get_Current",
$.Method({ Public: true, Static: false, Virtual: true }, "get_Current",
new JSIL.MethodSignature(T, []),
function () {
return this._array[this._index];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
}
);

$.Method({ Static: false, Public: true }, "Add",
$.Method({ Static: false, Public: true, Virtual: true}, "Add",
(new JSIL.MethodSignature(null, [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2"), new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2")], [])),
function Add(key, value) {
var bucketEntry = this.$searchBucket(key);
Expand All @@ -53,36 +53,36 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
}
);

$.Method({ Static: false, Public: true }, "Clear",
$.Method({ Static: false, Public: true, Virtual: true }, "Clear",
(JSIL.MethodSignature.Void),
function Clear() {
this._dict = {}
this._count = 0;
}
);

$.Method({ Static: false, Public: true }, "ContainsKey",
$.Method({ Static: false, Public: true, Virtual: true }, "ContainsKey",
(new JSIL.MethodSignature($.Boolean, [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2")], [])),
function ContainsKey(key) {
return this.$searchBucket(key) !== null;
}
);

$.Method({ Static: false, Public: true }, "Remove",
$.Method({ Static: false, Public: true, Virtual: true }, "Remove",
(new JSIL.MethodSignature($.Boolean, [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2")], [])),
function Remove(key) {
return this.$removeByKey(key);
}
);

$.Method({ Static: false, Public: true }, "get_Count",
$.Method({ Static: false, Public: true, Virtual: true }, "get_Count",
(new JSIL.MethodSignature($.Int32, [], [])),
function get_Count() {
return this._count;
}
);

$.Method({ Static: false, Public: true }, "get_Item",
$.Method({ Static: false, Public: true, Virtual: true }, "get_Item",
(new JSIL.MethodSignature(new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2"), [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2")], [])),
function get_Item(key) {
var bucketEntry = this.$searchBucket(key);
Expand All @@ -102,7 +102,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
return JSIL.CreateInstanceOfType(this.tKeyCollection, "_ctor", [this]);
};

$.Method({ Static: false, Public: true }, "get_Keys",
$.Method({ Static: false, Public: true, Virtual: true }, "get_Keys",
(new JSIL.MethodSignature(mscorlib.TypeRef("System.Collections.Generic.Dictionary`2+KeyCollection", [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2"), new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2")]), [], [])),
getKeysImpl
);
Expand All @@ -128,7 +128,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
return JSIL.CreateInstanceOfType(this.tValueCollection, "_ctor", [this]);
};

$.Method({ Static: false, Public: true }, "get_Values",
$.Method({ Static: false, Public: true, Virtual: true }, "get_Values",
(new JSIL.MethodSignature(mscorlib.TypeRef("System.Collections.Generic.Dictionary`2+ValueCollection", [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2"), new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2")]), [], [])),
getValuesImpl
);
Expand All @@ -153,7 +153,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
return JSIL.CreateInstanceOfType(this.tEnumerator, "_ctor", [this]);
};

$.Method({ Static: false, Public: true }, "GetEnumerator",
$.Method({ Static: false, Public: true, Virtual: true }, "GetEnumerator",
(new JSIL.MethodSignature(
mscorlib.TypeRef(
"System.Collections.Generic.Dictionary`2+Enumerator", [
Expand Down Expand Up @@ -188,7 +188,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
)
.Overrides("System.Collections.Generic.IEnumerable`1", "GetEnumerator");

$.Method({ Static: false, Public: true }, "set_Item",
$.Method({ Static: false, Public: true, Virtual: true }, "set_Item",
(new JSIL.MethodSignature(null, [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2"), new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2")], [])),
function set_Item(key, value) {
var bucketEntry = this.$searchBucket(key);
Expand All @@ -199,7 +199,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2", function ($)
}
);

$.Method({ Static: false, Public: true }, "TryGetValue",
$.Method({ Static: false, Public: true, Virtual: true }, "TryGetValue",
(new JSIL.MethodSignature($.Boolean, [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2"), $jsilcore.TypeRef("JSIL.Reference", [new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2")])], [])),
function TryGetValue(key, /* ref */ value) {
var bucketEntry = this.$searchBucket(key);
Expand Down Expand Up @@ -237,7 +237,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2+KeyCollection",
return JSIL.CreateInstanceOfType(this.dictionary.tKeyEnumerator, "_ctor", [this.dictionary]);
};

$.Method({ Static: false, Public: true }, "GetEnumerator",
$.Method({ Static: false, Public: true, Virtual: true }, "GetEnumerator",
new JSIL.MethodSignature($jsilcore.TypeRef("System.Collections.Generic.Dictionary`2+KeyCollection+Enumerator", [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2+KeyCollection"), new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2+KeyCollection")]), [], []),
getEnumeratorImpl
);
Expand Down Expand Up @@ -276,7 +276,7 @@ JSIL.ImplementExternals("System.Collections.Generic.Dictionary`2+ValueCollection
return JSIL.CreateInstanceOfType(this.dictionary.tValueEnumerator, "_ctor", [this.dictionary]);
};

$.Method({ Static: false, Public: true }, "GetEnumerator",
$.Method({ Static: false, Public: true, Virtual: true }, "GetEnumerator",
new JSIL.MethodSignature($jsilcore.TypeRef("System.Collections.Generic.Dictionary`2+ValueCollection+Enumerator", [new JSIL.GenericParameter("TKey", "System.Collections.Generic.Dictionary`2+ValueCollection"), new JSIL.GenericParameter("TValue", "System.Collections.Generic.Dictionary`2+ValueCollection")]), [], []),
getEnumeratorImpl
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
};

JSIL.MakeType({
BaseType: $jsilcore.TypeRef("System.Collections.Generic.EqualityComparer`1", [new JSIL.GenericParameter("T", "ObjectEqualityComparer`1")]),
BaseType: $jsilcore.TypeRef("System.Collections.Generic.EqualityComparer`1", [new JSIL.GenericParameter("T", "JSIL.ObjectEqualityComparer`1")]),
Name: "JSIL.ObjectEqualityComparer`1",
IsPublic: false,
IsReferenceType: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

$jsilcore.$ListExternals($, T, "List");

$.Method({ Static: false, Public: true }, "CopyTo",
$.Method({ Static: false, Public: true, Virtual: true }, "CopyTo",
new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Array", [T]), $.Int32], []),
function (array, arrayindex) {
if (arrayindex != 0) {
Expand All @@ -14,7 +14,7 @@
}
);

$.Method({ Static: false, Public: true }, "get_IsReadOnly",
$.Method({ Static: false, Public: true, Virtual: true }, "get_IsReadOnly",
new JSIL.MethodSignature($.Boolean, [], []),
function () {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,9 @@
$.SetValue("Sort", null);
};

JSIL.ImplementExternals("System.Collections.ObjectModel.ReadOnlyCollection`1", $jsilcore.$ReadOnlyCollectionExternals);
JSIL.ImplementExternals("System.Collections.ObjectModel.ReadOnlyCollection`1", $jsilcore.$ReadOnlyCollectionExternals);

//? if ('GENERATE_STUBS' in __out) {
JSIL.MakeClass("System.Object", "System.Collections.ObjectModel.ReadOnlyCollection`1", true, ["T"], function ($) {
});
//? }
Loading