[Webkit-unassigned] [Bug 148562] Web Inspector: Type bubbles missing for methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 28 15:16:28 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=148562

--- Comment #4 from Saam Barati <sbarati at apple.com> ---
(In reply to comment #3)
> There appear to be multiple issues here. I've broken them out into these
> test cases.
> 
>   1. I don't see any divot registered for computed property methods:
>       TEST: o = { ["computed"]() { return 1; }; o.computed();
>       TEST: o = { ["computed"]   () { return 1; }; o.computed();
> 
>   2. Object literal property methods.
>       TEST: o = { method1() { return 1; }; o.method1();
> 
>   3. Object literal property methods with spaces in the declaration.
>       TEST: o = { method1  () { return 1; }; o.method1();
> 
> The patch below gets (2), which I think is the common case of object literal
> property methods, working. It seems the divot for (2) is the last character
> of the method name, but the divot for (3) is the '(' character. All of these
> could likely benefit from cleanup in the backend.
> 
> > --- a/Source/JavaScriptCore/runtime/TypeProfiler.cpp
> > +++ b/Source/JavaScriptCore/runtime/TypeProfiler.cpp
> > @@ -783,6 +787,12 @@ WebInspector.ScriptSyntaxTree = class ScriptSyntaxTree extends WebInspector.Obje
> >              if (result.kind === "get" || result.kind === "set") {
> >                  result.value.isGetterOrSetter = true;
> >                  result.value.getterOrSetterRange = result.key.range;
> > +            } else if (node.method) {
> > +                // FIXME: <https://webkit.org/b/143171> Web Inspector: Improve Type Profiler Support for ES6 Syntax
> > +                // The backend has confusing handling of the divot here.
> > +                // Though this is not always result.key.range[1], it often is.
> > +                result.value.isGetterOrSetter = true;
> > +                result.value.getterOrSetterRange = [result.key.range[1], result.value.range[1]];
> >              }
> >              break;
> >          case "ReturnStatement":
> 
> Saam, maybe you can advise me here, since I understand this is a particular
> tricky area of Type Profiling (divots).

Sure. There are a few things at play here:
1. We need a better name for isGetterOrSetter. I think this really means how things are formed
textually in the JS program: i.e, there is no "function" keyword, but just "get"/"set"/<methodName>. We should probably
come up with a good name the expresses this idea.

2. It looks like some divots are wrong and should be fixed. The new approach is to have these divots
on the earliest possible character that describes a function: "s" in "set", "g" in "get",
"m" in "method1", etc. So we should use the "[" for computed properties. We should
fix these divots in JSC to be consistent. It looks like (2)/(3) are not consistent.
I'm not sure about (1) but we should make it "[".

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150828/e39f05a3/attachment.html>


More information about the webkit-unassigned mailing list