提交 fbf60bca 编写于 作者: S Steffen Forkmann 提交者: Phillip Carter

Remove tryRawToLabel (#8293)

上级 1069553d
......@@ -2459,15 +2459,11 @@ and seekReadImplMap (ctxt: ILMetadataReader) nm midx =
and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numtypars (sz: int) start seqpoints =
let labelsOfRawOffsets = new Dictionary<_, _>(sz/2)
let ilOffsetsOfLabels = new Dictionary<_, _>(sz/2)
let tryRawToLabel rawOffset =
match labelsOfRawOffsets.TryGetValue rawOffset with
| true, v -> Some v
| _ -> None
let rawToLabel rawOffset =
match tryRawToLabel rawOffset with
| Some l -> l
| None ->
match labelsOfRawOffsets.TryGetValue rawOffset with
| true, l -> l
| _ ->
let lab = generateCodeLabel()
labelsOfRawOffsets.[rawOffset] <- lab
lab
......@@ -2696,9 +2692,9 @@ and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numtypars (sz: int) start s
// the start of the next instruction referred to by the raw offset.
let raw2nextLab rawOffset =
let isInstrStart x =
match tryRawToLabel x with
| None -> false
| Some lab -> ilOffsetsOfLabels.ContainsKey lab
match labelsOfRawOffsets.TryGetValue x with
| true, lab -> ilOffsetsOfLabels.ContainsKey lab
| _ -> false
if isInstrStart rawOffset then rawToLabel rawOffset
elif isInstrStart (rawOffset+1) then rawToLabel (rawOffset+1)
else failwith ("the bytecode raw offset "+string rawOffset+" did not refer either to the start or end of an instruction")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册