Bug 124087 - Get rid of the bizarre Darwin/x86-only MacroAssembler::shouldBlindForSpecificArch(uintptr_t) overload
Summary: Get rid of the bizarre Darwin/x86-only MacroAssembler::shouldBlindForSpecific...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Filip Pizlo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-08 16:57 PST by Filip Pizlo
Modified: 2013-11-08 17:41 PST (History)
8 users (show)

See Also:


Attachments
the patch (2.55 KB, patch)
2013-11-08 16:57 PST, Filip Pizlo
msaboff: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2013-11-08 16:57:19 PST
Patch forthcoming.
Comment 1 Filip Pizlo 2013-11-08 16:57:53 PST
Created attachment 216464 [details]
the patch
Comment 2 Filip Pizlo 2013-11-08 17:27:51 PST
Landed in http://trac.webkit.org/changeset/158981
Comment 3 Darin Adler 2013-11-08 17:36:58 PST
Comment on attachment 216464 [details]
the patch

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

> Source/JavaScriptCore/assembler/MacroAssembler.h:992
> +        if (sizeof(void*) == 4)
> +            return shouldBlindForSpecificArch(static_cast<uint32_t>(value));
> +        return shouldBlindForSpecificArch(static_cast<uint64_t>(value));

Why doesn’t this work?

    return shouldBlindForSpecificArch(value);

I’d expect that overloading would take care of the rest. No need for the if statement.
Comment 4 Filip Pizlo 2013-11-08 17:41:29 PST
Comment on attachment 216464 [details]
the patch

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

>> Source/JavaScriptCore/assembler/MacroAssembler.h:992
>> +        return shouldBlindForSpecificArch(static_cast<uint64_t>(value));
> 
> Why doesn’t this work?
> 
>     return shouldBlindForSpecificArch(value);
> 
> I’d expect that overloading would take care of the rest. No need for the if statement.

On some compilers (including a version of clang in one of the toolchains that we build on), uint32_t, uint64_t and uintptr_t are different types.  Hence passing uintptr_t causes a compile error; the compiler claims that the call overload is ambiguous.

This patch fixes that compile error.

It also removes a Darwin-only, and x86-only hack to avoid this ambiguity.  See the code I remove in MacroAssemblerX86Common.