Bug 177586

Summary: Enable gigacage on iOS
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Filip Pizlo <fpizlo>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cgarcia, clopez, commit-queue, ggaren, jfbastien, keith_miller, mark.lam, mcatanzaro, msaboff, ossy, rmorisset, saam, webkit-bug-importer, ysuzuki, zan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 177664, 178182    
Bug Blocks: 174917    
Attachments:
Description Flags
maybe it will work
none
seems to work fine
msaboff: review+
the patch
fpizlo: review+
a better approach
none
better patch
none
the patch
jfbastien: review+, buildbot: commit-queue-
Archive of layout-test-results from ews114 for mac-elcapitan
none
patch for landing none

Description Filip Pizlo 2017-09-27 19:15:03 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2017-09-27 20:41:53 PDT
Created attachment 322061 [details]
maybe it will work

This is a super wimpy version of gigacage for iOS.  I think it's a good place to start.
Comment 2 Filip Pizlo 2017-09-28 08:53:10 PDT
Created attachment 322084 [details]
seems to work fine
Comment 3 Build Bot 2017-09-28 08:55:42 PDT
Attachment 322084 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
ERROR: Source/bmalloc/ChangeLog:1:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]
Total errors found: 2 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Michael Saboff 2017-09-28 09:32:18 PDT
Comment on attachment 322084 [details]
seems to work fine

r=me
Comment 5 Filip Pizlo 2017-09-28 09:32:51 PDT
Created attachment 322088 [details]
the patch
Comment 6 Filip Pizlo 2017-09-28 09:33:13 PDT
Comment on attachment 322088 [details]
the patch

And now, with a changelog!
Comment 7 Filip Pizlo 2017-09-28 09:50:10 PDT
Comment on attachment 322088 [details]
the patch

r=michael on the previous version of this patch
Comment 8 Mark Lam 2017-09-28 09:52:09 PDT
Comment on attachment 322088 [details]
the patch

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

> Source/JavaScriptCore/ChangeLog:8
> +        The hardest part of enabling Gigacage on iOS is that it requires loading global variables whil

typo: /whil/while/
Comment 9 Filip Pizlo 2017-09-28 12:50:41 PDT
Landed in https://trac.webkit.org/changeset/222625/webkit
Comment 10 Radar WebKit Bug Importer 2017-09-28 12:52:05 PDT
<rdar://problem/34721892>
Comment 11 WebKit Commit Bot 2017-09-29 09:45:10 PDT
Re-opened since this is blocked by bug 177664
Comment 12 Filip Pizlo 2017-09-29 13:03:39 PDT
Created attachment 322223 [details]
a better approach

I'm still testing it.
Comment 13 Build Bot 2017-09-29 13:06:31 PDT
Attachment 322223 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:57:  g_wasEnabled is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:258:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:167:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:168:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/bmalloc/bmalloc/HeapKind.cpp:26:  Found header this file implements before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
Total errors found: 5 in 19 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 14 Filip Pizlo 2017-09-29 23:19:05 PDT
Created attachment 322284 [details]
better patch

I think this will actually work.
Comment 15 Build Bot 2017-09-29 23:22:11 PDT
Attachment 322284 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/HeapKind.cpp:26:  Found header this file implements before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:57:  g_wasEnabled is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:258:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:167:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:168:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 5 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 16 Filip Pizlo 2017-09-30 00:29:44 PDT
Looks like GTK is red because gcc segfaulted.
Comment 17 Filip Pizlo 2017-10-05 21:41:33 PDT
Created attachment 322985 [details]
the patch

Rebased and tested it more
Comment 18 Build Bot 2017-10-05 21:44:30 PDT
Attachment 322985 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/HeapKind.cpp:26:  Found header this file implements before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:57:  g_wasEnabled is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:258:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:167:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:168:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 5 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 19 Build Bot 2017-10-06 02:38:25 PDT
Comment on attachment 322985 [details]
the patch

Attachment 322985 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/4779049

New failing tests:
workers/wasm-long-compile.html
Comment 20 Build Bot 2017-10-06 02:38:27 PDT
Created attachment 323002 [details]
Archive of layout-test-results from ews114 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 21 JF Bastien 2017-10-06 09:19:53 PDT
Comment on attachment 322985 [details]
the patch

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

r=me with some comments.

> Source/JavaScriptCore/ChangeLog:8
> +        The hardest part of enabling Gigacage on iOS is that it requires loading global variables whil

