Bug 213670 - BytecodeBasicBlock::addSuccessor should check if the successor already exists
Summary: BytecodeBasicBlock::addSuccessor should check if the successor already exists
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-26 17:09 PDT by Saam Barati
Modified: 2020-06-27 08:54 PDT (History)
15 users (show)

See Also:


Attachments
patch (1.69 KB, patch)
2020-06-26 17:30 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2020-06-26 17:09:08 PDT
we end  up with duplicates for switch, e.g:

baz#BV6yLf:[0x10d3bc360->0x10d3e5200, NoneFunctionCall, 87]: 19 instructions (0 16-bit instructions, 0 32-bit instructions, 9 instructions with metadata); 207 bytes (120 metadata bytes); 2 parameter(s); 16 callee register(s); 6 variable(s); scope at loc4

bb#1
[   0] enter              
[   1] get_scope          loc4
[   3] mov                loc5, loc4
[   6] check_traps        
Successors: [ #2 ]

bb#2
[   7] switch_imm         0, 76(->83), arg1
Successors: [ #2 #3 #4 #5 #6 #3 ]

bb#3
[  11] resolve_scope      loc10, loc4, 0, GlobalProperty, 0
[  18] get_from_scope     loc6, loc10, 0, 2048<ThrowIfNotFound|GlobalProperty|NotInitialization|NotStrictMode>, 0, 0
[  26] mov                loc9, Int32: 42(const0)
[  29] call               loc6, loc6, 2, 16
Successors: [ #4 ]

bb#4
[  35] resolve_scope      loc10, loc4, 0, GlobalProperty, 0
[  42] get_from_scope     loc6, loc10, 0, 2048<ThrowIfNotFound|GlobalProperty|NotInitialization|NotStrictMode>, 0, 0
[  50] mov                loc9, Int32: 43(const1)
[  53] call               loc6, loc6, 2, 16
Successors: [ #5 ]

bb#5
[  59] resolve_scope      loc10, loc4, 0, GlobalProperty, 0
[  66] get_from_scope     loc6, loc10, 0, 2048<ThrowIfNotFound|GlobalProperty|NotInitialization|NotStrictMode>, 0, 0
[  74] mov                loc9, Int32: 44(const2)
[  77] call               loc6, loc6, 2, 16
Successors: [ #6 ]

bb#6
[  83] jmp                2(->85)
Successors: [ #7 ]

bb#7
[  85] ret                Undefined(const3)
Successors: [ ]


Identifiers:
  id0 = print

Constants:
   k0 = Int32: 42: in source as integer
   k1 = Int32: 43: in source as integer
   k2 = Int32: 44: in source as integer
   k3 = Undefined
Switch Jump Tables:
  0 = {
		   1 => 0004
		   2 => 0028
		   4 => 0052
      }
Comment 1 Saam Barati 2020-06-26 17:30:55 PDT
Created attachment 402935 [details]
patch
Comment 2 Yusuke Suzuki 2020-06-26 18:32:56 PDT
Comment on attachment 402935 [details]
patch

r=me
Comment 3 EWS 2020-06-27 08:53:45 PDT
Committed r263619: <https://trac.webkit.org/changeset/263619>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 402935 [details].
Comment 4 Radar WebKit Bug Importer 2020-06-27 08:54:17 PDT
<rdar://problem/64844062>