Bug 137279 - Fixed the Inspector to be able to properly distinguish between scope types
Summary: Fixed the Inspector to be able to properly distinguish between scope types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-30 17:16 PDT by Mark Lam
Modified: 2014-10-06 13:19 PDT (History)
10 users (show)

See Also:


Attachments
the patch. (15.39 KB, patch)
2014-09-30 17:27 PDT, Mark Lam
ggaren: review-
Details | Formatted Diff | Diff
patch 2: rework JSNameScope to take an explicit type argument. (30.92 KB, patch)
2014-10-01 14:59 PDT, Mark Lam
mark.lam: review-
Details | Formatted Diff | Diff
patch 3: fixed ARM builds (31.05 KB, patch)
2014-10-01 17:02 PDT, Mark Lam
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2014-09-30 17:16:45 PDT
The pre-existing code incorrectly labels Catch Scopes and Function Name Scopes as With Scopes.  This patch will fix this.
Comment 1 Mark Lam 2014-09-30 17:27:43 PDT
Created attachment 238980 [details]
the patch.
Comment 2 WebKit Commit Bot 2014-09-30 17:29:20 PDT
Attachment 238980 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h:80:  FUNCTION_NAME_SCOPE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 15 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Mark Lam 2014-09-30 17:33:12 PDT
(In reply to comment #2)
> ERROR: Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h:80:  FUNCTION_NAME_SCOPE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
> Total errors found: 1 in 15 files

I named it FUNCTION_NAME_SCOPE to be consistent with its pre-existing peers.  We can rename them all later if desired.
Comment 4 Geoffrey Garen 2014-10-01 11:39:33 PDT
Comment on attachment 238980 [details]
the patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=238980&action=review

> Source/JavaScriptCore/runtime/JSNameScope.h:70
> +        m_isCatchScope = !!(attributes & CatchScope);

It's a bad abstraction to use a property attribute to discover that an object is a catch scope. The two abstractions are unrelated, and relating them makes for spaghetti code.

Instead, you should use an explicit parameter to the JSNameScope constructor. The VM knows when it allocates a catch scope, and it only does so in a few places.
Comment 5 Joseph Pecoraro 2014-10-01 11:48:02 PDT
Comment on attachment 238980 [details]
the patch.

You could add a test for this. Do we have any existing tests for Scope Chain?

The inspector pieces look fine to me.
Comment 6 Mark Lam 2014-10-01 14:59:53 PDT
Created attachment 239052 [details]
patch 2: rework JSNameScope to take an explicit type argument.
Comment 7 WebKit Commit Bot 2014-10-01 15:01:18 PDT
Attachment 239052 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h:80:  FUNCTION_NAME_SCOPE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Mark Lam 2014-10-01 15:41:12 PDT
Comment on attachment 239052 [details]
patch 2: rework JSNameScope to take an explicit type argument.

This breaks the ARMv7 build.  Will fix and then post another patch.
Comment 9 Mark Lam 2014-10-01 17:02:55 PDT
Created attachment 239069 [details]
patch 3: fixed ARM builds
Comment 10 WebKit Commit Bot 2014-10-01 17:04:32 PDT
Attachment 239069 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h:80:  FUNCTION_NAME_SCOPE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Geoffrey Garen 2014-10-01 18:38:01 PDT
Comment on attachment 239069 [details]
patch 3: fixed ARM builds

r=me
Comment 12 Mark Lam 2014-10-02 08:17:02 PDT
Thanks for the reviews.  Landed in r174216: <http://trac.webkit.org/r174216>.
Comment 13 Brent Fulgham 2014-10-06 09:53:57 PDT
This broke the 64-bit Windows build.
Comment 14 Brent Fulgham 2014-10-06 09:59:30 PDT
argumentGPR4 is not defined for 64-bit Windows. This is "regT6" on other platforms, but "regT6" is called "argumentGPR2" on Windows.

How do we fix this?

Should I roll it out?
Comment 15 Mark Lam 2014-10-06 13:04:04 PDT
(In reply to comment #14)
> argumentGPR4 is not defined for 64-bit Windows. This is "regT6" on other platforms, but "regT6" is called "argumentGPR2" on Windows.

I'll have a fix coming soon.  Currently testing.
Comment 16 Mark Lam 2014-10-06 13:19:14 PDT
Build fix landed in r174360: <http://trac.webkit.org/r174360>.