Summary: | Introduce Symbol type for property type inference | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||
Component: | New Bugs | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, fpizlo, ggaren, keith_miller, mark.lam, msaboff, saam | ||||||
Priority: | P2 | ||||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Yusuke Suzuki
2015-09-29 03:35:17 PDT
Created attachment 262059 [details]
Patch
WIP, not compiled yet
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); Created attachment 262849 [details]
Patch
Comment on attachment 262849 [details]
Patch
r=me
Comment on attachment 262849 [details] Patch Clearing flags on attachment: 262849 Committed r190916: <http://trac.webkit.org/changeset/190916> All reviewed patches have been landed. Closing bug. 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? (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. 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. Committed r190927: <http://trac.webkit.org/changeset/190927> (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 :) |