Bug 115684 - ftp branch: Fix broken 32-bit build + clean up JITStubs.cpp a bit.
Summary: ftp branch: Fix broken 32-bit build + clean up JITStubs.cpp a bit.
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: 2013-05-06 17:06 PDT by Mark Lam
Modified: 2013-05-06 22:06 PDT (History)
5 users (show)

See Also:


Attachments
the patch. (5.12 KB, patch)
2013-05-06 17:10 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 2013-05-06 17:06:06 PDT
Remedy minor bit rotting in DFGSpeculativeJIT32_64.cpp.  JITStubs.cpp has a case for CPU(X86_64) && USE(JSVALUE32_64) which doesn't make sense.  Will delete this block of unnecessary code.  Also will add some line breaks and update some comments to more clearly delineate between the sections of code in JITStubs.cpp.
Comment 1 Mark Lam 2013-05-06 17:10:11 PDT
Created attachment 200857 [details]
the patch.
Comment 2 Geoffrey Garen 2013-05-06 17:14:45 PDT
Comment on attachment 200857 [details]
the patch.

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

> Source/JavaScriptCore/jit/JITStubs.cpp:312
> -#else // USE(JSVALUE32_64)
> +#else // !USE(JSVALUE32_64)
>  
>  #if COMPILER(GCC) && CPU(X86_64)
>  

I believe the style in other WebKit code is to annotate a dependent preprocessor macro with the heading for the macro's start. So, in this case, "USE(JSVALUE32_64)" is correct.
Comment 3 Mark Lam 2013-05-06 17:42:18 PDT
(In reply to comment #2)
> (From update of attachment 200857 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=200857&action=review
> 
> > Source/JavaScriptCore/jit/JITStubs.cpp:312
> > -#else // USE(JSVALUE32_64)
> > +#else // !USE(JSVALUE32_64)
> >  
> >  #if COMPILER(GCC) && CPU(X86_64)
> >  
> 
> I believe the style in other WebKit code is to annotate a dependent preprocessor macro with the heading for the macro's start. So, in this case, "USE(JSVALUE32_64)" is correct.

I'll revert this !USE(JSVALUE32_64) change for this commit, but for future reference, what is the right thing to do then when we have a case like the following?

#if CPU(x86)
...
#elif CPU(X86_64)
...
#else // what comment is appropriate here?
#endif // whacomment is appropriate here?
Comment 4 Mark Lam 2013-05-06 17:47:01 PDT
Thanks for the review.  Landed in r149655: <http://trac.webkit.org/changeset/149655>.
Comment 5 Geoffrey Garen 2013-05-06 22:06:32 PDT
> what is the right thing to do then when we have a case like the following?
> 
> #if CPU(x86)
> ...
> #elif CPU(X86_64)
> ...
> #else // what comment is appropriate here?
> #endif // whacomment is appropriate here?

I don't think we have a clear guideline on this. Thinking about it now, I might choose not to use #elif, and instead:

#if CPU(X86)
#endif // CPU(X86)

#if CPU(X86_64)
#endif // CPU(X86_64)

#if !CPU(X86) && !CPU(X86_64)
#endif // !CPU(X86) && !CPU(X86_64)

The phrase "else" is hard to decipher when it flows hundred of lines after an "if", possibly with intervening "#elif".