[CP] Handle Object
members of dart:html
types in dart2js runtime
#48189
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
cherry-pick-approved
Label for approved cherrypick request
cherry-pick-review
Issue that need cherry pick triage to approve
web-dart2js
commit(s) to merge: d172051
Please note that the only relevant non-test and non-status file changes are pkg/compiler/lib/src/js_emitter/native_emitter.dart and sdk/lib/_internal/js_runtime/lib/js_helper.dart, which amount to ~20 lines of code.
merge instructions: Cleanly cherry-picks to 455fe9d (the current beta version of 2.16.0-134.1.beta)
What is the issue:
dart:html
classes' type hierarchies were changed, but not fully accounted for in the dart2js runtime. This means we'd get incorrect values for some of theObject
default methods e.g.hashCode
.What is the fix: The first change in the CL is to update the tags so dart2js can correctly register
dart:html
types. The second change is an additional if-clause to emit the righttoString
values.Why cherrypick: The major component of this is
hashCode
. Maps that contain many instances of these types will hash them all in the same bucket, leading to performance regressions. Beyond this, and less importantly,toString
andruntimeType
result in significantly less useful values i.e. treatingdart:html
types as a generic JS object type.Risk: Little.
The first change shouldn't make behavior worse than it already is, since it will only affect the
dart:html
types today. The second change only affectstoString
and error Strings when reporting a failed instance check.Link to original issue(s): #48187
#47942 is where it first popped up.
/cc @mit-mit @whesse @athomas @vsmenon @devoncarew @sigmundch
The text was updated successfully, but these errors were encountered: