Bug 229223

Summary: Build an unlinked baseline JIT
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, commit-queue, ews-watchlist, gyuyoung.kim, Hironori.Fujii, keith_miller, mark.lam, msaboff, ross.kirsling, ryuan.choi, sergio, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230847
Bug Depends on: 230806, 230854    
Bug Blocks:    
Attachments:
Description Flags
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
patch
none
patch
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
none
WIP
ews-feeder: commit-queue-
WIP
ews-feeder: commit-queue-
WIP
ews-feeder: commit-queue-
WIP
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ysuzuki: review+, ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch
ews-feeder: commit-queue-
patch for landing
ews-feeder: commit-queue-
patch for landing
ews-feeder: commit-queue-
patch for landing
ews-feeder: commit-queue-
patch for landing
none
test windows
ews-feeder: commit-queue-
[fast-cq] patch for landing
none
[fast-cq] patch for landing none

Description Saam Barati 2021-08-17 19:35:45 PDT
...
Comment 1 Saam Barati 2021-08-18 19:39:43 PDT
Created attachment 435829 [details]
WIP
Comment 2 Saam Barati 2021-08-19 15:59:48 PDT
Created attachment 435912 [details]
WIP
Comment 3 Saam Barati 2021-08-20 13:10:14 PDT
Created attachment 436019 [details]
WIP
Comment 4 Saam Barati 2021-08-20 19:21:43 PDT
Created attachment 436054 [details]
WIP
Comment 5 Saam Barati 2021-08-23 19:36:49 PDT
Created attachment 436257 [details]
WIP

I've audited/edited 107/186 opcodes. However, lot of the hard ones left to do, like the ICs.
Comment 6 Radar WebKit Bug Importer 2021-08-24 19:36:55 PDT
<rdar://problem/82321772>
Comment 7 Saam Barati 2021-08-25 12:09:01 PDT
Created attachment 436408 [details]
WIP
Comment 8 Saam Barati 2021-08-25 17:56:47 PDT
Created attachment 436449 [details]
WIP

Did scope operations, probably the biggest change of any bytecodes so far.
Comment 9 Saam Barati 2021-08-25 18:14:11 PDT
Main things left before I can start compiling code are likely the two hardest parts:
- Call ICs
- SSI based ICs
Comment 10 Saam Barati 2021-08-25 19:00:12 PDT
Created attachment 436452 [details]
WIP
Comment 11 Saam Barati 2021-08-25 22:02:03 PDT
Created attachment 436469 [details]
WIP
Comment 12 Saam Barati 2021-08-26 11:33:09 PDT
Created attachment 436537 [details]
WIP

rebased
Comment 13 Saam Barati 2021-08-26 17:22:31 PDT
Created attachment 436591 [details]
WIP

Implemented call ICs. Now time to do SSI based ICs.
Comment 14 Saam Barati 2021-08-26 20:49:20 PDT
Created attachment 436606 [details]
WIP
Comment 15 Saam Barati 2021-08-27 16:58:07 PDT
Created attachment 436692 [details]
WIP
Comment 16 Saam Barati 2021-08-29 13:11:07 PDT
Created attachment 436747 [details]
WIP
Comment 17 Saam Barati 2021-08-30 17:17:34 PDT
Created attachment 436831 [details]
WIP
Comment 18 Saam Barati 2021-08-30 18:30:33 PDT
Created attachment 436839 [details]
WIP

Inline caching opcodes are done. Just a few more left to do.
Comment 19 Saam Barati 2021-08-30 18:49:06 PDT
Created attachment 436840 [details]
WIP

Only 7 opcodes left to write.
Comment 20 Saam Barati 2021-08-31 16:22:52 PDT
Created attachment 436962 [details]
patch

All opcodes are done (for 64-bit).

Time to start trying to actually compile it.
Comment 21 Saam Barati 2021-08-31 18:52:05 PDT
Created attachment 436981 [details]
patch
Comment 22 Saam Barati 2021-08-31 18:59:24 PDT
Created attachment 436982 [details]
WIP
Comment 23 Saam Barati 2021-08-31 19:02:58 PDT
Created attachment 436983 [details]
WIP
Comment 24 Saam Barati 2021-09-01 12:01:10 PDT
Created attachment 437050 [details]
WIP
Comment 25 Saam Barati 2021-09-01 12:30:52 PDT
Created attachment 437053 [details]
WIP
Comment 26 Saam Barati 2021-09-01 12:50:53 PDT
Created attachment 437056 [details]
WIP
Comment 27 Saam Barati 2021-09-01 13:11:51 PDT
Created attachment 437059 [details]
WIP
Comment 28 Saam Barati 2021-09-01 13:15:56 PDT
Created attachment 437060 [details]
WIP

Rebased. Time to start trying to compile this thing.
Comment 29 Saam Barati 2021-09-01 16:29:10 PDT
Created attachment 437080 [details]
WIP

Parts of it are starting to compile
Comment 30 Saam Barati 2021-09-01 18:13:15 PDT
Created attachment 437099 [details]
WIP
Comment 31 Saam Barati 2021-09-01 19:26:31 PDT
Created attachment 437107 [details]
WIP
Comment 32 Saam Barati 2021-09-01 19:50:27 PDT
Created attachment 437108 [details]
WIP

debug now builds!
Comment 33 Saam Barati 2021-09-02 17:31:09 PDT
Created attachment 437224 [details]
WIP
Comment 34 Saam Barati 2021-09-02 18:51:59 PDT
Created attachment 437229 [details]
WIP
Comment 35 Saam Barati 2021-09-03 11:00:53 PDT
Created attachment 437285 [details]
WIP

Many tests pass now!
Comment 36 Saam Barati 2021-09-03 11:47:05 PDT
Created attachment 437290 [details]
WIP
Comment 37 Saam Barati 2021-09-03 12:03:10 PDT
Created attachment 437291 [details]
WIP
Comment 38 Saam Barati 2021-09-03 13:48:23 PDT
Created attachment 437307 [details]
WIP
Comment 39 Saam Barati 2021-09-03 16:20:30 PDT
Created attachment 437324 [details]
WIP

An initial version of sharing appears to work, but slows down things. Time for the fun part, I guess.
Comment 40 Saam Barati 2021-09-03 18:09:55 PDT
Created attachment 437331 [details]
WIP
Comment 41 Saam Barati 2021-09-07 14:54:49 PDT
Created attachment 437559 [details]
WIP
Comment 42 Saam Barati 2021-09-07 20:00:18 PDT
Created attachment 437583 [details]
WIP
Comment 43 Saam Barati 2021-09-07 20:25:02 PDT
Created attachment 437586 [details]
WIP
Comment 44 Saam Barati 2021-09-07 22:05:22 PDT
Created attachment 437591 [details]
WIP
Comment 45 Saam Barati 2021-09-07 22:11:43 PDT
Created attachment 437592 [details]
WIP
Comment 46 Saam Barati 2021-09-08 11:55:09 PDT
Created attachment 437652 [details]
WIP

Moved ValueProfiles to UnlinkedCodeBlock
Comment 47 Saam Barati 2021-09-16 19:10:43 PDT
Created attachment 438430 [details]
WIP

rebased
Comment 48 Saam Barati 2021-09-16 19:18:57 PDT
Created attachment 438431 [details]
WIP
Comment 49 Saam Barati 2021-09-16 19:29:37 PDT
Created attachment 438433 [details]
WIP
Comment 50 Saam Barati 2021-09-17 19:16:03 PDT
Created attachment 438541 [details]
WIP

Resolved some perf issues.
Comment 51 Saam Barati 2021-09-19 19:22:44 PDT
Created attachment 438629 [details]
WIP
Comment 52 Saam Barati 2021-09-19 19:31:02 PDT
Created attachment 438630 [details]
WIP
Comment 53 Saam Barati 2021-09-20 15:00:46 PDT
Created attachment 438736 [details]
WIP
Comment 54 Saam Barati 2021-09-20 16:08:46 PDT
Created attachment 438747 [details]
WIP
Comment 55 Saam Barati 2021-09-20 17:11:38 PDT
Created attachment 438757 [details]
WIP
Comment 56 Saam Barati 2021-09-20 21:31:25 PDT
Created attachment 438774 [details]
WIP
Comment 57 Saam Barati 2021-09-20 22:40:23 PDT
Created attachment 438777 [details]
WIP
Comment 58 Saam Barati 2021-09-21 13:48:59 PDT
Created attachment 438851 [details]
WIP

Release tests are passing on arm64
Comment 59 Saam Barati 2021-09-21 15:44:53 PDT
Created attachment 438872 [details]
WIP
Comment 60 Saam Barati 2021-09-21 19:02:24 PDT
Created attachment 438901 [details]
WIP
Comment 61 Saam Barati 2021-09-21 19:39:36 PDT
Created attachment 438907 [details]
WIP
Comment 62 Saam Barati 2021-09-23 10:12:57 PDT
Created attachment 439056 [details]
WIP
Comment 63 Saam Barati 2021-09-23 17:44:06 PDT
Created attachment 439110 [details]
WIP
Comment 64 Saam Barati 2021-09-23 17:56:15 PDT
Created attachment 439111 [details]
WIP
Comment 65 Saam Barati 2021-09-23 18:09:42 PDT
Created attachment 439113 [details]
WIP

rebased

Things seem to now be working both on arm64 and x86_64
Comment 66 Saam Barati 2021-09-24 10:16:19 PDT
Created attachment 439158 [details]
WIP
Comment 67 Saam Barati 2021-09-24 11:18:38 PDT
Created attachment 439173 [details]
WIP
Comment 68 Saam Barati 2021-09-24 12:16:27 PDT
Created attachment 439182 [details]
WIP
Comment 69 Saam Barati 2021-09-24 12:58:00 PDT
Created attachment 439185 [details]
patch
Comment 70 Saam Barati 2021-09-24 13:32:15 PDT
Created attachment 439189 [details]
patch

Still tryna make some 32-bit code compile.
Comment 71 Saam Barati 2021-09-24 13:41:57 PDT
Created attachment 439190 [details]
patch
Comment 72 Saam Barati 2021-09-24 13:57:45 PDT
Created attachment 439194 [details]
patch
Comment 73 Yusuke Suzuki 2021-09-24 14:42:19 PDT
Comment on attachment 439194 [details]
patch

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

r=me
Saam and I discussed about ArithProfile changes. And we agree that we will revert these changes unless that gets a performance improvement because that change increases memory use.
And please fix GTK and WPE builders since they are x64. (And WinCairo and Win).

> Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp:606
> +    if (!canBeShared && ASSERT_ENABLED) {
> +        jit.addPtr(CCallHelpers::TrustedImm32(codeBlock->stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, jit.scratchRegister());
> +        auto ok = jit.branchPtr(CCallHelpers::Equal, CCallHelpers::stackPointerRegister, jit.scratchRegister());
> +        jit.breakpoint();
> +        ok.link(&jit);

Nice.
Comment 74 Saam Barati 2021-09-24 15:59:11 PDT
Created attachment 439203 [details]
patch

Try to fix some of the builds.
Comment 75 Saam Barati 2021-09-24 16:14:03 PDT
Created attachment 439204 [details]
patch
Comment 76 Saam Barati 2021-09-24 16:22:44 PDT
Created attachment 439206 [details]
patch
Comment 77 Saam Barati 2021-09-24 16:37:19 PDT
Created attachment 439207 [details]
patch
Comment 78 Saam Barati 2021-09-24 16:52:20 PDT
Created attachment 439211 [details]
patch
Comment 79 Saam Barati 2021-09-24 19:40:23 PDT
Created attachment 439230 [details]
patch for landing
Comment 80 Saam Barati 2021-09-24 23:02:11 PDT
Created attachment 439237 [details]
patch for landing

Hopefully this fixes the Windows bug.
Comment 81 Saam Barati 2021-09-24 23:29:39 PDT
Created attachment 439240 [details]
patch for landing

Hopefully windows is actually fixed now.
Comment 82 Saam Barati 2021-09-25 11:46:46 PDT
Created attachment 439266 [details]
patch for landing
Comment 83 EWS 2021-09-25 14:55:49 PDT
Committed r283083 (242141@main): <https://commits.webkit.org/242141@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439266 [details].
Comment 84 Ross Kirsling 2021-09-26 11:14:16 PDT
This change broke ENABLE_JIT=OFF in general, because these get added to LLIntDesiredOffsets.h:

  OFFLINE_ASM_OFFSETOF(CodeBlock, m_jitData)
  OFFLINE_ASM_OFFSETOF(CodeBlock::JITData, m_jitConstantPool)
Comment 85 Fujii Hironori 2021-09-26 13:59:48 PDT
Winodws ports are crashing. the backtrace is broken. This change has to be reverted.
https://ews-build.webkit.org/#/builders/10/builds/107549
https://build.webkit.org/#/builders/60/builds/2759
Comment 86 WebKit Commit Bot 2021-09-26 14:17:52 PDT
Re-opened since this is blocked by bug 230806
Comment 87 Saam Barati 2021-09-26 21:29:05 PDT
Created attachment 439312 [details]
test windows
Comment 88 Saam Barati 2021-09-27 00:33:14 PDT
So the windows bug turns out to be even worse than imagined.

My patch is calling loadPtr(regT0, xyz). MSVC is coercing the RegisterID of regT0 to nullptr instead of passing it to ImplicitAddress. So instead of calling loadPtr(ImplicitAddress) we're calling loadPtr(void*) with nullptr. Causing us to emit a constant load of nullptr.
Comment 89 Saam Barati 2021-09-27 00:44:00 PDT
Created attachment 439326 [details]
[fast-cq] patch for landing
Comment 90 EWS 2021-09-27 00:52:57 PDT
Committed r283102 (242160@main): <https://commits.webkit.org/242160@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439326 [details].
Comment 91 Yusuke Suzuki 2021-09-27 01:55:14 PDT
Committed r283103 (242161@main): <https://commits.webkit.org/242161@main>
Comment 92 Yusuke Suzuki 2021-09-27 02:07:24 PDT
Committed r283104 (242162@main): <https://commits.webkit.org/242162@main>
Comment 93 WebKit Commit Bot 2021-09-27 12:30:30 PDT
Re-opened since this is blocked by bug 230854
Comment 94 Saam Barati 2021-09-27 13:24:02 PDT
Created attachment 439386 [details]
[fast-cq] patch for landing
Comment 95 EWS 2021-09-27 14:53:51 PDT
Committed r283139 (242196@main): <https://commits.webkit.org/242196@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439386 [details].