[js_runtime] Remove unused ES6 Map _LinkedHashMap implementation
If we were to use ES6 Maps, we should try to use a single one for
all 'identity' keys (numbers, strings, enums etc).
Change-Id: Idc600b7cb48b58a074fd4c9bb6205d544f86dbc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226540
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
diff --git a/pkg/compiler/test/inference/data/call_site.dart b/pkg/compiler/test/inference/data/call_site.dart
index 6cc8406..16f18e0 100644
--- a/pkg/compiler/test/inference/data/call_site.dart
+++ b/pkg/compiler/test/inference/data/call_site.dart
@@ -112,7 +112,7 @@
/*member: A8.:[exact=A8]*/
class A8 {
/*member: A8.x8:[empty]*/
- x8(/*Union([exact=JSString], [subclass=JsLinkedHashMap])*/ p) =>
+ x8(/*Union([exact=JSString], [exact=JsLinkedHashMap])*/ p) =>
/*invoke: [exact=A8]*/ x8("x");
}
@@ -126,7 +126,7 @@
/*member: A9.x9:[empty]*/ x9(
/*[exact=JSUInt31]*/ p1,
/*Union([exact=JSString], [exact=JSUInt31])*/ p2,
- /*Union([exact=JSUInt31], [subclass=JsLinkedHashMap])*/ p3) =>
+ /*Union([exact=JSUInt31], [exact=JsLinkedHashMap])*/ p3) =>
/*invoke: [exact=A9]*/ x9(p1, "x", {});
}
diff --git a/pkg/compiler/test/inference/data/closure2.dart b/pkg/compiler/test/inference/data/closure2.dart
index 793c24c..a3c5e37 100644
--- a/pkg/compiler/test/inference/data/closure2.dart
+++ b/pkg/compiler/test/inference/data/closure2.dart
@@ -14,7 +14,7 @@
return a;
}
-/*member: returnDyn1:Union([exact=JSUInt31], [subclass=JsLinkedHashMap])*/
+/*member: returnDyn1:Union([exact=JSUInt31], [exact=JsLinkedHashMap])*/
returnDyn1() {
dynamic a = 42;
// ignore: unused_local_variable
@@ -34,7 +34,7 @@
return a;
}
-/*member: returnDyn2:Union([exact=JSUInt31], [subclass=JsLinkedHashMap])*/
+/*member: returnDyn2:Union([exact=JSUInt31], [exact=JsLinkedHashMap])*/
returnDyn2() {
dynamic a = 42;
// ignore: unused_local_variable
@@ -60,10 +60,10 @@
return a;
}
-/*member: returnDyn3:Union([exact=JSUInt31], [subclass=JsLinkedHashMap])*/
+/*member: returnDyn3:Union([exact=JSUInt31], [exact=JsLinkedHashMap])*/
returnDyn3() {
dynamic a = 42;
- if (a /*invoke: Union([exact=JSUInt31], [subclass=JsLinkedHashMap])*/ == 53) {
+ if (a /*invoke: Union([exact=JSUInt31], [exact=JsLinkedHashMap])*/ == 53) {
// ignore: unused_local_variable
var f = /*[null]*/ () {
a = {};
diff --git a/pkg/compiler/test/inference/data/closure_tracer.dart b/pkg/compiler/test/inference/data/closure_tracer.dart
index e689520..6353470 100644
--- a/pkg/compiler/test/inference/data/closure_tracer.dart
+++ b/pkg/compiler/test/inference/data/closure_tracer.dart
@@ -59,11 +59,11 @@
dynamic b = <dynamic, dynamic>{'foo': 1};
b
- /*update: Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSUInt31]), map: {foo: [exact=JSUInt31], bar: Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1)})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSUInt31]), map: {foo: [exact=JSUInt31], bar: Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1)})*/
['bar'] = a;
b
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSUInt31]), map: {foo: [exact=JSUInt31], bar: Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSUInt31]), map: {foo: [exact=JSUInt31], bar: Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1)})*/
['bar']
/*Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1)*/
diff --git a/pkg/compiler/test/inference/data/dictionary_types.dart b/pkg/compiler/test/inference/data/dictionary_types.dart
index 61c0072..e8a191a 100644
--- a/pkg/compiler/test/inference/data/dictionary_types.dart
+++ b/pkg/compiler/test/inference/data/dictionary_types.dart
@@ -13,7 +13,7 @@
test5();
}
-/*member: dictionaryA1:Map([subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+/*member: dictionaryA1:Map([exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
dynamic dictionaryA1 = {
'string': "aString",
'int': 42,
@@ -21,7 +21,7 @@
'list': []
};
-/*member: dictionaryB1:Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
+/*member: dictionaryB1:Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
dynamic dictionaryB1 = {
'string': "aString",
'int': 42,
@@ -29,7 +29,7 @@
'list': []
};
-/*member: otherDict1:Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {stringTwo: Value([exact=JSString], value: "anotherString"), intTwo: [exact=JSUInt31]})*/
+/*member: otherDict1:Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {stringTwo: Value([exact=JSString], value: "anotherString"), intTwo: [exact=JSUInt31]})*/
dynamic otherDict1 = {'stringTwo': "anotherString", 'intTwo': 84};
/*member: int1:[exact=JSUInt31]*/
@@ -47,26 +47,26 @@
/*member: test1:[null]*/
test1() {
dictionaryA1
- . /*invoke: Map([subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+ . /*invoke: Map([exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
addAll(otherDict1);
dictionaryB1
- . /*invoke: Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
+ . /*invoke: Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
addAll({'stringTwo': "anotherString", 'intTwo': 84});
int1 = dictionaryB1
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
['int'];
anotherInt1 = otherDict1
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {stringTwo: Value([exact=JSString], value: "anotherString"), intTwo: [exact=JSUInt31]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {stringTwo: Value([exact=JSString], value: "anotherString"), intTwo: [exact=JSUInt31]})*/
['intTwo'];
dynamic1 =
- dictionaryA1 /*Map([subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/ [
+ dictionaryA1 /*Map([exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/ [
'int'];
nullOrInt1 = dictionaryB1
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [null|subclass=Object], length: null), stringTwo: Value([null|exact=JSString], value: "anotherString"), intTwo: [null|exact=JSUInt31]})*/
['intTwo'];
}
-/*member: dictionaryA2:Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+/*member: dictionaryA2:Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
dynamic dictionaryA2 = {
'string': "aString",
'int': 42,
@@ -74,7 +74,7 @@
'list': []
};
-/*member: dictionaryB2:Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), intTwo: [exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+/*member: dictionaryB2:Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), intTwo: [exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
dynamic dictionaryB2 = {'string': "aString", 'intTwo': 42, 'list': []};
/*member: nullOrInt2:[null|exact=JSUInt31]*/
@@ -89,22 +89,22 @@
/*member: test2:[null]*/
test2() {
var union = dictionaryA2
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
['foo']
? dictionaryA2
: dictionaryB2;
nullOrInt2 = union
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {int: [null|exact=JSUInt31], double: [null|exact=JSNumNotInt], string: Value([exact=JSString], value: "aString"), intTwo: [null|exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {int: [null|exact=JSUInt31], double: [null|exact=JSNumNotInt], string: Value([exact=JSString], value: "aString"), intTwo: [null|exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
['intTwo'];
aString2 = union
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {int: [null|exact=JSUInt31], double: [null|exact=JSNumNotInt], string: Value([exact=JSString], value: "aString"), intTwo: [null|exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {int: [null|exact=JSUInt31], double: [null|exact=JSNumNotInt], string: Value([exact=JSString], value: "aString"), intTwo: [null|exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
['string'];
doubleOrNull2 = union
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {int: [null|exact=JSUInt31], double: [null|exact=JSNumNotInt], string: Value([exact=JSString], value: "aString"), intTwo: [null|exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {int: [null|exact=JSUInt31], double: [null|exact=JSNumNotInt], string: Value([exact=JSString], value: "aString"), intTwo: [null|exact=JSUInt31], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
['double'];
}
-/*member: dictionary3:Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+/*member: dictionary3:Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
dynamic dictionary3 = {
'string': "aString",
'int': 42,
@@ -125,18 +125,18 @@
/*member: intOrNull3:[null|exact=JSUInt31]*/
dynamic intOrNull3 = dictionary3
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
[keyI3];
/*member: justNull3:[null]*/
dynamic justNull3 = dictionary3
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
[keyN3];
/*member: test3:[null]*/
test3() {
knownDouble3 = dictionary3
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt], [exact=JSString], [exact=JSUInt31]), map: {string: Value([exact=JSString], value: "aString"), int: [exact=JSUInt31], double: [exact=JSNumNotInt], list: Container([exact=JSExtendableArray], element: [empty], length: 0)})*/
[keyD3];
// ignore: unused_local_variable
var x = [intOrNull3, justNull3];
@@ -147,8 +147,8 @@
A4();
/*member: A4.foo4:[exact=JSUInt31]*/
foo4(
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {anInt: [exact=JSUInt31], aString: Value([exact=JSString], value: "theString")})*/ value) {
- return value /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {anInt: [exact=JSUInt31], aString: Value([exact=JSString], value: "theString")})*/ [
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {anInt: [exact=JSUInt31], aString: Value([exact=JSString], value: "theString")})*/ value) {
+ return value /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {anInt: [exact=JSUInt31], aString: Value([exact=JSString], value: "theString")})*/ [
'anInt'];
}
}
@@ -159,7 +159,7 @@
/*member: B4.foo4:[exact=JSUInt31]*/
foo4(
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {anInt: [exact=JSUInt31], aString: Value([exact=JSString], value: "theString")})*/ value) {
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSString], [exact=JSUInt31]), map: {anInt: [exact=JSUInt31], aString: Value([exact=JSString], value: "theString")})*/ value) {
return 0;
}
}
@@ -180,7 +180,7 @@
2);
}
-/*member: dict5:Map([null|subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+/*member: dict5:Map([null|exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
dynamic dict5 = makeMap5([1, 2]);
/*member: notInt5:[null|subclass=Object]*/
@@ -189,7 +189,7 @@
/*member: alsoNotInt5:[null|subclass=Object]*/
dynamic alsoNotInt5 = 0;
-/*member: makeMap5:Map([subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+/*member: makeMap5:Map([exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
makeMap5(
/*Container([exact=JSExtendableArray], element: [exact=JSUInt31], length: 2)*/ values) {
return {
@@ -205,14 +205,14 @@
/*member: test5:[null]*/
test5() {
dict5
- /*update: Map([null|subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+ /*update: Map([null|exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
['goo'] = 42;
var closure =
- /*Map([null|subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+ /*Map([null|exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
() => dict5;
notInt5 = closure()['boo'];
alsoNotInt5 = dict5
- /*Map([null|subclass=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
+ /*Map([null|exact=JsLinkedHashMap], key: [null|subclass=Object], value: [null|subclass=Object])*/
['goo'];
print("$notInt5 and $alsoNotInt5.");
}
diff --git a/pkg/compiler/test/inference/data/index.dart b/pkg/compiler/test/inference/data/index.dart
index 4a00271..c05e292 100644
--- a/pkg/compiler/test/inference/data/index.dart
+++ b/pkg/compiler/test/inference/data/index.dart
@@ -60,7 +60,7 @@
mapLookupSingle() {
var map = {0: 1};
return map
- /*Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[0];
}
@@ -72,7 +72,7 @@
mapLookupMultiple() {
var map = {0: 1, 2: 3, 4: 5};
return map
- /*Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[2];
}
@@ -84,7 +84,7 @@
mapLookupMissing() {
var map = {0: 1};
return map
- /*Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[2];
}
@@ -96,7 +96,7 @@
mapLookupMixedKeys() {
var map = {0: 1, '': 2};
return map
- /*Map([subclass=JsLinkedHashMap], key: Union([exact=JSString], [exact=JSUInt31]), value: [null|exact=JSUInt31])*/
+ /*Map([exact=JsLinkedHashMap], key: Union([exact=JSString], [exact=JSUInt31]), value: [null|exact=JSUInt31])*/
[''];
}
@@ -108,7 +108,7 @@
mapLookupMixedValues() {
var map = {0: 1, 2: ''};
return map
- /*Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: Union(null, [exact=JSString], [exact=JSUInt31]))*/
+ /*Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: Union(null, [exact=JSString], [exact=JSUInt31]))*/
[2];
}
@@ -120,7 +120,7 @@
dictionaryLookupSingle() {
var map = {'foo': 'bar'};
return map
- /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: Value([null|exact=JSString], value: "bar"), map: {foo: Value([exact=JSString], value: "bar")})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: Value([null|exact=JSString], value: "bar"), map: {foo: Value([exact=JSString], value: "bar")})*/
['foo'];
}
@@ -132,7 +132,7 @@
dictionaryLookupMultiple() {
var map = {'foo': 'bar', 'baz': 'boz'};
return map
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSString], map: {foo: Value([exact=JSString], value: "bar"), baz: Value([exact=JSString], value: "boz")})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSString], map: {foo: Value([exact=JSString], value: "bar"), baz: Value([exact=JSString], value: "boz")})*/
['baz'];
}
@@ -144,7 +144,7 @@
dictionaryLookupMissing() {
var map = {'foo': 'bar', 'baz': 'boz'};
return map
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSString], map: {foo: Value([exact=JSString], value: "bar"), baz: Value([exact=JSString], value: "boz")})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSString], map: {foo: Value([exact=JSString], value: "bar"), baz: Value([exact=JSString], value: "boz")})*/
['unknown'];
}
@@ -156,7 +156,7 @@
intDictionaryLookupSingle() {
var map = {'foo': 0};
return map
- /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: [null|exact=JSUInt31], map: {foo: [exact=JSUInt31]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: [null|exact=JSUInt31], map: {foo: [exact=JSUInt31]})*/
['foo'];
}
diff --git a/pkg/compiler/test/inference/data/index_call.dart b/pkg/compiler/test/inference/data/index_call.dart
index 4454632..d563df2 100644
--- a/pkg/compiler/test/inference/data/index_call.dart
+++ b/pkg/compiler/test/inference/data/index_call.dart
@@ -63,9 +63,9 @@
var a = {
'a': {'b': 0}
};
- return a /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "a"), value: Dictionary([null|subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|exact=JSUInt31], map: {b: [exact=JSUInt31]}), map: {a: Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|exact=JSUInt31], map: {b: [exact=JSUInt31]})})*/
+ return a /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "a"), value: Dictionary([null|exact=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|exact=JSUInt31], map: {b: [exact=JSUInt31]}), map: {a: Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|exact=JSUInt31], map: {b: [exact=JSUInt31]})})*/
['a']
- /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|exact=JSUInt31], map: {b: [exact=JSUInt31]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|exact=JSUInt31], map: {b: [exact=JSUInt31]})*/
['b']
. /*invoke: [exact=JSUInt31]*/
abs();
@@ -77,9 +77,9 @@
var a = {
'a': {'b': closure}
};
- return a /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "a"), value: Dictionary([null|subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|subclass=Closure], map: {b: [subclass=Closure]}), map: {a: Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|subclass=Closure], map: {b: [subclass=Closure]})})*/
+ return a /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "a"), value: Dictionary([null|exact=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|subclass=Closure], map: {b: [subclass=Closure]}), map: {a: Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|subclass=Closure], map: {b: [subclass=Closure]})})*/
['a']
- /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|subclass=Closure], map: {b: [subclass=Closure]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "b"), value: [null|subclass=Closure], map: {b: [subclass=Closure]})*/
['b'](d: 0);
}
@@ -89,7 +89,7 @@
var a = {
'a': [closure]
};
- return a /*Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "a"), value: Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1), map: {a: Container([exact=JSExtendableArray], element: [subclass=Closure], length: 1)})*/
+ return a /*Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "a"), value: Container([null|exact=JSExtendableArray], element: [subclass=Closure], length: 1), map: {a: Container([exact=JSExtendableArray], element: [subclass=Closure], length: 1)})*/
['a']
/*Container([exact=JSExtendableArray], element: [subclass=Closure], length: 1)*/
[0](d: 0);
diff --git a/pkg/compiler/test/inference/data/index_set.dart b/pkg/compiler/test/inference/data/index_set.dart
index 883962c..c383f3f 100644
--- a/pkg/compiler/test/inference/data/index_set.dart
+++ b/pkg/compiler/test/inference/data/index_set.dart
@@ -60,7 +60,7 @@
mapUpdateEmpty() {
var map = {};
return map
- /*update: Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*update: Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[0] = 42;
}
@@ -72,7 +72,7 @@
mapUpdateSingle() {
var map = {0: 1};
return map
- /*update: Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*update: Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[0] = 42;
}
@@ -84,7 +84,7 @@
mapUpdateMultiple() {
var map = {0: 1, 2: 3, 4: 5};
return map
- /*update: Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*update: Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[2] = 42;
}
@@ -96,7 +96,7 @@
mapUpdateMissing() {
var map = {0: 1};
return map
- /*update: Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
+ /*update: Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: [null|exact=JSUInt31])*/
[2] = 42;
}
@@ -108,7 +108,7 @@
mapUpdateMixedKeys() {
dynamic map = {'': 2};
return map
- /*update: Map([subclass=JsLinkedHashMap], key: Union([exact=JSString], [exact=JSUInt31]), value: [null|exact=JSUInt31])*/
+ /*update: Map([exact=JsLinkedHashMap], key: Union([exact=JSString], [exact=JSUInt31]), value: [null|exact=JSUInt31])*/
[0] = 42;
}
@@ -120,7 +120,7 @@
mapUpdateMixedValues() {
dynamic map = {2: ''};
return map
- /*update: Map([subclass=JsLinkedHashMap], key: [exact=JSUInt31], value: Union(null, [exact=JSString], [exact=JSUInt31]))*/
+ /*update: Map([exact=JsLinkedHashMap], key: [exact=JSUInt31], value: Union(null, [exact=JSString], [exact=JSUInt31]))*/
[2] = 42;
}
@@ -132,7 +132,7 @@
dictionaryUpdateEmpty() {
var map = {};
return map
- /*update: Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: Value([null|exact=JSString], value: "bar"), map: {foo: Value([null|exact=JSString], value: "bar")})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: Value([null|exact=JSString], value: "bar"), map: {foo: Value([null|exact=JSString], value: "bar")})*/
['foo'] = 'bar';
}
@@ -144,7 +144,7 @@
dictionaryUpdateSingle() {
var map = {'foo': 'bar'};
return map
- /*update: Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: [null|exact=JSString], map: {foo: [exact=JSString]})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: [null|exact=JSString], map: {foo: [exact=JSString]})*/
['foo'] = 'boz';
}
@@ -156,7 +156,7 @@
dictionaryReUpdateSingle() {
var map = {'foo': 'bar'};
return map
- /*update: Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: Value([null|exact=JSString], value: "bar"), map: {foo: Value([exact=JSString], value: "bar")})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: Value([null|exact=JSString], value: "bar"), map: {foo: Value([exact=JSString], value: "bar")})*/
['foo'] = 'bar';
}
@@ -168,7 +168,7 @@
dictionaryUpdateMultiple() {
var map = {'foo': 'bar'};
return map
- /*update: Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSString], map: {foo: Value([exact=JSString], value: "bar"), baz: Value([null|exact=JSString], value: "boz")})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSString], map: {foo: Value([exact=JSString], value: "bar"), baz: Value([null|exact=JSString], value: "boz")})*/
['baz'] = 'boz';
}
@@ -180,7 +180,7 @@
intDictionaryUpdateSingle() {
var map = {};
return map
- /*update: Dictionary([subclass=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: [null|exact=JSUInt31], map: {foo: [null|exact=JSUInt31]})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: Value([exact=JSString], value: "foo"), value: [null|exact=JSUInt31], map: {foo: [null|exact=JSUInt31]})*/
['foo'] = 0;
}
diff --git a/pkg/compiler/test/inference/data/map_tracer_keys.dart b/pkg/compiler/test/inference/data/map_tracer_keys.dart
index beedfbf..1e70a9e 100644
--- a/pkg/compiler/test/inference/data/map_tracer_keys.dart
+++ b/pkg/compiler/test/inference/data/map_tracer_keys.dart
@@ -29,16 +29,16 @@
test1() {
var theMap = {'a': 2.2, 'b': 3.3, 'c': 4.4};
theMap
- /*update: Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [null|exact=JSNumNotInt]})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [null|exact=JSNumNotInt]})*/
['d'] = 5.5;
/*iterator: [exact=LinkedHashMapKeyIterable]*/
/*current: [exact=LinkedHashMapKeyIterator]*/
/*moveNext: [exact=LinkedHashMapKeyIterator]*/
for (var key in theMap.
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [null|exact=JSNumNotInt]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [null|exact=JSNumNotInt]})*/
keys) {
aDouble1 = theMap
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [null|exact=JSNumNotInt]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [null|exact=JSNumNotInt]})*/
[key];
}
// We have to reference it somewhere, so that it always gets resolved.
@@ -60,16 +60,16 @@
test2() {
dynamic theMap = {'a': 2.2, 'b': 3.3, 'c': 4.4};
theMap
- /*update: Map([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt])*/
+ /*update: Map([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt])*/
[aList2] = 5.5;
/*iterator: [exact=LinkedHashMapKeyIterable]*/
/*current: [exact=LinkedHashMapKeyIterator]*/
/*moveNext: [exact=LinkedHashMapKeyIterator]*/
for (var key in theMap.
- /*Map([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt])*/
+ /*Map([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt])*/
keys) {
aDouble2 = theMap
- /*Map([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt])*/
+ /*Map([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt])*/
[key];
}
// We have to reference it somewhere, so that it always gets resolved.
@@ -91,16 +91,16 @@
test3() {
dynamic theMap = <dynamic, dynamic>{'a': 2.2, 'b': 3.3, 'c': 4.4};
theMap
- /*update: Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([null|exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
+ /*update: Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([null|exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
['d'] = aList3;
/*iterator: [exact=LinkedHashMapKeyIterable]*/
/*current: [exact=LinkedHashMapKeyIterator]*/
/*moveNext: [exact=LinkedHashMapKeyIterator]*/
for (var key in theMap.
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([null|exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([null|exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
keys) {
aDouble3 = theMap
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([null|exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([null|exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
[key];
}
// We have to reference it somewhere, so that it always gets resolved.
@@ -125,10 +125,10 @@
/*current: [exact=LinkedHashMapKeyIterator]*/
/*moveNext: [exact=LinkedHashMapKeyIterator]*/
for (var key in theMap.
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [exact=JSNumNotInt]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [exact=JSNumNotInt]})*/
keys) {
aDouble4 = theMap
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [exact=JSNumNotInt]})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: [null|exact=JSNumNotInt], map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: [exact=JSNumNotInt]})*/
[key];
}
// We have to reference it somewhere, so that it always gets resolved.
@@ -153,10 +153,10 @@
/*current: [exact=LinkedHashMapKeyIterator]*/
/*moveNext: [exact=LinkedHashMapKeyIterator]*/
for (var key in theMap.
- /*Map([subclass=JsLinkedHashMap], key: Union([exact=JSExtendableArray], [exact=JSString]), value: [null|exact=JSNumNotInt])*/
+ /*Map([exact=JsLinkedHashMap], key: Union([exact=JSExtendableArray], [exact=JSString]), value: [null|exact=JSNumNotInt])*/
keys) {
aDouble5 = theMap
- /*Map([subclass=JsLinkedHashMap], key: Union([exact=JSExtendableArray], [exact=JSString]), value: [null|exact=JSNumNotInt])*/
+ /*Map([exact=JsLinkedHashMap], key: Union([exact=JSExtendableArray], [exact=JSString]), value: [null|exact=JSNumNotInt])*/
[key];
}
// We have to reference it somewhere, so that it always gets resolved.
@@ -180,10 +180,10 @@
/*current: [exact=LinkedHashMapKeyIterator]*/
/*moveNext: [exact=LinkedHashMapKeyIterator]*/
for (var key in theMap.
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
keys) {
aDouble6 = theMap
- /*Dictionary([subclass=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
+ /*Dictionary([exact=JsLinkedHashMap], key: [exact=JSString], value: Union(null, [exact=JSExtendableArray], [exact=JSNumNotInt]), map: {a: [exact=JSNumNotInt], b: [exact=JSNumNotInt], c: [exact=JSNumNotInt], d: Container([exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)})*/
[key];
}
// We have to reference it somewhere, so that it always gets resolved.
diff --git a/pkg/compiler/test/inference/data/no_such_method4.dart b/pkg/compiler/test/inference/data/no_such_method4.dart
index 0538869..2cd61c1 100644
--- a/pkg/compiler/test/inference/data/no_such_method4.dart
+++ b/pkg/compiler/test/inference/data/no_such_method4.dart
@@ -13,13 +13,13 @@
/*member: B.:[exact=B]*/
class B extends A {
- /*member: B.foo:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/ foo() =>
+ /*member: B.foo:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/ foo() =>
{};
}
/*member: C.:[exact=C]*/
class C extends B {
- /*member: C.foo:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/ foo() =>
+ /*member: C.foo:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/ foo() =>
{};
}
@@ -34,22 +34,22 @@
return e. /*invoke: [exact=A]*/ foo();
}
-/*member: test2:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
+/*member: test2:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
test2() => a. /*invoke: [null|subclass=B]*/ foo();
-/*member: test3:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
+/*member: test3:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
test3() => new B(). /*invoke: [exact=B]*/ foo();
-/*member: test4:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
+/*member: test4:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
test4() => new C(). /*invoke: [exact=C]*/ foo();
-/*member: test5:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
+/*member: test5:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
test5() {
dynamic e = (a ? new A() : new B());
return e. /*invoke: [subclass=A]*/ foo();
}
-/*member: test6:Dictionary([subclass=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
+/*member: test6:Dictionary([exact=JsLinkedHashMap], key: [empty], value: [null], map: {})*/
test6() => (a ? new B() : new C()). /*invoke: [subclass=B]*/ foo();
/*member: main:[null]*/
diff --git a/pkg/compiler/test/rti/data/map_literal.dart b/pkg/compiler/test/rti/data/map_literal.dart
index 1d91a1b..988f06e 100644
--- a/pkg/compiler/test/rti/data/map_literal.dart
+++ b/pkg/compiler/test/rti/data/map_literal.dart
@@ -11,7 +11,7 @@
/*spec.class: global#LinkedHashMap:deps=[Map],direct,explicit=[LinkedHashMap<LinkedHashMap.K,LinkedHashMap.V>],implicit=[LinkedHashMap.K,LinkedHashMap.V],needsArgs*/
/*prod.class: global#JsLinkedHashMap:deps=[LinkedHashMap]*/
-/*spec.class: global#JsLinkedHashMap:deps=[LinkedHashMap],direct,explicit=[JsLinkedHashMap,JsLinkedHashMap.K,JsLinkedHashMap.V,void Function(JsLinkedHashMap.K,JsLinkedHashMap.V)],implicit=[JsLinkedHashMap.K,JsLinkedHashMap.V],needsArgs*/
+/*spec.class: global#JsLinkedHashMap:deps=[LinkedHashMap],direct,explicit=[JsLinkedHashMap,JsLinkedHashMap.K,JsLinkedHashMap.V,void Function(JsLinkedHashMap.K,JsLinkedHashMap.V)],implicit=[JsLinkedHashMap.K],needsArgs*/
/*prod.class: global#double:*/
/*spec.class: global#double:implicit=[double]*/
diff --git a/pkg/compiler/test/rti/data/map_to_set.dart b/pkg/compiler/test/rti/data/map_to_set.dart
index 79f0f2a..4c870c3 100644
--- a/pkg/compiler/test/rti/data/map_to_set.dart
+++ b/pkg/compiler/test/rti/data/map_to_set.dart
@@ -11,7 +11,7 @@
/*spec.class: global#LinkedHashMap:deps=[Map],direct,explicit=[LinkedHashMap<LinkedHashMap.K,LinkedHashMap.V>],implicit=[LinkedHashMap.K,LinkedHashMap.V],needsArgs*/
/*prod.class: global#JsLinkedHashMap:deps=[LinkedHashMap],implicit=[JsLinkedHashMap.K],needsArgs*/
-/*spec.class: global#JsLinkedHashMap:deps=[LinkedHashMap],direct,explicit=[JsLinkedHashMap,JsLinkedHashMap.K,JsLinkedHashMap.V,void Function(JsLinkedHashMap.K,JsLinkedHashMap.V)],implicit=[JsLinkedHashMap.K,JsLinkedHashMap.V],needsArgs*/
+/*spec.class: global#JsLinkedHashMap:deps=[LinkedHashMap],direct,explicit=[JsLinkedHashMap,JsLinkedHashMap.K,JsLinkedHashMap.V,void Function(JsLinkedHashMap.K,JsLinkedHashMap.V)],implicit=[JsLinkedHashMap.K],needsArgs*/
/*prod.class: global#double:*/
/*spec.class: global#double:implicit=[double]*/
diff --git a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
index b01ebb6..8db9d2a 100644
--- a/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/collection_patch.dart
@@ -17,8 +17,6 @@
import 'dart:_internal' hide Symbol;
-const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps");
-
const int _mask30 = 0x3fffffff; // Low 30 bits.
@patch
@@ -509,13 +507,13 @@
if (isValidKey == null) {
if (hashCode == null) {
if (equals == null) {
- return new JsLinkedHashMap<K, V>.es6();
+ return new JsLinkedHashMap<K, V>();
}
hashCode = _defaultHashCode;
} else {
if (identical(identityHashCode, hashCode) &&
identical(identical, equals)) {
- return new _LinkedIdentityHashMap<K, V>.es6();
+ return new _LinkedIdentityHashMap<K, V>();
}
if (equals == null) {
equals = _defaultEquals;
@@ -533,12 +531,12 @@
}
@patch
- factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>.es6;
+ factory LinkedHashMap.identity() = _LinkedIdentityHashMap<K, V>;
// Private factory constructor called by generated code for map literals.
@pragma('dart2js:noInline')
factory LinkedHashMap._literal(List keyValuePairs) {
- return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>.es6());
+ return fillLiteralMap(keyValuePairs, new JsLinkedHashMap<K, V>());
}
// Private factory constructor called by generated code for map literals.
@@ -546,7 +544,7 @@
@pragma('dart2js:noInline')
@pragma('dart2js:noSideEffects')
factory LinkedHashMap._empty() {
- return new JsLinkedHashMap<K, V>.es6();
+ return new JsLinkedHashMap<K, V>();
}
// Private factory static function called by generated code for map literals.
@@ -564,17 +562,6 @@
}
class _LinkedIdentityHashMap<K, V> extends JsLinkedHashMap<K, V> {
- static bool get _supportsEs6Maps {
- return JS('returns:bool;depends:none;effects:none;throws:never;gvn:true',
- 'typeof Map != "undefined"');
- }
-
- factory _LinkedIdentityHashMap.es6() {
- return (_USE_ES6_MAPS && _LinkedIdentityHashMap._supportsEs6Maps)
- ? new _Es6LinkedIdentityHashMap<K, V>()
- : new _LinkedIdentityHashMap<K, V>();
- }
-
_LinkedIdentityHashMap();
int internalComputeHashCode(var key) {
@@ -595,161 +582,6 @@
}
}
-class _Es6LinkedIdentityHashMap<K, V> extends _LinkedIdentityHashMap<K, V>
- implements InternalMap {
- final _map;
- int _modifications = 0;
-
- _Es6LinkedIdentityHashMap() : _map = JS('var', 'new Map()');
-
- int get length => JS('int', '#.size', _map);
- bool get isEmpty => length == 0;
- bool get isNotEmpty => !isEmpty;
-
- Iterable<K> get keys => new _Es6MapIterable<K>(this, true);
-
- Iterable<V> get values => new _Es6MapIterable<V>(this, false);
-
- bool containsKey(Object? key) {
- return JS('bool', '#.has(#)', _map, key);
- }
-
- bool containsValue(Object? value) {
- return values.any((each) => each == value);
- }
-
- void addAll(Map<K, V> other) {
- other.forEach((K key, V value) {
- this[key] = value;
- });
- }
-
- V? operator [](Object? key) {
- return JS('var', '#.get(#)', _map, key);
- }
-
- void operator []=(K key, V value) {
- JS('var', '#.set(#, #)', _map, key, value);
- _modified();
- }
-
- V putIfAbsent(K key, V ifAbsent()) {
- if (containsKey(key)) return this[key] as V;
- V value = ifAbsent();
- this[key] = value;
- return value;
- }
-
- V? remove(Object? key) {
- V? value = this[key];
- JS('bool', '#.delete(#)', _map, key);
- _modified();
- return value;
- }
-
- void clear() {
- JS('void', '#.clear()', _map);
- _modified();
- }
-
- void forEach(void action(K key, V value)) {
- var jsEntries = JS('var', '#.entries()', _map);
- int modifications = _modifications;
- while (true) {
- var next = JS('var', '#.next()', jsEntries);
- bool done = JS('bool', '#.done', next);
- if (done) break;
- var entry = JS('var', '#.value', next);
- var key = JS('var', '#[0]', entry);
- var value = JS('var', '#[1]', entry);
- action(key, value);
- if (modifications != _modifications) {
- throw new ConcurrentModificationError(this);
- }
- }
- }
-
- void _modified() {
- // Value cycles after 2^30 modifications so that modification counts are
- // always unboxed (Smi) values. Modification detection will be missed if you
- // make exactly some multiple of 2^30 modifications between advances of an
- // iterator.
- _modifications = _mask30 & (_modifications + 1);
- }
-}
-
-class _Es6MapIterable<E> extends EfficientLengthIterable<E> {
- final _Es6LinkedIdentityHashMap _map;
- final bool _isKeys;
-
- _Es6MapIterable(this._map, this._isKeys);
-
- int get length => _map.length;
- bool get isEmpty => _map.isEmpty;
-
- Iterator<E> get iterator =>
- new _Es6MapIterator<E>(_map, _map._modifications, _isKeys);
-
- bool contains(Object? element) => _map.containsKey(element);
-
- void forEach(void f(E element)) {
- var jsIterator;
- if (_isKeys) {
- jsIterator = JS('var', '#.keys()', _map._map);
- } else {
- jsIterator = JS('var', '#.values()', _map._map);
- }
- int modifications = _map._modifications;
- while (true) {
- var next = JS('var', '#.next()', jsIterator);
- bool done = JS('bool', '#.done', next);
- if (done) break;
- var value = JS('var', '#.value', next);
- f(value);
- if (modifications != _map._modifications) {
- throw new ConcurrentModificationError(_map);
- }
- }
- }
-}
-
-class _Es6MapIterator<E> implements Iterator<E> {
- final _Es6LinkedIdentityHashMap _map;
- final int _modifications;
- final bool _isKeys;
- var _jsIterator;
- var _next;
- E? _current;
- bool _done = false;
-
- _Es6MapIterator(this._map, this._modifications, this._isKeys) {
- if (_isKeys) {
- _jsIterator = JS('var', '#.keys()', _map._map);
- } else {
- _jsIterator = JS('var', '#.values()', _map._map);
- }
- }
-
- E get current => _current as E;
-
- bool moveNext() {
- if (_modifications != _map._modifications) {
- throw new ConcurrentModificationError(_map);
- }
- if (_done) return false;
- _next = JS('var', '#.next()', _jsIterator);
- bool done = JS('bool', '#.done', _next);
- if (done) {
- _current = null;
- _done = true;
- return false;
- } else {
- _current = JS('var', '#.value', _next);
- return true;
- }
- }
-}
-
// TODO(floitsch): use ES6 maps when available.
class _LinkedCustomHashMap<K, V> extends JsLinkedHashMap<K, V> {
final _Equality<K> _equals;
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index 6d4d129..9579a76 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -478,7 +478,7 @@
factory Map.unmodifiable(Map other) = ConstantMap<K, V>.from;
@patch
- factory Map() = JsLinkedHashMap<K, V>.es6;
+ factory Map() = JsLinkedHashMap<K, V>;
}
@patch
diff --git a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
index fdf9d23..bd8533a 100644
--- a/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
+++ b/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart
@@ -7,8 +7,6 @@
part of _js_helper;
-const _USE_ES6_MAPS = const bool.fromEnvironment("dart2js.use.es6.maps");
-
class JsLinkedHashMap<K, V> extends MapBase<K, V>
implements LinkedHashMap<K, V>, InternalMap {
int _length = 0;
@@ -35,21 +33,8 @@
// iterated over.
int _modifications = 0;
- static bool get _supportsEs6Maps {
- return JS('returns:bool;depends:none;effects:none;throws:never;gvn:true',
- 'typeof Map != "undefined"');
- }
-
JsLinkedHashMap();
- /// If ES6 Maps are available returns a linked hash-map backed by an ES6 Map.
- @pragma('dart2js:tryInline')
- factory JsLinkedHashMap.es6() {
- return (_USE_ES6_MAPS && JsLinkedHashMap._supportsEs6Maps)
- ? new Es6LinkedHashMap<K, V>()
- : new JsLinkedHashMap<K, V>();
- }
-
int get length => _length;
bool get isEmpty => _length == 0;
bool get isNotEmpty => !isEmpty;
@@ -342,38 +327,6 @@
}
}
-class Es6LinkedHashMap<K, V> extends JsLinkedHashMap<K, V> {
- @override
- LinkedHashMapCell? _getTableCell(var table, var key) {
- return JS('var', '#.get(#)', table, key);
- }
-
- @override
- List<LinkedHashMapCell>? _getTableBucket(var table, var key) {
- return JS('var', '#.get(#)', table, key);
- }
-
- @override
- void _setTableEntry(var table, var key, var value) {
- JS('void', '#.set(#, #)', table, key, value);
- }
-
- @override
- void _deleteTableEntry(var table, var key) {
- JS('void', '#.delete(#)', table, key);
- }
-
- @override
- bool _containsTableEntry(var table, var key) {
- return JS('bool', '#.has(#)', table, key);
- }
-
- @override
- _newHashTable() {
- return JS('var', 'new Map()');
- }
-}
-
class LinkedHashMapCell {
final dynamic hashMapCellKey;
dynamic hashMapCellValue;