RESOLVED FIXED 149622
Introduce Symbol type for property type inference
https://bugs.webkit.org/show_bug.cgi?id=149622
Summary Introduce Symbol type for property type inference
Yusuke Suzuki
Reported 2015-09-29 03:35:17 PDT
Introduce Symbol type for property type inference
Attachments
Patch (8.38 KB, patch)
2015-09-29 03:35 PDT, Yusuke Suzuki
no flags
Patch (17.54 KB, patch)
2015-10-10 21:51 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2015-09-29 03:35:31 PDT
Created attachment 262059 [details] Patch WIP, not compiled yet
Yusuke Suzuki
Comment 2 2015-09-29 03:37:29 PDT
For example, const Red = Symbol("Red"); const Blue = Symbol("Green"); class Apple { constructor(color) { this.color = color; } } let apple = new Apple(Red); let greenApple = new Apple(Green);
Yusuke Suzuki
Comment 3 2015-10-10 21:51:33 PDT
Geoffrey Garen
Comment 4 2015-10-12 12:07:42 PDT
Comment on attachment 262849 [details] Patch r=me
WebKit Commit Bot
Comment 5 2015-10-12 19:10:10 PDT
Comment on attachment 262849 [details] Patch Clearing flags on attachment: 262849 Committed r190916: <http://trac.webkit.org/changeset/190916>
WebKit Commit Bot
Comment 6 2015-10-12 19:10:14 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 7 2015-10-12 22:10:34 PDT
There are many JSC tests failures after this patch: <https://build.webkit.org/builders/Apple%20El%20Capitan%20Debug%20JSC%20%28Tests%29/builds/175/steps/jscore-test/logs/stdio> Could you please take a look?
Yusuke Suzuki
Comment 8 2015-10-12 22:33:15 PDT
(In reply to comment #7) > There are many JSC tests failures after this patch: > <https://build.webkit.org/builders/ > Apple%20El%20Capitan%20Debug%20JSC%20%28Tests%29/builds/175/steps/jscore- > test/logs/stdio> > > Could you please take a look? Thanks. I'll check this.
Yusuke Suzuki
Comment 9 2015-10-12 23:25:26 PDT
The symbol structure is not registered even if it is used for InferredType. Since Symbol / String InferredTypes claim that they don't have any structure, registerInferredType does not register these structures. I've added register structure for Symbol structure in DFGStructureRegisterationPhase as the same to String structure. Because, 1. InferredType::structure is only allowed for ObjectWithStructure / ObjectWithStructureOrOther. It seems clear to me that only ObjectWithStructure has structure. 2. Symbol is similar primitive value to String. So handling its structure in similar way to String is nice. I'll land the patch just adding registerStrucutre(Symbol Structure) in DFGStructureRegisterationPhase.
Yusuke Suzuki
Comment 10 2015-10-12 23:30:41 PDT
Yusuke Suzuki
Comment 11 2015-10-12 23:31:28 PDT
(In reply to comment #7) > There are many JSC tests failures after this patch: > <https://build.webkit.org/builders/ > Apple%20El%20Capitan%20Debug%20JSC%20%28Tests%29/builds/175/steps/jscore- > test/logs/stdio> > > Could you please take a look? Fixed :)
Note You need to log in before you can comment on or make changes to this bug.