| 6575 | } |
| 6576 | |
| 6577 | public static class LocalBindingExpr implements Expr, MaybePrimitiveExpr, AssignableExpr{ |
| 6578 | public final LocalBinding b; |
| 6579 | public final Symbol tag; |
| 6580 | |
| 6581 | public final PathNode clearPath; |
| 6582 | public final PathNode clearRoot; |
| 6583 | public boolean shouldClear = false; |
| 6584 | |
| 6585 | |
| 6586 | public LocalBindingExpr(LocalBinding b, Symbol tag) |
| 6587 | { |
| 6588 | if(b.getPrimitiveType() != null && tag != null) |
| 6589 | if(! b.getPrimitiveType().equals(tagClass(tag))) |
| 6590 | throw new UnsupportedOperationException("Can't type hint a primitive local with a different type"); |
| 6591 | else |
| 6592 | this.tag = null; |
| 6593 | else |
| 6594 | this.tag = tag; |
| 6595 | |
| 6596 | this.b = b; |
| 6597 | |
| 6598 | this.clearPath = (PathNode)CLEAR_PATH.get(); |
| 6599 | this.clearRoot = (PathNode)CLEAR_ROOT.get(); |
| 6600 | IPersistentCollection sites = (IPersistentCollection) RT.get(CLEAR_SITES.get(),b); |
| 6601 | b.used = true; |
| 6602 | |
| 6603 | if(b.idx > 0) |
| 6604 | { |
| 6605 | // Object dummy; |
| 6606 | |
| 6607 | if(sites != null) |
| 6608 | { |
| 6609 | for(ISeq s = sites.seq();s!=null;s = s.next()) |
| 6610 | { |
| 6611 | LocalBindingExpr o = (LocalBindingExpr) s.first(); |
| 6612 | PathNode common = commonPath(clearPath,o.clearPath); |
| 6613 | if(common != null && common.type == PATHTYPE.PATH) |
| 6614 | o.shouldClear = false; |
| 6615 | // else |
| 6616 | // dummy = null; |
| 6617 | } |
| 6618 | } |
| 6619 | |
| 6620 | ObjMethod method = ((ObjMethod) METHOD.deref()); |
| 6621 | boolean closedOver = method.objx.closes.containsKey(b); |
| 6622 | if(clearRoot == b.clearPathRoot || (closedOver && clearRoot == method.clearRoot)) |
| 6623 | { |
| 6624 | this.shouldClear = true; |
| 6625 | sites = RT.conj(sites,this); |
| 6626 | CLEAR_SITES.set(RT.assoc(CLEAR_SITES.get(), b, sites)); |
| 6627 | } |
| 6628 | // else |
| 6629 | // dummy = null; |
| 6630 | } |
| 6631 | } |
| 6632 | |
| 6633 | public Object eval() { |
| 6634 | throw new UnsupportedOperationException("Can't eval locals"); |
nothing calls this directly
no outgoing calls
no test coverage detected