"while"

> Source/bmalloc/bmalloc/Gigacage.cpp:108
> +} // anonymous namespce

I like that you moved the typo too.

> Source/bmalloc/bmalloc/Gigacage.h:41
> +#define GIGACAGE_ALLOCATION_CAN_FAIL 1

Can this be an option instead? Seems like we want to be able to disable it.

It would also be nice for the changelog to say what happens when it goes from using gigacage to it failing. What happens to allocations then, is it monotonic, etc.

> Source/bmalloc/bmalloc/Gigacage.h:72
> +BINLINE bool wasEnabled() { return g_wasEnabled; }

Can you just export the function, instead of exposing the bool?

> Source/bmalloc/bmalloc/HeapKind.h:97
> +    default:

I'd just make this Primary and have no default. That way the compiler will yell if another kind is added.

> Source/bmalloc/bmalloc/HeapKind.h:113
> +    default:

I'd just make this Primary and have no default. That way the compiler will yell if another kind is added.
Comment 22 Filip Pizlo 2017-10-06 09:38:37 PDT
(In reply to JF Bastien from comment #21)
> Comment on attachment 322985 [details]
> the patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=322985&action=review
> 
> r=me with some comments.
> 
> > Source/JavaScriptCore/ChangeLog:8
> > +        The hardest part of enabling Gigacage on iOS is that it requires loading global variables whil
> 
> "while"

Fixed.

> 
> > Source/bmalloc/bmalloc/Gigacage.cpp:108
> > +} // anonymous namespce
> 
> I like that you moved the typo too.

Fixed.

> 
> > Source/bmalloc/bmalloc/Gigacage.h:41
> > +#define GIGACAGE_ALLOCATION_CAN_FAIL 1
> 
> Can this be an option instead? Seems like we want to be able to disable it.

Can't be an "Options" option because this is bmalloc, so it sits below Options.

> 
> It would also be nice for the changelog to say what happens when it goes
> from using gigacage to it failing. What happens to allocations then, is it
> monotonic, etc.

I'll add blurbs.

> 
> > Source/bmalloc/bmalloc/Gigacage.h:72
> > +BINLINE bool wasEnabled() { return g_wasEnabled; }
> 
> Can you just export the function, instead of exposing the bool?

I need things to inline it and read the bool directly for speed.

> 
> > Source/bmalloc/bmalloc/HeapKind.h:97
> > +    default:
> 
> I'd just make this Primary and have no default. That way the compiler will
> yell if another kind is added.

This was deliberate!  Your approach would cause the compiler to emit more branches.  It would have to emit a separate branch for Primary.  This could work, but I think it's sufficiently ugly that I don't want it:

switch (things) {
case SomeCase:
case SomeOtherCase:
    return 1;
case YetAnotherCase:
}
return 0; // The implicit default will fall through to here also, so there aren't any extra branches.

> 
> > Source/bmalloc/bmalloc/HeapKind.h:113
> > +    default:
> 
> I'd just make this Primary and have no default. That way the compiler will
> yell if another kind is added.

