RESOLVED FIXED 168685
Implement a mega-disassembler that'll be used in the FTL
https://bugs.webkit.org/show_bug.cgi?id=168685
Summary Implement a mega-disassembler that'll be used in the FTL
Saam Barati
Reported 2017-02-21 15:52:10 PST
Here is Phil's rough sketch: ``` Say we have: function foo(a, b) { return a + b; } And say that it translates to this BC: [ 0] op_enter [ 1] op_add loc0, arg0, arg1 [ 6] op_ret And say that it's all predicted ints without overflows. So here's the megadisasm: 0x100000000 pushq %ebp ... prologue 0: JSConstant(...) 1: JSConstant(...) ... more prologue [ 0] op_enter 0: JSConstant(...) MovHint(...) ... more DFG prologue [ 1] op_add loc0, arg0, arg1 2: GetStack(arg0) Int32 @42 = Load(@13, stuff) Move stuff(%rbp), %things movl stuff(%rbp), %things 3: GetStack(arg1) Int32 @43 = Load(@13, otherstuff) Move otherstuff(%rbp), %otherthings movl otherstuff(%rbp), %otherthings 4: ArithAdd(Int32: @2, Int32:@3) Int32 @44 = CheckAdd(@2, @3, ...) Patch &BranchAdd32, ... addl ... jo ... ... and so on ``` This would be super cool.
Attachments
patch (16.37 KB, patch)
2017-02-28 17:37 PST, Saam Barati
no flags
patch (16.37 KB, patch)
2017-02-28 17:41 PST, Saam Barati
mark.lam: review+
Saam Barati
Comment 1 2017-02-28 17:37:40 PST
Saam Barati
Comment 2 2017-02-28 17:41:25 PST
Created attachment 303018 [details] patch Change a variable name.
WebKit Commit Bot
Comment 3 2017-02-28 17:44:19 PST
Attachment 303018 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/ChangeLog:20: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:23: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:27: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:37: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:41: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:45: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:49: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:53: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:63: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:69: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:78: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ChangeLog:84: Line contains tab character. [whitespace/tab] [5] ERROR: Source/JavaScriptCore/ftl/FTLCompile.cpp:35: Alphabetical sorting problem. [build/include_order] [4] ERROR: Source/JavaScriptCore/ftl/FTLCompile.cpp:190: More than one command on the same line [whitespace/newline] [4] Total errors found: 14 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Saam Barati
Comment 4 2017-02-28 20:41:45 PST
Will fix style before landing.
Mark Lam
Comment 5 2017-03-01 09:47:58 PST
Comment on attachment 303018 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=303018&action=review LGTM > Source/JavaScriptCore/b3/air/AirDisassembler.h:53 > + void dump(Code&, PrintStream&, LinkBuffer&, const char*, const char*, std::function<void(Inst&)> doToEachInst); nit: I think it's worth const char* airPrefix, const char* asmPrefix in the args because it's not obvious from the type alone what the purpose of the args are.
Saam Barati
Comment 6 2017-03-01 11:16:00 PST
Note You need to log in before you can comment on or make changes to this bug.