Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellilltokiwa committed Jan 20, 2025
1 parent c940e3a commit 5e64e15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/dev/flang/fuir/GeneratingFUIR.java
Original file line number Diff line number Diff line change
Expand Up @@ -2570,9 +2570,7 @@ public byte[] constData(int s)
* @return clazz id of type of the subject
*/
@Override
public
synchronized /* NYI: remove once it is ensured that _siteClazzCache is no longer modified when _lookupDone */
int matchStaticSubject(int s)
public int matchStaticSubject(int s)
{
if (PRECONDITIONS) require
(s >= SITE_BASE,
Expand All @@ -2581,18 +2579,16 @@ int matchStaticSubject(int s)
codeAt(s) == ExprKind.Match);

var rc = (Clazz) _siteClazzCache.get(s);
if (rc == null)
if (rc == null && !_lookupDone)
{
if (CHECKS) check
(!_lookupDone);
var cl = clazzAt(s);
var cc = id2clazz(cl);
var outerClazz = cc;
var m = (AbstractMatch) getExpr(s);
rc = clazz(m.subject(), outerClazz, _inh.get(s - SITE_BASE));
_siteClazzCache.put(s, rc);
}
return rc._id;
return rc == null ? NO_CLAZZ : rc._id;
}


Expand Down
2 changes: 1 addition & 1 deletion src/dev/flang/fuir/analysis/dfa/DfaFUIR.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public byte[] serialize()
!withinCode(s) ? NO_CLAZZ : codeAt(s) == ExprKind.Assign ? assignedType(s) : NO_CLAZZ,
!withinCode(s) || codeAt(s) != ExprKind.Box ? NO_CLAZZ : safe(()->boxValueClazz(s0), NO_CLAZZ),
!withinCode(s) || codeAt(s) != ExprKind.Box ? NO_CLAZZ : safe(()->boxResultClazz(s0), NO_CLAZZ),
!withinCode(s) ? NO_CLAZZ : codeAt(s) == ExprKind.Match ? safe(()->matchStaticSubject(s0), NO_CLAZZ) : NO_CLAZZ,
!withinCode(s) ? NO_CLAZZ : codeAt(s) == ExprKind.Match ? matchStaticSubject(s0) : NO_CLAZZ,
!withinCode(s) ? -1 : codeAt(s) == ExprKind.Match ? matchCaseCount(s) : NO_CLAZZ,
!withinCode(s) ? null : codeAt(s) == ExprKind.Match ? matchCaseTags(s) : null,
!withinCode(s) ? null : codeAt(s) == ExprKind.Match ? matchCaseCode(s) : null,
Expand Down

0 comments on commit 5e64e15

Please sign in to comment.