Ditto.
Comment 23 Filip Pizlo 2017-10-06 09:39:40 PDT
(In reply to Build Bot from comment #20)
> Created attachment 323002 [details]
> Archive of layout-test-results from ews114 for mac-elcapitan
> 
> The attached test failures were seen while running run-webkit-tests on the
> mac-debug-ews.
> Bot: ews114  Port: mac-elcapitan  Platform: Mac OS X 10.11.6

This crash looks totally unrelated.
Comment 24 Filip Pizlo 2017-10-06 09:46:13 PDT
Created attachment 323022 [details]
patch for landing
Comment 25 Build Bot 2017-10-06 09:48:19 PDT
Attachment 323022 [details] did not pass style-queue:


ERROR: Source/bmalloc/bmalloc/HeapKind.cpp:26:  Found header this file implements before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted.  [build/include_order] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:57:  g_wasEnabled is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.cpp:258:  An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:167:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/bmalloc/bmalloc/Gigacage.h:168:  The parameter name "kind" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 5 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 26 Filip Pizlo 2017-10-06 10:38:10 PDT
GTK/WPE build failures look to be in trunk.
Comment 27 Filip Pizlo 2017-10-06 19:29:39 PDT
Landed in https://trac.webkit.org/changeset/223015/webkit
Comment 28 Csaba Osztrogonác 2017-10-07 09:49:50 PDT
FYI, it broke the AArch64 build on Linux, see https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/1878 for details. Note: I'm not interested in fixing, investigate, help fixing, etc myself. I just reported it, maybe anyone else is interested in fixing it.
Comment 29 Filip Pizlo 2017-10-07 10:37:49 PDT
(In reply to Csaba Osztrogonác from comment #28)
> FYI, it broke the AArch64 build on Linux, see
> https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> 1878 for details. Note: I'm not interested in fixing, investigate, help
> fixing, etc myself. I just reported it, maybe anyone else is interested in
> fixing it.

That’s unfortunate. I think we should not claim to run on arm64/Linux if nobody is around to fix things. I don’t even have such a device to test on.
Comment 30 Yusuke Suzuki 2017-10-07 19:01:12 PDT
(In reply to Filip Pizlo from comment #29)
> (In reply to Csaba Osztrogonác from comment #28)
> > FYI, it broke the AArch64 build on Linux, see
> > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > fixing it.
> 
> That’s unfortunate. I think we should not claim to run on arm64/Linux if
> nobody is around to fix things. I don’t even have such a device to test on.

Yeah, that's sad thing. I don't have any ARM64 machines too, (except for iPhone :P).
Maybe, disabling it right now for ARM64 Linux would be the easiest option.
Comment 31 Yusuke Suzuki 2017-10-07 19:06:34 PDT
Committed r223025: <http://trac.webkit.org/changeset/223025>
Comment 32 Filip Pizlo 2017-10-07 19:10:59 PDT
(In reply to Yusuke Suzuki from comment #30)
> (In reply to Filip Pizlo from comment #29)
> > (In reply to Csaba Osztrogonác from comment #28)
> > > FYI, it broke the AArch64 build on Linux, see
> > > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > > fixing it.
> > 
> > That’s unfortunate. I think we should not claim to run on arm64/Linux if
> > nobody is around to fix things. I don’t even have such a device to test on.
> 
> Yeah, that's sad thing. I don't have any ARM64 machines too, (except for
> iPhone :P).
> Maybe, disabling it right now for ARM64 Linux would be the easiest option.

I think we should disable the JIT on that port. 

It would be a lot better if partly-working, partly-maintained, and party-tested ports were maintained out of tree.
Comment 33 Yusuke Suzuki 2017-10-07 19:19:43 PDT
(In reply to Filip Pizlo from comment #32)
> (In reply to Yusuke Suzuki from comment #30)
> > (In reply to Filip Pizlo from comment #29)
> > > (In reply to Csaba Osztrogonác from comment #28)
> > > > FYI, it broke the AArch64 build on Linux, see
> > > > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > > > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > > > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > > > fixing it.
> > > 
> > > That’s unfortunate. I think we should not claim to run on arm64/Linux if
> > > nobody is around to fix things. I don’t even have such a device to test on.
> > 
> > Yeah, that's sad thing. I don't have any ARM64 machines too, (except for
> > iPhone :P).
> > Maybe, disabling it right now for ARM64 Linux would be the easiest option.
> 
> I think we should disable the JIT on that port. 
> 
> It would be a lot better if partly-working, partly-maintained, and
> party-tested ports were maintained out of tree.

I think ARM64 Linux JIT itself is not so bad status right now (it is tested in the bot, and the count of failures are fairly small). I don't think we do not need to disable it immediately.
But if the failure count becomes super large and nobody maintains it, we should disable it.
Comment 34 Yusuke Suzuki 2017-10-07 19:21:38 PDT
(In reply to Yusuke Suzuki from comment #33)
> 
> I think ARM64 Linux JIT itself is not so bad status right now (it is tested
> in the bot, and the count of failures are fairly small). I don't think we do
> not need to disable it immediately.
> But if the failure count becomes super large and nobody maintains it, we
> should disable it.

I think this good status is largely due to,

1. Darwin ARM64 is basically usable for Linux ARM64.
2. We have much stable x64 Linux JSC support, which maintains C++ runtime part of JSC on Linux well.
Comment 35 Filip Pizlo 2017-10-07 19:23:24 PDT
(In reply to Yusuke Suzuki from comment #33)
> (In reply to Filip Pizlo from comment #32)
> > (In reply to Yusuke Suzuki from comment #30)
> > > (In reply to Filip Pizlo from comment #29)
> > > > (In reply to Csaba Osztrogonác from comment #28)
> > > > > FYI, it broke the AArch64 build on Linux, see
> > > > > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > > > > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > > > > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > > > > fixing it.
> > > > 
> > > > That’s unfortunate. I think we should not claim to run on arm64/Linux if
> > > > nobody is around to fix things. I don’t even have such a device to test on.
> > > 
> > > Yeah, that's sad thing. I don't have any ARM64 machines too, (except for
> > > iPhone :P).
> > > Maybe, disabling it right now for ARM64 Linux would be the easiest option.
> > 
> > I think we should disable the JIT on that port. 
> > 
> > It would be a lot better if partly-working, partly-maintained, and
> > party-tested ports were maintained out of tree.
> 
> I think ARM64 Linux JIT itself is not so bad status right now (it is tested
> in the bot, and the count of failures are fairly small). I don't think we do
> not need to disable it immediately.
> But if the failure count becomes super large and nobody maintains it, we
> should disable it.

Imagine if someone needed to ship trunk WebKit on arm64/Linux. Would we want them to use cloop or the JIT?  I would argue that it would be better if they shipped cloop, if they were using the current trunk. I think this would be better because anyone shipping a product would rather ship something that actually works than something that performs well on benchmarks. 

Based on this, I think we should disable the JIT on arm64/Linux. It’s not enough to just have some bots that build it or even periodically runs out tests. For a JIT port to be shippable it needs some active attention.
Comment 36 Filip Pizlo 2017-10-07 19:24:58 PDT
(In reply to Yusuke Suzuki from comment #34)
> (In reply to Yusuke Suzuki from comment #33)
> > 
> > I think ARM64 Linux JIT itself is not so bad status right now (it is tested
> > in the bot, and the count of failures are fairly small). I don't think we do
> > not need to disable it immediately.
> > But if the failure count becomes super large and nobody maintains it, we
> > should disable it.
> 
> I think this good status is largely due to,
> 
> 1. Darwin ARM64 is basically usable for Linux ARM64.
> 2. We have much stable x64 Linux JSC support, which maintains C++ runtime
> part of JSC on Linux well.

Right, but there are differences that have to be maintained, like errata and ABI subtleties.
Comment 37 Yusuke Suzuki 2017-10-07 19:33:00 PDT
(In reply to Filip Pizlo from comment #36)
> (In reply to Yusuke Suzuki from comment #34)
> > (In reply to Yusuke Suzuki from comment #33)
> > > 
> > > I think ARM64 Linux JIT itself is not so bad status right now (it is tested
> > > in the bot, and the count of failures are fairly small). I don't think we do
> > > not need to disable it immediately.
> > > But if the failure count becomes super large and nobody maintains it, we
> > > should disable it.
> > 
> > I think this good status is largely due to,
> > 
> > 1. Darwin ARM64 is basically usable for Linux ARM64.
> > 2. We have much stable x64 Linux JSC support, which maintains C++ runtime
> > part of JSC on Linux well.
> 
> Right, but there are differences that have to be maintained, like errata and
> ABI subtleties.

Right. I think we need some discussions on mailing list before disabling ARM64 Linux JIT.
But if nobody is interested in maintaining this, I support disabling it.

I don't think removing code would be required because I don't think any ARM64/Linux JIT specific code exists in JSC right now.
And I do not think we should not have a ARM64/Linux bot with JIT.
But the default option should be disabling JIT if there is no maintainer.
Comment 38 Filip Pizlo 2017-10-07 19:56:50 PDT
(In reply to Yusuke Suzuki from comment #37)
> (In reply to Filip Pizlo from comment #36)
> > (In reply to Yusuke Suzuki from comment #34)
> > > (In reply to Yusuke Suzuki from comment #33)
> > > > 
> > > > I think ARM64 Linux JIT itself is not so bad status right now (it is tested
> > > > in the bot, and the count of failures are fairly small). I don't think we do
> > > > not need to disable it immediately.
> > > > But if the failure count becomes super large and nobody maintains it, we
> > > > should disable it.
> > > 
> > > I think this good status is largely due to,
> > > 
> > > 1. Darwin ARM64 is basically usable for Linux ARM64.
> > > 2. We have much stable x64 Linux JSC support, which maintains C++ runtime
> > > part of JSC on Linux well.
> > 
> > Right, but there are differences that have to be maintained, like errata and
> > ABI subtleties.
> 
> Right. I think we need some discussions on mailing list before disabling
> ARM64 Linux JIT.
> But if nobody is interested in maintaining this, I support disabling it.
> 
> I don't think removing code would be required because I don't think any
> ARM64/Linux JIT specific code exists in JSC right now.

There totally is some. :-)

It’s not a lot, but I propose to remove it if it is dead to testing. We have no way of knowing if it has survived refactorings. 

> And I do not think we should not have a ARM64/Linux bot with JIT.
> But the default option should be disabling JIT if there is no maintainer.

Yeah.
Comment 39 Zan Dobersek 2017-10-09 12:43:04 PDT
(In reply to Filip Pizlo from comment #29)
> (In reply to Csaba Osztrogonác from comment #28)
> > FYI, it broke the AArch64 build on Linux, see
> > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > fixing it.
> 
> That’s unfortunate. I think we should not claim to run on arm64/Linux if
> nobody is around to fix things. I don’t even have such a device to test on.

Linux port maintainers are committed to maintaining JIT levels on ARM64.  We've actually (while enabling FTL) in the past committed fixes that might as well have positively affected the iOS platform, barring some peculiarities in the Apple ARM64 CPU implementations.

Ossy doesn't represent us in that regard, even if he's actually in control of the tester builders and cares enough to report any failures as they occur, and especially when he immediately relieves himself from any work to fix things.
Comment 40 Filip Pizlo 2017-10-09 13:01:00 PDT
(In reply to Zan Dobersek from comment #39)
> (In reply to Filip Pizlo from comment #29)
> > (In reply to Csaba Osztrogonác from comment #28)
> > > FYI, it broke the AArch64 build on Linux, see
> > > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > > fixing it.
> > 
> > That’s unfortunate. I think we should not claim to run on arm64/Linux if
> > nobody is around to fix things. I don’t even have such a device to test on.
> 
> Linux port maintainers are committed to maintaining JIT levels on ARM64. 
> We've actually (while enabling FTL) in the past committed fixes that might
> as well have positively affected the iOS platform, barring some
> peculiarities in the Apple ARM64 CPU implementations.
> 
> Ossy doesn't represent us in that regard, even if he's actually in control
> of the tester builders and cares enough to report any failures as they
> occur, and especially when he immediately relieves himself from any work to
> fix things.

Is there a bot running Linux/arm64 tests and benchmarks?  Without those things, you might as well use the cloop.

The fixes I remember were specific to non-Apple CPUs.
Comment 41 WebKit Commit Bot 2017-10-09 14:14:49 PDT
Re-opened since this is blocked by bug 178093
Comment 42 Keith Miller 2017-10-09 14:19:04 PDT
We rolled this out because it most likely regressed Kraken on iOS by 20%. It may have also regressed ARES-6, JetStream and JSBench.
Comment 43 Keith Miller 2017-10-09 14:19:42 PDT
Reopening because bugzilla conflict resolution sucks.
Comment 44 Filip Pizlo 2017-10-09 18:45:02 PDT
Relanded in https://trac.webkit.org/changeset/223113/webkit
Comment 45 Carlos Alberto Lopez Perez 2017-10-10 04:11:19 PDT
(In reply to Filip Pizlo from comment #40)
> Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> things, you might as well use the cloop.
> 

Yes, there are Linux JSC ARMv7 and ARM64 bots here: https://build.webkit.org/waterfall?category=misc (currently maintained by Ossy).

I will look into adding more Linux JSC bots for ARM64 and ARMv7-Thumb2 (as well as EWS bots) maintained by Igalia ASAP.
Comment 46 Zan Dobersek 2017-10-10 04:25:46 PDT
(In reply to Filip Pizlo from comment #40)
> (In reply to Zan Dobersek from comment #39)
> > (In reply to Filip Pizlo from comment #29)
> > > (In reply to Csaba Osztrogonác from comment #28)
> > > > FYI, it broke the AArch64 build on Linux, see
> > > > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > > > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > > > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > > > fixing it.
> > > 
> > > That’s unfortunate. I think we should not claim to run on arm64/Linux if
> > > nobody is around to fix things. I don’t even have such a device to test on.
> > 
> > Linux port maintainers are committed to maintaining JIT levels on ARM64. 
> > We've actually (while enabling FTL) in the past committed fixes that might
> > as well have positively affected the iOS platform, barring some
> > peculiarities in the Apple ARM64 CPU implementations.
> > 
> > Ossy doesn't represent us in that regard, even if he's actually in control
> > of the tester builders and cares enough to report any failures as they
> > occur, and especially when he immediately relieves himself from any work to
> > fix things.
> 
> Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> things, you might as well use the cloop.
> 

There's existing ones, but we'll be adding our own.

> 
> The fixes I remember were specific to non-Apple CPUs.

r215731 isn't. It fixed test failures on Linux. I wouldn't know about iOS because there's no public testers.
https://trac.webkit.org/changeset/215731/webkit
Comment 47 Filip Pizlo 2017-10-10 05:36:51 PDT
(In reply to Zan Dobersek from comment #46)
> (In reply to Filip Pizlo from comment #40)
> > (In reply to Zan Dobersek from comment #39)
> > > (In reply to Filip Pizlo from comment #29)
> > > > (In reply to Csaba Osztrogonác from comment #28)
> > > > > FYI, it broke the AArch64 build on Linux, see
> > > > > https://build.webkit.org/builders/JSCOnly%20Linux%20AArch64%20Release/builds/
> > > > > 1878 for details. Note: I'm not interested in fixing, investigate, help
> > > > > fixing, etc myself. I just reported it, maybe anyone else is interested in
> > > > > fixing it.
> > > > 
> > > > That’s unfortunate. I think we should not claim to run on arm64/Linux if
> > > > nobody is around to fix things. I don’t even have such a device to test on.
> > > 
> > > Linux port maintainers are committed to maintaining JIT levels on ARM64. 
> > > We've actually (while enabling FTL) in the past committed fixes that might
> > > as well have positively affected the iOS platform, barring some
> > > peculiarities in the Apple ARM64 CPU implementations.
> > > 
> > > Ossy doesn't represent us in that regard, even if he's actually in control
> > > of the tester builders and cares enough to report any failures as they
> > > occur, and especially when he immediately relieves himself from any work to
> > > fix things.
> > 
> > Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> > things, you might as well use the cloop.
> > 
> 
> There's existing ones, but we'll be adding our own.
> 
> > 
> > The fixes I remember were specific to non-Apple CPUs.
> 
> r215731 isn't. It fixed test failures on Linux. I wouldn't know about iOS
> because there's no public testers.
> https://trac.webkit.org/changeset/215731/webkit

That looks like it might be due to cpu differences.
Comment 48 Filip Pizlo 2017-10-10 05:38:11 PDT
(In reply to Carlos Alberto Lopez Perez from comment #45)
> (In reply to Filip Pizlo from comment #40)
> > Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> > things, you might as well use the cloop.
> > 
> 
> Yes, there are Linux JSC ARMv7 and ARM64 bots here:
> https://build.webkit.org/waterfall?category=misc (currently maintained by
> Ossy).
> 
> I will look into adding more Linux JSC bots for ARM64 and ARMv7-Thumb2 (as
> well as EWS bots) maintained by Igalia ASAP.

The 32-bit JITs are not maintained anymore. We are probably going to remove that code soon.
Comment 49 Carlos Alberto Lopez Perez 2017-10-10 05:48:51 PDT
(In reply to Filip Pizlo from comment #48)
> (In reply to Carlos Alberto Lopez Perez from comment #45)
> > (In reply to Filip Pizlo from comment #40)
> > > Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> > > things, you might as well use the cloop.
> > > 
> > 
> > Yes, there are Linux JSC ARMv7 and ARM64 bots here:
> > https://build.webkit.org/waterfall?category=misc (currently maintained by
> > Ossy).
> > 
> > I will look into adding more Linux JSC bots for ARM64 and ARMv7-Thumb2 (as
> > well as EWS bots) maintained by Igalia ASAP.
> 
> The 32-bit JITs are not maintained anymore. We are probably going to remove
> that code soon.

The JIT on ARMv7 Thumb2 is currently extensively used in production by a lot of people (including us). It receives a fair amount of testing.
Comment 50 Filip Pizlo 2017-10-10 06:37:06 PDT
(In reply to Carlos Alberto Lopez Perez from comment #49)
> (In reply to Filip Pizlo from comment #48)
> > (In reply to Carlos Alberto Lopez Perez from comment #45)
> > > (In reply to Filip Pizlo from comment #40)
> > > > Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> > > > things, you might as well use the cloop.
> > > > 
> > > 
> > > Yes, there are Linux JSC ARMv7 and ARM64 bots here:
> > > https://build.webkit.org/waterfall?category=misc (currently maintained by
> > > Ossy).
> > > 
> > > I will look into adding more Linux JSC bots for ARM64 and ARMv7-Thumb2 (as
> > > well as EWS bots) maintained by Igalia ASAP.
> > 
> > The 32-bit JITs are not maintained anymore. We are probably going to remove
> > that code soon.
> 
> The JIT on ARMv7 Thumb2 is currently extensively used in production by a lot
> of people (including us). It receives a fair amount of testing.

When we add new features to JSC, we don’t want to also add them to 32-bit. There are now many features that have never been ported to 32-bit. This is because there is basically zero manpower going into 32-but maintenance.

You can continue to use that code from a branch or fork if it’s removed from trunk.
Comment 51 Zan Dobersek 2017-10-10 06:59:40 PDT
(In reply to Filip Pizlo from comment #50)
> (In reply to Carlos Alberto Lopez Perez from comment #49)
> > (In reply to Filip Pizlo from comment #48)
> > > (In reply to Carlos Alberto Lopez Perez from comment #45)
> > > > (In reply to Filip Pizlo from comment #40)
> > > > > Is there a bot running Linux/arm64 tests and benchmarks?  Without those
> > > > > things, you might as well use the cloop.
> > > > > 
> > > > 
> > > > Yes, there are Linux JSC ARMv7 and ARM64 bots here:
> > > > https://build.webkit.org/waterfall?category=misc (currently maintained by
> > > > Ossy).
> > > > 
> > > > I will look into adding more Linux JSC bots for ARM64 and ARMv7-Thumb2 (as
> > > > well as EWS bots) maintained by Igalia ASAP.
> > > 
> > > The 32-bit JITs are not maintained anymore. We are probably going to remove
> > > that code soon.
> > 
> > The JIT on ARMv7 Thumb2 is currently extensively used in production by a lot
> > of people (including us). It receives a fair amount of testing.
> 
> When we add new features to JSC, we don’t want to also add them to 32-bit.
> There are now many features that have never been ported to 32-bit. This is
> because there is basically zero manpower going into 32-but maintenance.
> 
> You can continue to use that code from a branch or fork if it’s removed from
> trunk.

We can discuss this on Friday at the contributors meeting.  It's well off the topic of this bug.
Comment 52 Zan Dobersek 2017-10-10 07:04:03 PDT
Comment on attachment 323022 [details]
patch for landing

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

> Source/JavaScriptCore/offlineasm/arm64.rb:941
> +        when "globaladdr"
> +            uid = $asm.newUID
> +            $asm.puts "L_offlineasm_loh_adrp_#{uid}:"
> +            $asm.puts "adrp #{operands[1].arm64Operand(:ptr)}, #{operands[0].asmLabel}@GOTPAGE"
> +            $asm.puts "L_offlineasm_loh_ldr_#{uid}:"
> +            $asm.puts "ldr #{operands[1].arm64Operand(:ptr)}, [#{operands[1].arm64Operand(:ptr)}, #{operands[0].asmLabel}@GOTPAGEOFF]"
> +            $asm.deferAction {
> +                $asm.puts ".loh AdrpLdrGot L_offlineasm_loh_adrp_#{uid}, L_offlineasm_loh_ldr_#{uid}"
> +            }

Two issues here that broke the ARM64 build on Linux:
- GOTPAGE and GOTPAGEOFF relocations don't work with ELF,
- GCC doesn't support the link-time optimization hints that are triggered through the .loh directive.

Opened bug #178130 to address that.
Comment 53 Michael Catanzaro 2017-10-10 07:48:19 PDT
(In reply to Zan Dobersek from comment #51)
> We can discuss this on Friday at the contributors meeting.  It's well off
> the topic of this bug.

Yes, I'm looking forward to talking about this at the Contributors Meeting. Igalia really wants to keep this code in upstream WebKit. We also understand that won't happen unless we significantly ramp up our upstream JSC maintenance efforts.
Comment 54 WebKit Commit Bot 2017-10-11 12:31:21 PDT
Re-opened since this is blocked by bug 178182
Comment 55 Filip Pizlo 2017-10-12 09:02:38 PDT
*** Bug 178050 has been marked as a duplicate of this bug. ***
Comment 56 Filip Pizlo 2017-10-12 09:03:12 PDT
Relanded in https://trac.webkit.org/changeset/223239/webkit