Fully revert "[DependencyInjection] backport perf optim"

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12952
| License       | MIT
| Doc PR        | 
This one should be kept. Instead, the declaration of `$parameters` in `addFrozenConstructor()` (line 846) should be removed.