Skip to content

[ddc] Handle deoptimized code patterns in compiler_new.dart after generational diffing is implemented #57049

@Markzipan

Description

@Markzipan

We've been emitting less optimal code to maintain compilation output consistency between hot reloaded and non-hot-reloaded code. However, certain core language features (constants, etc.) may require us to perform custom cross-generation diffing. In the advent of a diffing mechanism, we should un-deoptimize certain code patterns in compiler_new.dart:

  • Instance fields only need a forwarding getter (with embedded initializer) when newly added
  • SDK fields likely won't be hot reloaded and can be emitted without a value store + indirection getter (likely via a pragma)
  • All fields only need implicit type checks when their type is updated
  • RTI subtyping rules that implicitly refer to Object only need to be emitted for added/modified types
  • Subtype check caches don't need to be cleared on the first generation
  • We only need to tag functions that 1) are statically torn off or 2) have been reloaded from a statically torn off function.

Metadata

Metadata

Labels

P2A bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compilerweb-hot-reloadIssues related to stateful hot reload on the web

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions