RESOLVED FIXED 216685
Move some LLInt globals into JSC::Config.
https://bugs.webkit.org/show_bug.cgi?id=216685
Summary Move some LLInt globals into JSC::Config.
Mark Lam
Reported 2020-09-17 20:58:15 PDT
Attachments
proposed patch. (16.50 KB, patch)
2020-09-17 22:01 PDT, Mark Lam
ews-feeder: commit-queue-
proposed patch. (18.21 KB, patch)
2020-09-17 22:32 PDT, Mark Lam
ews-feeder: commit-queue-
proposed patch. (21.46 KB, patch)
2020-09-18 00:32 PDT, Mark Lam
ews-feeder: commit-queue-
proposed patch. (21.48 KB, patch)
2020-09-18 00:40 PDT, Mark Lam
ews-feeder: commit-queue-
proposed patch. (21.49 KB, patch)
2020-09-18 00:55 PDT, Mark Lam
ews-feeder: commit-queue-
patch for EWS testing. (24.89 KB, patch)
2020-09-18 01:38 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test (24.90 KB, patch)
2020-09-18 01:50 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test. (24.91 KB, patch)
2020-09-18 01:54 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test. (26.19 KB, patch)
2020-09-18 02:50 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test. (26.35 KB, patch)
2020-09-18 11:33 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test. (26.28 KB, patch)
2020-09-18 11:41 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test (26.40 KB, patch)
2020-09-18 12:35 PDT, Mark Lam
ews-feeder: commit-queue-
EWS test. (26.37 KB, patch)
2020-09-18 13:08 PDT, Mark Lam
ews-feeder: commit-queue-
LowLevelInterpreterWin.asm without patch (5.11 MB, text/plain)
2020-09-18 21:56 PDT, Myles C. Maxfield
no flags
LowLevelInterpreterWin.asm with patch (5.13 MB, text/plain)
2020-09-18 21:57 PDT, Myles C. Maxfield
no flags
proposed patch. (32.83 KB, patch)
2020-09-19 16:04 PDT, Mark Lam
ews-feeder: commit-queue-
proposed patch. (32.84 KB, patch)
2020-09-19 16:20 PDT, Mark Lam
keith_miller: review+
Mark Lam
Comment 1 2020-09-17 22:01:36 PDT
Created attachment 409103 [details] proposed patch.
Mark Lam
Comment 2 2020-09-17 22:32:13 PDT
Created attachment 409105 [details] proposed patch.
Mark Lam
Comment 3 2020-09-18 00:32:40 PDT
Created attachment 409108 [details] proposed patch.
Mark Lam
Comment 4 2020-09-18 00:40:45 PDT
Created attachment 409109 [details] proposed patch.
Mark Lam
Comment 5 2020-09-18 00:55:03 PDT
Created attachment 409112 [details] proposed patch.
Mark Lam
Comment 6 2020-09-18 01:38:33 PDT
Created attachment 409113 [details] patch for EWS testing.
Mark Lam
Comment 7 2020-09-18 01:50:50 PDT
Created attachment 409114 [details] EWS test
Mark Lam
Comment 8 2020-09-18 01:54:26 PDT
Created attachment 409115 [details] EWS test.
Mark Lam
Comment 9 2020-09-18 02:50:01 PDT
Created attachment 409121 [details] EWS test.
Mark Lam
Comment 10 2020-09-18 11:33:27 PDT
Created attachment 409152 [details] EWS test.
Mark Lam
Comment 11 2020-09-18 11:41:30 PDT
Created attachment 409155 [details] EWS test.
Mark Lam
Comment 12 2020-09-18 12:35:43 PDT
Created attachment 409163 [details] EWS test
Mark Lam
Comment 13 2020-09-18 13:08:00 PDT
Created attachment 409167 [details] EWS test.
Myles C. Maxfield
Comment 14 2020-09-18 21:56:27 PDT
Created attachment 409194 [details] LowLevelInterpreterWin.asm without patch
Myles C. Maxfield
Comment 15 2020-09-18 21:57:45 PDT
Created attachment 409195 [details] LowLevelInterpreterWin.asm with patch
Mark Lam
Comment 16 2020-09-19 16:04:16 PDT
Created attachment 409212 [details] proposed patch.
Mark Lam
Comment 17 2020-09-19 16:20:33 PDT
Created attachment 409213 [details] proposed patch.
Mark Lam
Comment 18 2020-09-19 17:36:20 PDT
Comment on attachment 409213 [details] proposed patch. Ready for a review now.
Sam Weinig
Comment 19 2020-09-19 17:41:03 PDT
Comment on attachment 409213 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=409213&action=review > Source/JavaScriptCore/ChangeLog:3 > + Move some LLInt globals into JSC::Config. What is the goal of doing this?
Mark Lam
Comment 20 2020-09-19 20:40:50 PDT
(In reply to Sam Weinig from comment #19) > Comment on attachment 409213 [details] > proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=409213&action=review > > > Source/JavaScriptCore/ChangeLog:3 > > + Move some LLInt globals into JSC::Config. > > What is the goal of doing this? The opcodeMaps are supposed to be functionally constant. They are meant to be initialized once and never changed thereafter. This change enforces that invariant.
Sam Weinig
Comment 21 2020-09-20 07:37:34 PDT
Comment on attachment 409213 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=409213&action=review >>> Source/JavaScriptCore/ChangeLog:3 >>> + Move some LLInt globals into JSC::Config. >> >> What is the goal of doing this? > > The opcodeMaps are supposed to be functionally constant. They are meant to be initialized once and never changed thereafter. This change enforces that invariant. It feels like an oddly named place, "Config", for an opcode map. Perhaps either JSC::Config needs a new name, or these should go somewhere else that can enforce that invariant?
Mark Lam
Comment 22 2020-09-20 12:25:44 PDT
(In reply to Sam Weinig from comment #21) > Comment on attachment 409213 [details] > proposed patch. > > View in context: > https://bugs.webkit.org/attachment.cgi?id=409213&action=review > > >>> Source/JavaScriptCore/ChangeLog:3 > >>> + Move some LLInt globals into JSC::Config. > >> > >> What is the goal of doing this? > > > > The opcodeMaps are supposed to be functionally constant. They are meant to be initialized once and never changed thereafter. This change enforces that invariant. > > It feels like an oddly named place, "Config", for an opcode map. Perhaps > either JSC::Config needs a new name, or these should go somewhere else that > can enforce that invariant? It's not that odd. In a sense, the opcode maps "configures" how the LLInt will behave (though this is a bit of a stretch). But yeah, if we can come up with a better name for the Config, I would gladly adopt it. No one has a better proposal yet. When I first introduced it, I considered ConstData / ROData (for ReadOnlyData) but those are not accurate either (the data is only const/read-only after freezing, and not before).
Sam Weinig
Comment 23 2020-09-20 14:10:25 PDT
(In reply to Mark Lam from comment #22) > (In reply to Sam Weinig from comment #21) > > Comment on attachment 409213 [details] > > proposed patch. > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=409213&action=review > > > > >>> Source/JavaScriptCore/ChangeLog:3 > > >>> + Move some LLInt globals into JSC::Config. > > >> > > >> What is the goal of doing this? > > > > > > The opcodeMaps are supposed to be functionally constant. They are meant to be initialized once and never changed thereafter. This change enforces that invariant. > > > > It feels like an oddly named place, "Config", for an opcode map. Perhaps > > either JSC::Config needs a new name, or these should go somewhere else that > > can enforce that invariant? > > It's not that odd. In a sense, the opcode maps "configures" how the LLInt > will behave (though this is a bit of a stretch). But yeah, if we can come > up with a better name for the Config, I would gladly adopt it. No one has a > better proposal yet. When I first introduced it, I considered ConstData / > ROData (for ReadOnlyData) but those are not accurate either (the data is > only const/read-only after freezing, and not before). I see, makes sense. We should definitely rename JSC::Config (or make it a member of a new thing) at some point. Not needed for this change.
Keith Miller
Comment 24 2020-09-21 13:03:53 PDT
Comment on attachment 409213 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=409213&action=review r=me with nits > Source/JavaScriptCore/ChangeLog:18 > + 2. Add a LLIntInitializeAssertScope to be used in LLInt::initialize() to ensure > + that it is only called during primodial initialization time. It seems like this is unnecessary, since we will crash once the data has been made read only anyway, right? > Source/JavaScriptCore/llint/LLIntData.cpp:65 > + LLIntInitializeAssertScope assertScope; Nit: if you want to keep this assert, make it a ScopeExit, you're only using it once anyway. > Source/JavaScriptCore/offlineasm/arm.rb:269 > + newList << Instruction.new(codeOrigin, "move", [Immediate.new(node.codeOrigin, labelRef.offset), tmp]) > + newList << Instruction.new(codeOrigin, "addp", [tmp, node.operands[1]]) Can you put a FIXME to implement the logic to figure out which immediates are encodable inline here?
Mark Lam
Comment 25 2020-09-21 14:25:41 PDT
Comment on attachment 409213 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=409213&action=review >> Source/JavaScriptCore/ChangeLog:18 >> + that it is only called during primodial initialization time. > > It seems like this is unnecessary, since we will crash once the data has been made read only anyway, right? After thinking about this some more, I agree that this is redundant. I'll remove it. >> Source/JavaScriptCore/llint/LLIntData.cpp:65 >> + LLIntInitializeAssertScope assertScope; > > Nit: if you want to keep this assert, make it a ScopeExit, you're only using it once anyway. The scope asserts on function entry (via the constructor) and on exit (via the destructor). The exit scope solution is not the same. But anyway, this is moot since I'll remove this. >> Source/JavaScriptCore/offlineasm/arm.rb:269 >> + newList << Instruction.new(codeOrigin, "addp", [tmp, node.operands[1]]) > > Can you put a FIXME to implement the logic to figure out which immediates are encodable inline here? 255 is the basic (covered here already), but traditional 32-bit ARM instruction set does allow for encoding of some larger immediate via rotation tricks. Not too sure about Thumb2 though. I'll have the a FIXME just say that we can explore other encodings of immediate that fit in the add instruction.
Mark Lam
Comment 26 2020-09-21 15:02:30 PDT
Thanks for the review. Landed in r267371: <http://trac.webkit.org/r267371>.
Note You need to log in before you can comment on or make changes to this bug.