xp-framework / compiler

Compiles future PHP to today's PHP.
19 stars 0 forks source link

Make enclosing type(s) accessible via code generator #152

Closed thekid closed 1 year ago

thekid commented 1 year ago

This pull request makes the enclosing type, meta data, initializations and virtual properties accessible via $codegen->context[0]->type instead of misusing locals[0..2] for this.

No measurable difference in memory usage or runtime performance by looking at the test suite.

thekid commented 1 year ago

Released in https://github.com/xp-framework/compiler/releases/tag/v8.8.0 with a small change:

- $codegen->context
+ $codegen->scope