Bug 151079 - Create an FTLExceptionHandlerManager abstraction
Summary: Create an FTLExceptionHandlerManager abstraction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-09 22:52 PST by Saam Barati
Modified: 2015-11-10 14:51 PST (History)
11 users (show)

See Also:


Attachments
patch (32.64 KB, patch)
2015-11-10 11:54 PST, Saam Barati
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2015-11-09 22:52:54 PST
I think some of the exception handling state and code in FTLCompile can use a nice
abstraction or just a different file to live in.
Comment 1 Saam Barati 2015-11-09 23:02:10 PST
This should also handle the case where it shouldn't bother generating call site indices for tail calls.
Comment 2 Saam Barati 2015-11-10 11:54:30 PST
Created attachment 265212 [details]
patch
Comment 3 WebKit Commit Bot 2015-11-10 11:56:23 PST
Attachment 265212 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ftl/FTLExceptionHandlerManager.h:45:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
ERROR: Source/JavaScriptCore/ftl/FTLExceptionHandlerManager.h:54:  The parameter name "state" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Mark Lam 2015-11-10 12:54:54 PST
Comment on attachment 265212 [details]
patch

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

r=me with comments.

> Source/JavaScriptCore/CMakeLists.txt:-993
> +        ftl/FTLDataSection.cpp
>          ftl/FTLDWARFDebugLineInfo.cpp
>          ftl/FTLDWARFRegister.cpp
> -        ftl/FTLDataSection.cpp

nit: Technically, FTLDWARFRegister.cpp should come before FTLDataSection.cpp according to ASCII sort order.  However, I see that the vcxproj files do it differently.  I'll let you decide on which is best.

> Source/JavaScriptCore/ftl/FTLExceptionHandlerManager.cpp:122
> +    if (!exit.m_exceptionHandlerCallSiteIndex)
> +        exit.m_exceptionHandlerCallSiteIndex = m_state.jitCode->common.addUniqueCallSiteIndex(origin);

This part is new, and not present in the original generateOrGetAlreadyGeneratedCallSiteIndex().  I see that this used to be assigned at line 613 in fixFunctionBasedOnStackMaps(), and it still is assigned there.  Is there a reason that we need to have a separate assignment here?  Can it be one or the other (and not both)?
Comment 5 Saam Barati 2015-11-10 13:07:53 PST
Comment on attachment 265212 [details]
patch

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

>> Source/JavaScriptCore/ftl/FTLExceptionHandlerManager.cpp:122
>> +        exit.m_exceptionHandlerCallSiteIndex = m_state.jitCode->common.addUniqueCallSiteIndex(origin);
> 
> This part is new, and not present in the original generateOrGetAlreadyGeneratedCallSiteIndex().  I see that this used to be assigned at line 613 in fixFunctionBasedOnStackMaps(), and it still is assigned there.  Is there a reason that we need to have a separate assignment here?  Can it be one or the other (and not both)?

You're right.
We should never need to generate one here.
I'll just assert that we have a valid callsiteindex here.
Comment 6 Saam Barati 2015-11-10 14:51:35 PST
landed in:
http://trac.webkit.org/changeset/192273