about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* fixed configurerequest according to the problem Jukka reportedAnselm R. Garbe2007-02-191-11/+16
* don't resize master if not in tiled modeAnselm R. Garbe2007-02-191-0/+2
* removed useless spaceAnselm R. Garbe2007-02-161-1/+1
* well, resize should be called in dofloat anyways ;)Anselm R. Garbe2007-02-161-0/+1
* removed ugly ban(), extended resize() that it only resets the size if necessa...Anselm R. Garbe2007-02-165-93/+100
* removed getnext/getprev, redundantAnselm R. Garbe2007-02-163-19/+7
* added ban() which takes care than a banned window is not banned again... (thi...Anselm R. Garbe2007-02-145-7/+19
* Added tag 3.5 for changeset 63ad05e7f9e1Anselm R. Garbe2007-02-141-0/+1
* simplifying regexps in config samples 3.5Anselm R. Garbe2007-02-142-7/+7
* made for/if/else constructs more consistent, some code polishingAnselm R. Garbe2007-02-145-21/+18
* made configurerequest more tidyAnselm R. Garbe2007-02-141-5/+10
* I didn't knew of c->isfixed, that should fix Jukkas issue with gkrellm ;)Anselm R. Garbe2007-02-131-6/+8
* making it more sure that transient checks will work in any caseAnselm R. Garbe2007-02-131-3/+4
* stupid me, one needs to set c->{x,y,w,h} in configurerequest obviously ;)Anselm R. Garbe2007-02-131-16/+20
* simplified configurerequestAnselm R. Garbe2007-02-132-47/+29
* yet another consistency fix of dwmAnselm R. Garbe2007-02-121-1/+1
* I don't see any reason why we should select for input on override-redirect wi...Anselm R. Garbe2007-02-121-4/+1
* bugfix of bugfix (thx to Sander)Anselm R. Garbe2007-02-121-1/+1
* fixed a bugAnselm R. Garbe2007-02-121-1/+1
* during writing 2wm.1 I noticed some bugs in dwm.1Anselm R. Garbe2007-02-121-3/+3
* removing all EnterNotifys after resizeAnselm R. Garbe2007-02-121-0/+1
* added pointer warp on drop in resizeAnselm R. Garbe2007-02-121-0/+2
* pneubeck pointed out an obvious thing, that a second p = stext + strlen(stext...Anselm R. Garbe2007-02-091-1/+1
* treating acroread and mplayer floating by defaultAnselm R. Garbe2007-02-091-0/+2
* adapting John Grahor's patch to dwm-3.5Anselm R. Garbe2007-02-091-2/+3
* fixed copyright notice in MakefileAnselm R. Garbe2007-02-081-1/+1
* fixed order of Bool declarationsAnselm R. Garbe2007-02-081-1/+1
* added TOPBAR option for making the bar appear what the user likesAnselm R. Garbe2007-02-083-3/+5
* next version is 3.5Anselm R. Garbe2007-02-081-1/+1
* making the bar appear at bottomAnselm R. Garbe2007-02-081-2/+2
* Added tag 3.4 for changeset 9ede7b2d2450Anselm R. Garbe2007-02-071-0/+1
* removed debug flags 3.4Anselm R. Garbe2007-02-071-2/+2
* replaced getproto with a saner function, now old-school artifacts of WM times...Anselm R. Garbe2007-02-075-31/+20
* yet another fixAnselm R. Garbe2007-02-061-1/+1
* simplificationAnselm R. Garbe2007-02-061-10/+5
* implemented aspect ratio support of windowsAnselm R. Garbe2007-02-062-4/+41
* made some changes more concistentAnselm R. Garbe2007-02-052-3/+3
* got rid of LD (inspired by JGs patch to wmii)Anselm R. Garbe2007-02-052-4/+2
* applied apm's patch proposal, getting rid of XDrawLinesAnselm R. Garbe2007-02-051-14/+4
* Added tag 3.3 for changeset 0f91934037b0Anselm R. Garbe2007-02-011-0/+1
* applied Sander's drop_bh patch 3.3Anselm R. Garbe2007-01-311-5/+5
* handling WM_STATE seems to make DnD in gtk/qt apps working, well let's handle...Anselm R. Garbe2007-01-283-1/+11
* regarding to http://plan9.bell-labs.com/sources/contrib/rsc/man.ps the BUGS s...Anselm R. Garbe2007-01-261-2/+2
* renamed CAVEATS into BUGSAnselm R. Garbe2007-01-262-2/+2
* Added tag 3.2.2 for changeset d3876aa79292Anselm R. Garbe2007-01-251-0/+1
* prepared yet another hotfix release 3.2.2Anselm R. Garbe2007-01-253-5/+9
* Added tag 3.2.1 for changeset f2cabc83a18fAnselm R. Garbe2007-01-241-0/+1
* hotfix release 3.2.1 3.2.1Anselm R. Garbe2007-01-241-1/+1
* applied offscreen appearance hotfixAnselm R. Garbe2007-01-241-8/+8
* Added tag 3.2 for changeset 4ce65f61f01bAnselm R. Garbe2007-01-241-0/+1
>label: nil, parent: addr(parent)) proc breakStmt(b: var BasicBlock; n: PNode) = var it = addr(b) while it != nil: it.wasMovedLocs.setLen 0 it.hasBreak = true if n.kind == nkSym: if it.label == n.sym: break else: # unnamed break leaves the block is nkWhileStmt or the like: if it.kind in {nkWhileStmt, nkBlockStmt, nkBlockExpr}: break it = it.parent proc returnStmt(b: var BasicBlock) = b.hasReturn = true var it = addr(b) while it != nil: it.wasMovedLocs.setLen 0 it = it.parent proc mergeBasicBlockInfo(parent: var BasicBlock; this: BasicBlock) {.inline.} = if this.hasReturn: parent.wasMovedLocs.setLen 0 parent.hasReturn = true proc wasMovedTarget(matches: var IntSet; branch: seq[PNode]; moveTarget: PNode): bool = result = false for i in 0..<branch.len: if exprStructuralEquivalent(branch[i][1].skipAddr, moveTarget, strictSymEquality = true): result = true matches.incl i proc intersect(summary: var seq[PNode]; branch: seq[PNode]) = # keep all 'wasMoved(x)' calls in summary that are also in 'branch': var i = 0 var matches = initIntSet() while i < summary.len: if wasMovedTarget(matches, branch, summary[i][1].skipAddr): inc i else: summary.del i for m in matches: summary.add branch[m] proc invalidateWasMoved(c: var BasicBlock; x: PNode) = var i = 0 while i < c.wasMovedLocs.len: if exprStructuralEquivalent(c.wasMovedLocs[i][1].skipAddr, x, strictSymEquality = true): c.wasMovedLocs.del i else: inc i proc wasMovedDestroyPair(c: var Con; b: var BasicBlock; d: PNode) = var i = 0 while i < b.wasMovedLocs.len: if exprStructuralEquivalent(b.wasMovedLocs[i][1].skipAddr, d[1].skipAddr, strictSymEquality = true): b.wasMovedLocs[i].flags.incl nfMarkForDeletion c.somethingTodo = true d.flags.incl nfMarkForDeletion b.wasMovedLocs.del i else: inc i proc analyse(c: var Con; b: var BasicBlock; n: PNode) = case n.kind of nkCallKinds: var special = false var reverse = false if n[0].kind == nkSym: let s = n[0].sym let name = s.name.s.normalize if name == "=wasmoved": b.wasMovedLocs.add n special = true elif name == "=destroy": if c.inFinally > 0 and (b.hasReturn or b.hasBreak): discard "cannot optimize away the destructor" else: c.wasMovedDestroyPair b, n special = true elif name == "=sink": reverse = true if not special: if not reverse: for i in 0 ..< n.len: analyse(c, b, n[i]) else: #[ Test destructor/tmatrix.test3: Prevent this from being elided. We should probably find a better solution... `=sink`(b, - let blitTmp = b; wasMoved(b); blitTmp + a) `=destroy`(b) ]# for i in countdown(n.len-1, 0): analyse(c, b, n[i]) if canRaise(n[0]): returnStmt(b) of nkSym: # any usage of the location before destruction implies we # cannot elide the 'wasMoved(x)': b.invalidateWasMoved n of nkNone..pred(nkSym), succ(nkSym)..nkNilLit, nkTypeSection, nkProcDef, nkConverterDef, nkMethodDef, nkIteratorDef, nkMacroDef, nkTemplateDef, nkLambda, nkDo, nkFuncDef, nkConstSection, nkConstDef, nkIncludeStmt, nkImportStmt, nkExportStmt, nkPragma, nkCommentStmt, nkBreakState, nkTypeOfExpr, nkMixinStmt, nkBindStmt: discard "do not follow the construct" of nkAsgn, nkFastAsgn, nkSinkAsgn: # reverse order, see remark for `=sink`: analyse(c, b, n[1]) analyse(c, b, n[0]) of nkIfStmt, nkIfExpr: let isExhaustive = n[^1].kind in {nkElse, nkElseExpr} var wasMovedSet: seq[PNode] = @[] for i in 0 ..< n.len: var branch = nestedBlock(b, n[i].kind) analyse(c, branch, n[i]) mergeBasicBlockInfo(b, branch) if isExhaustive: if i == 0: wasMovedSet = move(branch.wasMovedLocs) else: wasMovedSet.intersect(branch.wasMovedLocs) for i in 0..<wasMovedSet.len: b.wasMovedLocs.add wasMovedSet[i] of nkCaseStmt: let isExhaustive = skipTypes(n[0].typ, abstractVarRange-{tyTypeDesc}).kind notin {tyFloat..tyFloat128, tyString, tyCstring} or n[^1].kind == nkElse analyse(c, b, n[0]) var wasMovedSet: seq[PNode] = @[] for i in 1 ..< n.len: var branch = nestedBlock(b, n[i].kind) analyse(c, branch, n[i]) mergeBasicBlockInfo(b, branch) if isExhaustive: if i == 1: wasMovedSet = move(branch.wasMovedLocs) else: wasMovedSet.intersect(branch.wasMovedLocs) for i in 0..<wasMovedSet.len: b.wasMovedLocs.add wasMovedSet[i] of nkTryStmt: for i in 0 ..< n.len: var tryBody = nestedBlock(b, nkTryStmt) analyse(c, tryBody, n[i]) mergeBasicBlockInfo(b, tryBody) of nkWhileStmt: analyse(c, b, n[0]) var loopBody = nestedBlock(b, nkWhileStmt) analyse(c, loopBody, n[1]) mergeBasicBlockInfo(b, loopBody) of nkBlockStmt, nkBlockExpr: var blockBody = nestedBlock(b, n.kind) if n[0].kind == nkSym: blockBody.label = n[0].sym analyse(c, blockBody, n[1]) mergeBasicBlockInfo(b, blockBody) of nkBreakStmt: breakStmt(b, n[0]) of nkReturnStmt, nkRaiseStmt: for child in n: analyse(c, b, child) returnStmt(b) of nkFinally: inc c.inFinally for child in n: analyse(c, b, child) dec c.inFinally else: for child in n: analyse(c, b, child) proc opt(c: Con; n, parent: PNode; parentPos: int) = template recurse() = let x = shallowCopy(n) for i in 0 ..< n.len: opt(c, n[i], x, i) parent[parentPos] = x case n.kind of nkCallKinds: if nfMarkForDeletion in n.flags: parent[parentPos] = newNodeI(nkEmpty, n.info) else: recurse() of nkNone..nkNilLit, nkTypeSection, nkProcDef, nkConverterDef, nkMethodDef, nkIteratorDef, nkMacroDef, nkTemplateDef, nkLambda, nkDo, nkFuncDef, nkConstSection, nkConstDef, nkIncludeStmt, nkImportStmt, nkExportStmt, nkPragma, nkCommentStmt, nkBreakState, nkTypeOfExpr, nkMixinStmt, nkBindStmt: parent[parentPos] = n else: recurse() proc optimize*(n: PNode): PNode = # optimize away simple 'wasMoved(x); destroy(x)' pairs. #[ Unfortunately this optimization is only really safe when no exceptions are possible, see for example: proc main(inp: string; cond: bool) = if cond: try: var s = ["hi", inp & "more"] for i in 0..4: use s consume(s) wasMoved(s) finally: destroy(s) Now assume 'use' raises, then we shouldn't do the 'wasMoved(s)' ]# var c: Con = Con() var b: BasicBlock analyse(c, b, n) if c.somethingTodo: result = shallowCopy(n) for i in 0 ..< n.safeLen: opt(c, n[i], result, i) else: result = n