Bug 151622 - Don't hide the argument name inside for block in AirIteratedRegisterCoalescing.cpp
Summary: Don't hide the argument name inside for block in AirIteratedRegisterCoalescin...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords:
Depends on:
Blocks: 152248
  Show dependency treegraph
 
Reported: 2015-11-26 05:53 PST by Csaba Osztrogonác
Modified: 2016-02-12 04:21 PST (History)
8 users (show)

See Also:


Attachments
Patch (1.74 KB, patch)
2015-11-26 05:58 PST, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff
Patch for landing (1.90 KB, patch)
2015-12-01 00:08 PST, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2015-11-26 05:53:48 PST
Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp

void addEdges(Inst& inst, const HashSet<Tmp>& liveTmp)
{
    // All the Def()s interfere with everthing live.
    inst.forEachDefAndExtraClobberedTmp(type, [&] (Tmp& arg) {
        for (const Tmp& liveTmp : liveTmp) {                        <================== BANG!
            if (liveTmp.isGP() == (type == Arg::GP))
                addEdge(arg, liveTmp);
        }
...
}

It's not so elegant to hide the liveTmp argument inside the for loop
with using the same variable name. Additionally GCC can't build it:

../../Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp: In instantiation of 'JSC::B3::Air::IteratedRegisterCoalescingAllocator<type>::addEdges(JSC::B3::Air::Inst&, const WTF::HashSet<JSC::B3::Air::Tmp>&)::<lambda(JSC::B3::Air::Tmp&)> [with JSC::B3::Air::Arg::Type type = (JSC::B3::Air::Arg::Type)0]':
../../Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp:302:53:   required from 'struct JSC::B3::Air::IteratedRegisterCoalescingAllocator<type>::addEdges(JSC::B3::Air::Inst&, const WTF::HashSet<JSC::B3::Air::Tmp>&) [with JSC::B3::Air::Arg::Type type = (JSC::B3::Air::Arg::Type)0]::<lambda(class JSC::B3::Air::Tmp&)>'
../../Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp:302:9:   required from 'void JSC::B3::Air::IteratedRegisterCoalescingAllocator<type>::addEdges(JSC::B3::Air::Inst&, const WTF::HashSet<JSC::B3::Air::Tmp>&) [with JSC::B3::Air::Arg::Type type = (JSC::B3::Air::Arg::Type)0]'
../../Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp:199:44:   required from 'void JSC::B3::Air::IteratedRegisterCoalescingAllocator<type>::build(JSC::B3::Air::Inst&, const JSC::B3::Air::Liveness<JSC::B3::Air::Tmp>::LocalCalc&) [with JSC::B3::Air::Arg::Type type = (JSC::B3::Air::Arg::Type)0]'
../../Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp:1072:50:   required from here
../../Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp:303:13: error: 'begin' was not declared in this scope

...
Comment 1 Csaba Osztrogonác 2015-11-26 05:58:05 PST
Created attachment 266181 [details]
Patch
Comment 2 WebKit Commit Bot 2015-11-30 22:14:23 PST
Comment on attachment 266181 [details]
Patch

Rejecting attachment 266181 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 266181, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
EWS/WebKit

Parsed 2 diffs from patch file(s).
patching file Source/JavaScriptCore/ChangeLog
Hunk #1 succeeded at 1 with fuzz 3.
patching file Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp
Hunk #1 FAILED at 296.
1 out of 1 hunk FAILED -- saving rejects to file Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp.rej

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Darin Adler']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.webkit.org/results/500210
Comment 3 Csaba Osztrogonác 2015-12-01 00:08:49 PST
Created attachment 266337 [details]
Patch for landing
Comment 4 WebKit Commit Bot 2015-12-01 01:05:50 PST
Comment on attachment 266337 [details]
Patch for landing

Clearing flags on attachment: 266337

Committed r192873: <http://trac.webkit.org/changeset/192873>
Comment 5 WebKit Commit Bot 2015-12-01 01:05:54 PST
All reviewed patches have been landed.  Closing bug.