From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Troels Nielsen Newsgroups: gmane.emacs.devel Subject: [PATCH] Tail-call elimination in byte-compiled code. Date: Thu, 20 Sep 2012 10:15:52 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=e89a8f22beb957c98d04ca1dbbb1 X-Trace: ger.gmane.org 1348128975 31210 80.91.229.3 (20 Sep 2012 08:16:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Sep 2012 08:16:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 20 10:16:19 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TEbvm-0006MO-2r for ged-emacs-devel@m.gmane.org; Thu, 20 Sep 2012 10:16:18 +0200 Original-Received: from localhost ([::1]:48628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEbvh-0006zx-AZ for ged-emacs-devel@m.gmane.org; Thu, 20 Sep 2012 04:16:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEbvX-0006xF-8q for emacs-devel@gnu.org; Thu, 20 Sep 2012 04:16:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEbvP-0002z3-AV for emacs-devel@gnu.org; Thu, 20 Sep 2012 04:16:03 -0400 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:53510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEbvO-0002yA-Gt for emacs-devel@gnu.org; Thu, 20 Sep 2012 04:15:55 -0400 Original-Received: by lbbgj10 with SMTP id gj10so1961286lbb.0 for ; Thu, 20 Sep 2012 01:15:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=gIU73FQoGwhjmHo8+oHyGyg5b7YSISEAaAfvZkP/3wA=; b=D8fRf9DkgBfxtnI10vF5etA0l9zlPfN7TfVR8TH/H4czfDO2OmIEDUMXenT0sC0J1e 20pFbkVbytlA42D9nMGuo6L9C6MlxBspNvfaramu56Wr8CjV7gTqmFhBLcTAwvpHOwPo cUATGL1t//KDExOZbonZnFohsFEM/aP55r8fdb1IUWh1Ng+G5BVF9ZuaLneUbYDGj1Ow gphwBvJ6z+8wbEHPRbxXrN08iCY1EmZ6/rqoa2fKqtCZ07uMrwn7yz1kGYNja/FTbl0k ym7Oj9UCCgBHBuI7hlf0f+odW/M275r5vilL6x+F8QZKNC1Jdn6lDY8U6QMqFkhX2KEH asSQ== Original-Received: by 10.152.147.130 with SMTP id tk2mr944656lab.4.1348128952797; Thu, 20 Sep 2012 01:15:52 -0700 (PDT) Original-Received: by 10.114.25.138 with HTTP; Thu, 20 Sep 2012 01:15:52 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.217.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153399 Archived-At: --e89a8f22beb957c98d04ca1dbbb1 Content-Type: text/plain; charset=ISO-8859-1 Hi all, and thanks for the great work being put into emacs! Now that wonderful lexical scope has been added, it is not very difficult adding tail-call elimination to byte-compiled code. So I've tried to do, just that. The implementation has been made with two new bytecode opcodes, byte-tail-call and byte-self-tail-call. byte-tail-call will allow tail-call elimination when calling any lexically-scoped byte-compiled function from any byte-compiled function. ------ byte-self-tail-call will allow tail-call elimination to itself, so e.g.: ; -*- lexical-binding: t (require 'benchmark) (defun f (x accum) (if (> x 0) (f (1- x) (+ x accum)) accum)) (defun g (x accum) (while (> x 0) (setq accum (+ x accum) x (1- x))) accum) (mapc #'byte-compile (list #'f #'g)) (benchmark-run-compiled 10 (f 1000000 0)) (benchmark-run-compiled 10 (g 1000000 0)) will on my setup even make f some 8% faster than g! ------- byte-tail-call allows mutually tail-recursive functions like e.g: (defun e (n) (if (= n 0) t (o (1- n)))) (defun o (n) (if (= n 0) nil (e (1- n)))) (mapc #'byte-compile (list #'e #'o)) (o 10000000) -> nil (e 10000000) -> t but is a bit slower than byte-self-tail-call. ------ self tail recursive functions has the following little problem: (f 1000000 0) (let ((y (symbol-function 'f))) (fset 'f (lambda (_a _b) -1)) (funcall y 1000000 1)) Where the interpreted behaviour give -1, but the byte-compiled wil be 500000500001. I don't think that is ultimately very serious though. ---- Another problem is that there is a little bit more difference in characteristic between interpreted and byte-compiled code, as interpreted code will quickly read max-eval-depth. I don't see any easy way out of that now tho, and tail-recursion is a very desirable thing for me and likely many others. The patch as is now, will also remove BYTE_CODE_SAFE and BYTE_CODE_METER. They made it more difficult for me to understand what actually went on in bytecode.c. If someone needs them I will gladly add them back. I did try to put up a heap-allocated byte-code stack so to optimize non-tail-recursive inter-byte-code calls avoiding copying the arguments on the byte-stack. This unfortunately gave a small but significant performance reduction, maybe due to the C-stack consistently being in the processor's cache. Also I'm not very fond of byte-compile--tail-position variable, and would rather add it as an argument to the 'byte-compile handlers. I have a patch that does just that along with disbanding byte-compile--for-effect and adding that as an argument along. The only problem is that some backward-compatibility may be broken, but I don't know how much external code is really adding their own 'byte-compile handlers. Would there be any problems with such a patch? In addition this little hunk has been included in the patch, which solves a problem where #'byte-compile would compile lexically-bound functions as though they were dynamically bound. @@ -2503,15 +2515,16 @@ (defun byte-compile (form) (when (symbolp form) (unless (memq (car-safe fun) '(closure lambda)) (error "Don't know how to compile %S" fun)) - (setq fun (byte-compile--reify-function fun)) - (setq lexical-binding (eq (car fun) 'closure))) + (setq lexical-binding (eq (car fun) 'closure)) + (setq fun (byte-compile--reify-function fun))) (unless (eq (car-safe fun) 'lambda) (error "Don't know how to compile %S" fun)) ;; Expand macros. (setq fun (byte-compile-preprocess fun)) Kind Regards Troels Nielsen --e89a8f22beb957c98d04ca1dbbb1 Content-Type: application/octet-stream; name="tail-call-elimination.diff" Content-Disposition: attachment; filename="tail-call-elimination.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h7bkm0sv0 PT09IG1vZGlmaWVkIGZpbGUgJ2xpc3AvZW1hY3MtbGlzcC9ieXRlLW9wdC5lbCcKLS0tIGxpc3Av ZW1hY3MtbGlzcC9ieXRlLW9wdC5lbAkyMDEyLTA3LTI2IDAxOjI3OjMzICswMDAwCisrKyBsaXNw L2VtYWNzLWxpc3AvYnl0ZS1vcHQuZWwJMjAxMi0wOS0xOCAxODo0NDoyNCArMDAwMApAQCAtMTMx Niw4ICsxMzE2LDEwIEBACiAJICgrIChhcmVmIGJ5dGVzIGJ5dGVkZWNvbXAtcHRyKQogCSAgICAo cHJvZ24gKHNldHEgYnl0ZWRlY29tcC1wdHIgKDErIGJ5dGVkZWNvbXAtcHRyKSkKIAkJICAgKGxz aCAoYXJlZiBieXRlcyBieXRlZGVjb21wLXB0cikgOCkpKSkKLQkoKGFuZCAoPj0gYnl0ZWRlY29t cC1vcCBieXRlLWxpc3ROKQotCSAgICAgICg8PSBieXRlZGVjb21wLW9wIGJ5dGUtZGlzY2FyZE4p KQorCSgob3IgKGFuZCAoPj0gYnl0ZWRlY29tcC1vcCBieXRlLWxpc3ROKQorICAgICAgICAgICAg ICAgICAgKDw9IGJ5dGVkZWNvbXAtb3AgYnl0ZS1kaXNjYXJkTikpCisgICAgICAgICAgICAgKD0g Ynl0ZWRlY29tcC1vcCBieXRlLXRhaWwtY2FsbCkKKyAgICAgICAgICAgICAoPS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lIGZvciB0aGUgbm9ybWFs IHZlcnNpb24uCiAgICAgICAgICAgICAgICAoYnl0ZS1jb21waWxlLXB1c2gtYnl0ZWNvZGUtY29u c3QyIGJ5dGUtc3RhY2stc2V0MiBvZmYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYnl0ZXMgcGMpKQotICAgICAgICAgICAgICAoKGFuZCAoPj0gb3Bj b2RlIGJ5dGUtbGlzdE4pCi0gICAgICAgICAgICAgICAgICAgICg8IG9wY29kZSBieXRlLWRpc2Nh cmROKSkKKyAgICAgICAgICAgICAgKChvciAoYW5kICg+PSBvcGNvZGUgYnl0ZS1saXN0TikKKyAg ICAgICAgICAgICAgICAgICAgICAgICg8IG9wY29kZSBieXRlLWRpc2NhcmROKSkKKyAgICAgICAg ICAgICAgICAgICAob3IgKD0gb3Bjb2RlIGJ5dGUtdGFpbC1jYWxsKSAKKyAgICAgICAgICAgICAg ICAgICAgICAgKD0gb3Bjb2RlIGJ5dGUtc2VsZi10YWlsLWNhbGwpKSkKICAgICAgICAgICAgICAg IDs7IFRoZXNlIGluc25zIGFsbCBwdXQgdGhlaXIgb3BlcmFuZCBpbnRvIG9uZSBleHRyYSBieXRl LgogICAgICAgICAgICAgICAgKGJ5dGUtY29tcGlsZS1wdXNoLWJ5dGVjb2RlcyBvcGNvZGUgb2Zm IGJ5dGVzIHBjKSkKICAgICAgICAgICAgICAgKCg9IG9wY29kZSBieXRlLWRpc2NhcmROKQpAQCAt OTIzLDYgKzkyNywxMCBAQAogKGRlZnZhciBieXRlLWNvbXBpbGUtY3VycmVudC1ncm91cCBuaWwp CiAoZGVmdmFyIGJ5dGUtY29tcGlsZS1jdXJyZW50LWJ1ZmZlciBuaWwpCiAKKzs7OyBUaGVzZSBh cmUgdXNlZCBmb3IgbWFraW5nIHNlbGYtdGFpbCBvcHRpbWl6YXRpb24uICAKKyhkZWZ2YXIgYnl0 ZS1jb21waWxlLWN1cnJlbnQtbGFtYmR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ZhbHVlIHRoaXMta2luZCkpKSkKLSAgICAgICAgICApCisgICAgICAgICAgICAgICAg ICAgICAgKHN5bWJvbC12YWx1ZSB0aGlzLWtpbmQpKSkpKQogCiAgICAgKHdoZW4gKGFuZCAobGlz dHAgYm9keSkKICAgICAgICAgICAgICAgIChzdHJpbmdwIChjYXIgYm9keSkpCkBAIC0yMzg0LDcg KzIzOTMsNyBAQAogICAgICAgICAgIDs7IFRlbGwgdGhlIGNhbGxlciB0aGF0IHdlIGRpZG4ndCBj b21waWxlIGl0IHlldC4KICAgICAgICAgICBuaWwpCiAKLSAgICAgIChsZXQqICgoY29kZSAoYnl0 ZS1jb21waWxlLWxhbWJkYSAoY29ucyBhcmdsaXN0IGJvZHkpIHQpKSkKKyAgICAgIChsZXQgKChj b2RlIChieXRlLWNvbXBpbGUtbGFtYmRhIChjb25zIGFyZ2xpc3QgYm9keSkgdCBuaWwgbmFtZSkp KQogICAgICAgICAoaWYgdGhpcy1vbmUKICAgICAgICAgICAgIDs7IEEgZGVmaW5pdGlvbiBpbiBi LWMtaW5pdGlhbC1tLWUgc2hvdWxkIGFsd2F5cyB0YWtlIHByZWNlZGVuY2UKICAgICAgICAgICAg IDs7IGR1cmluZyBjb21waWxhdGlvbiwgc28gZG9uJ3QgbGV0IGl0IGJlIHJlZGVmaW5lZC4gIChC dWcjODY0NykKQEAgLTI0NjIsNiArMjQ3MSw5IEBACiAgIChwY2FzZS1sZXQqICgoKG9yIChhbmQg YChsYW1iZGEgLGFyZ3MgLiAsYm9keSkgKGxldCBlbnYgbmlsKSkKICAgICAgICAgICAgICAgICAg ICAgYChjbG9zdXJlICxlbnYgLGFyZ3MgLiAsYm9keSkpIGZ1bikKICAgICAgICAgICAgICAgIChy ZW52ICgpKSkKKyAgICA7OyBSZW1vdmUgZG9jc3RyaW5nIGlmIGl0IGV4aXN0cworICAgICh3aGVu IChhbmQgKGNkciBib2R5KSAoc3RyaW5ncCBib2R5KSkgCisgICAgICAoc2V0cSBib2R5IChj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NzcSAnaW50ZXJh Y3RpdmUgYm9keSkpKQorCSAoaW50IChhc3NxICdpbnRlcmFjdGl2ZSBib2R5KSkKKyAgICAgICAg IChieXRlLWNvbXBpbGUtY3VycmVudC1sYW1iZGEtbmFtZSBuYW1lKQorICAgICAgICAgKGJ5dGUt Y29tcGlsZS1jdXJyZW50LWxhbWJkYS1hcmdsaXN0IGFyZ2xpc3QpKQogICAgIDs7IFByb2Nlc3Mg dGhlIGludGVyYWN0aXZlIHNwZWMuCiAgICAgKHdoZW4gaW50CiAgICAgICAoYnl0ZS1jb21waWxl LXNldC1zeW1ib2wtcG9zaXRpb24gJ2ludGVyYWN0aXZlKQpAQCAtMjY1Myw3ICsyNjY4LDcgQEAK ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOzsgY2xvc2VkIGJ5IG5vdykuCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhbmQgbGV4aWNhbC1iaW5kaW5nCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGJ5dGUtY29tcGlsZS1tYWtl LWxhbWJkYS1sZXhlbnYgZnVuKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cmVzZXJ2ZWQtY3N0cykpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNl cnZlZC1jc3RzIHQpKSkKICAgICAgIDs7IEJ1aWxkIHRoZSBhY3R1YWwgYnl0ZS1jb2RlZCBmdW5j dGlvbi4KICAgICAgIChjbC1hc3NlcnQgKGVxICdieXRlLWNvZGUgKGNhci1zYWZlIGNvbXBpbGVk KSkpCiAgICAgICAoYXBwbHkgIydtYWtlLWJ5dGUtY29kZQpAQCAtMjcxMyw3ICsyNzI4LDcgQEAK IDs7IEdpdmVuIGFuIGV4cHJlc3Npb24gRk9STSwgY29tcGlsZSBpdCBhbmQgcmV0dXJuIGFuIGVx dWl2YWxlbnQgYnl0ZS1jb2RlCiA7OyBleHByZXNz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gIChvciAobm90IChjZHIgc2lnKSkgCisgICAgICAgICAgICAg ICAgICAgICg8PSBuYXJncyAoY2RyIHNpZykpKSkpKQorICAgIChzZXRxIGZvcm0gKGNkciBmb3Jt KSkKKyAgICAobGV0KiAoKHJlc3QgKG1lbXEgJyZyZXN0IGJ5dGUtY29tcGlsZS1jdXJyZW50LWxh bWJkYS1hcmdsaXN0KSkKKyAgICAgICAgICAgKG5ub3JtYWwtYXJncyAoLSAobGVuZ3RoIGJ5dGUt Y29tcGlsZS1jdXJyZW50LWxhbWJkYS1hcmdsaXN0KQorICAgICAgICAgICAgICAgICAgICAgICAg ICAgIChpZiByZXN0IDIgMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaWYgKG1lbXEg JyZvcHRpb25hbCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZS1j b21waWxlLWN1cnJlbnQtbGFtYmRhLWFyZ2xpc3QpCisgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDEgMCkpKQorICAgICAgICAgICAobmFyZ3MgMCkpCisgICAgICAod2hpbGUgKD4gbm5v cm1hbC1hcmdzIG5hcmdzKQorICAgICAgICAoY2wtaW5jZiBuYXJncykKKyAgICAgICAgKGlmIGZv cm0gCisgICAgICAgICAgICAoYnl0ZS1jb21waWxlLWZvcm0gKHBvcCBmb3JtKSkKKyAgICAgICAg ICAoYnl0ZS1jb21waWxlLWNvbnN0YW50IG5pbCkpKQorICAgICAgKHdoZW4gcmVzdCAoYnl0ZS1j b21waWxlLWxpc3QgKGNvbnMgJ2xpc3QgZm9ybSkpKQorICAgICAgKGJ5dGUtY29tcGlsZS1vdXQg J2J5dGUtc2VsZi10YWlsLWNhbGwgCisgICAgICAgICAgICAgICAgICAgICAgICAoKyBubm9ybWFs LWFyZ3MgKGlmIHJlc3QgMSAwKSkpCisgICAgICA7OyBGSVhNRTogCisgICAgICA7OyBQYWQgdG8g bWFrZSBzdGFjayBtYXRjaCBleHBlY3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MiBmb3JtKSAKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBieXRlLWNvbXBpbGUtLWZvci1lZmZlY3QKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBieXRlLWNvbXBpbGUtLXRhaWwtcG9zaXRpb24pKQogCSAgKGJ5dGUtY29tcGlsZS1v dXQtdGFnIGRvbmV0YWcpKQogICAgICAgKGxldCAoKGVsc2V0YWcgKGJ5dGUtY29tcGlsZS1tYWtl LXRhZykpKQogCShieXRlLWNvbXBpbGUtZ290byAnYnl0ZS1nb3RvLWlmLW5pbCBlbHNldGFnKQog CShieXRlLWNvbXBpbGUtbWF5YmUtZ3VhcmRlZCBjbGF1c2UKLQkgIChieXRlLWNvbXBpbGUtZm9y bSAobnRoIDIgZm9ybSkgYnl0ZS1jb21waWxlLS1mb3ItZWZmZWN0KSkKKwkgIChieXRlLWNvbXBp bGUtZm9ybSAobnRoIDIgZm9ybSkgYnl0ZS1jb21waWxlLS1mb3ItZWZmZWN0CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGJ5dGUtY29tcGlsZS0tdGFpbC1wb3NpdGlvbikpCiAJKGJ5dGUt Y29tcGlsZS1nb3RvICdieXRlLWdvdG8gZG9uZXRhZykKIAkoYnl0ZS1jb21waWxlLW91dC10YWcg ZWxzZXRhZykKIAkoYnl0ZS1jb21waWxlLW1heWJlLWd1YXJkZWQgKGxpc3QgJ25vdCBjbGF1c2Up Ci0JICAoYnl0ZS1jb21waWxlLWJvZHkgKGNkciAoY2RyIChjZHIgZm9ybSkpKSBieXRlLWNvbXBp bGUtLWZvci1lZmZlY3QpKQorCSAgKGJ5dGUtY29tcGlsZS1ib2R5IChjZHIgKGNkciAoY2RyIGZv cm0pKSkgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ5dGUtY29tcGlsZS0tZm9yLWVm ZmVjdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlLWNvbXBpbGUtLXRhaWwtcG9z aXRpb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dGVzIHRoYXQgbmFyZ3MgaXMgaW4gdGhlIHJhbmdlLiAgKi8KK3N0YXRpYyB2b2lkCityZXNvbHZl X2FyZ3NfdGVtcGxhdGUgKHB0cmRpZmZfdCB0ZW1wbGF0ZSwgcHRyZGlmZl90ICptaW5fYXJncywg CisgICAgICAgICAgICAgICAgICAgICAgIHB0cmRpZmZfdCAqbWF4X2FyZ3MsIGJvb2wgKnJlc3Qp Cit7CisgICptYXhfYXJncyA9IHRlbXBsYXRlID4+IDg7CisgICptaW5fYXJncyA9IHRlbXBsYXRl ICYgMHg3RjsKKyAgKnJlc3QgPSAodGVtcGxhdGUgJiAweDgwKSAhPSAwOworfQorCisvKiBNYWtl IHN1cmUgdGhhdCBuYXJncyBpcyB0aGUgcmlnaHQgcmFuZ2UuICAqLworc3RhdGljIHZvaWQKK3Zh bGlkYXRlX25hcmdzIChwdHJkaWZmX3QgbmFyZ3MsIHB0cmRpZmZfdCBtaW5fYXJncywgCisgICAg ICAgICAgICAgICAgcHRyZGlmZl90IG1heF9hcmdzLCBib29sIHJlc3QpCit7CisgIGlmIChuYXJn cyA8IG1pbl9hcmdzKQorICAgIEZzaWduYWwgKFF3cm9uZ19udW1iZXJfb2ZfYXJndW1lbnRzLAor ICAgICAgICAgICAgIEZjb25zIChGY29ucyAobWFrZV9udW1iZXIgKG1pbl9hcmdzKSwKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgIHJlc3QgPyBRYW5kX3Jlc3QgOiBtYWtlX251bWJlciAobWF4 X2FyZ3MpKSwKKyAgICAgICAgICAgICAgICAgICAgRmNvbnMgKG1ha2VfbnVtYmVyIChuYXJncyks IFFuaWwpKSk7CisgIAorICBpZiAobmFyZ3MgPiBtYXhfYXJncyAmJiAhcmVzdCkKKyAgICBGc2ln bmFsIChRd3JvbmdfbnVtYmVyX29mX2FyZ3VtZW50cywKKyAgICAgICAgICAgICBGY29ucyAoRmNv bnMgKG1ha2VfbnVtYmVyIChtaW5fYXJncyksCisgICAgICAgICA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AorICAgICAgICAgICAgICAgdGhhbiB1cy4gICovCisgICAg ICAgICAgICBpZiAoQ09NUElMRURQIChmdW4pICYmIAorICAgICAgICAgICAgICAgIElOVEVHRVJQ ICgodGVtcGwgPSBBUkVGIChmdW4sIENPTVBJTEVEX0FSR0xJU1QpKSkgJiYKKyAgICAgICAgICAg ICAgICBtYXhkZXB0aCA+PSBYSU5UIChBUkVGIChmdW4sIENPTVBJTEVEX1NUQUNLX0RFUFRIKSkp CisgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBieXRlc3RyaW5n OworICAgICAgICAgICAgICAgIHB0cmRpZmZfdCBhcmdfdGVtcGwgPSBYSU5UICh0ZW1wbCk7Cisg ICAgICAgICAgICAgICAgcHRyZGlmZl90IG1heF9hcmdzLCBtaW5fYXJnczsKKyAgICAgICAgICAg ICAgICBib29sIHJlc3Q7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgQllURV9D T0RFX1FVSVQ7CisgICAgICAgICAgICAgICAgTUFZQkVfR0MgKCk7CisKKyAgICAgICAgICAgICAg ICBpZiAoQ09OU1AgKEFSRUYgKGZ1biwgQ09NUElMRURfQllURUNPREUpKSkKKyAgICAgICAgICAg ICAgICAgIEZmZXRjaF9ieXRlY29kZSAoZnVuKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAg ICAgICAgICAvKiBWYWxpZGF0ZSBhcmd1bWVudHMgYW5kIHNldCB1cCBzdGFjayB0aGUgbmV3Cisg ICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gd2lsbCBleHBlY3QuICAqLworICAgICAgICAgICAg ICAgIHJlc29sdmVfYXJnc190ZW1wbGF0ZSAoYXJnX3RlbXBsLCAmbWluX2FyZ3MsIAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1heF9hcmdzLCAmcmVzdCk7CisgICAg ICAgICAgICAgICAgdmFsaWRhdGVfbmFyZ3MgKG9wLCBtaW5fYXJncywgbWF4X2FyZ3MsIHJlc3Qp OworCisgICAgICAgICAgICAgICAgZm9yICg7b3AgPCBtYXhfYXJncztvcCsrKQorICAgICAgICAg ICAgICAgICAgUFVTSCAoUW5pbCk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAg aWYgKHJlc3QpIAorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwdHJk aWZmX3QgZXh0cmEgPSBvcCAtIG1heF9hcmdzOworICAgICAgICAgICAgICAgICAgICBpZiAoZXh0 cmEgPiAwKQorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAg IExpc3BfT2JqZWN0ICpwdHIgPSB0b3AgLSBleHRyYSArIDE7CisgICAgICAgICAgICAgICAgICAg ICAgICAqcHRyID0gRmxpc3QgKGV4dHJhLCBwdHIpOworICAgICAgICAgICAgICAgICAgICAgICAg RElTQ0FSRCAoZXh0cmEgLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAg ICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICBQVVNIIChRbmlsKTsKKyAgICAg ICAgICAgICAgICAgICAgb3AgPSBtYXhfYXJncyArIDE7CisgICAgICAgICAgICAgICAgICB9Cisg ICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbWVtbW92ZSAoYm90dG9tLCB0b3AgLSBv cCArIDEsIG9wICogc2l6ZW9mICgqdG9wKSk7CisgICAgICAgICAgICAgICAgdG9wID0gYm90dG9t ICsgb3AgLSAxOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIC8qIFRoZSBzdGFj ayBpcyBnb29kIHRvIGdvLCBub3cgZm9yIHRoZSByZXN0LiAgKi8KKyAgICAgICAgICAgICAgICBz dGFjay5ieXRlX3N0cmluZyA9IEFSRUYgKGZ1biwgQ09NUElMRURfQllURUNPREUpOworICAgICAg ICAgICAgICAgIC8qIEJhY2t3YXJkIGNvbXBhdGliaWxpdHkgd2l0aCBlbWFjcyBwcmUtMjAuMgor ICAgICAgICAgICAgICAgICAgIGluY2x1c2l2ZWx5LiAgKFNlZSBiZWxvdyBpbiBleGVjX2J5dGVf Y29kZSkuICAqLworICAgICAgICAgICAgICAgIGlmIChTVFJJTkdfTVVMVElCWVRFIChzdGFjay5i eXRlX3N0cmluZykpCisgICAgICAgICAgICAgICAgICBzdGFjay5ieXRlX3N0cmluZyA9IEZzdHJp bmdfYXNfdW5pYnl0ZSAoYnl0ZXN0cik7CisgICAgICAgICAgICAgICAgc3RhY2suYnl0ZV9zdHJp bmdfc3RhcnQgPSBTREFUQSAoc3RhY2suYnl0ZV9zdHJpbmcpOworICAgICAgICAgICAgICAgIHN0 YWNrLnBjID0gc3RhY2suYnl0ZV9zdHJpbmdfc3RhcnQ7CisgICAgICAgICAgICAgICAgc3RhY2su Y29uc3RhbnRzID0gQVJFRiAoZnVuLCBDT01QSUxFRF9DT05TVEFOVFMpOworICAgICAgICAgICAg ICAgIHZlY3RvcnAgPSBYVkVDVE9SIChzdGFjay5jb25zdGFudHMpLT5jb250ZW50czsKKworICAg ICAgICAgICAgICAgIC8qIEFuZCB5b29ob28hICAqLworICAgICAgICAgICAgICAgIE5FWFQ7Cisg ICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGdvdG8gZG9jYWxsOworICAgICAgICAgIH0KKyAg ICAgICAgCisgICAgICAgIENBU0UgKEJzZWxmdGFpbGNhbGwpOgorICAgICAgICAgIG9wID0gRkVU Q0g7CisgICAgICAgICAgCisgICAgICAgICAgQllURV9DT0RFX1FVSVQ7CisgICAgICAgICAgTUFZ QkVfR0MgKCk7CisgICAgICAgICAgCisgICAgICAgICAgLyogQnl0ZSBjb21waWxlciBzaG91bGQg aGF2ZSBzZXQgYWxsIGFyZ3VtZW50cyB1cCByaWdodC4gSXRzCisgICAgICAgICAgICAganVzdCBm b3IgdXMgdG8gcmVtb3ZlIHRoZSBjcnVmdCBvbiB0aGUgc3RhY2suICAqLworICAgIC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