From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 584E717DB70A for ; Tue, 25 Nov 2014 11:11:17 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 9719EB5D832 for ; Tue, 25 Nov 2014 11:01:37 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id C63DC97A827 for ; Tue, 25 Nov 2014 11:01:38 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c51Mo98SVOnv for ; Tue, 25 Nov 2014 11:01:38 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id A5CD697A820 for ; Tue, 25 Nov 2014 11:01:38 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 5F0BB95241B for ; Tue, 25 Nov 2014 11:01:37 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 6A6001204F4; Tue, 25 Nov 2014 11:01:34 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by neon.ruby-lang.org (Postfix) with ESMTP id 2A90312049C for ; Tue, 25 Nov 2014 11:01:27 +0900 (JST) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPSA id EA5501FA55; Tue, 25 Nov 2014 02:01:25 +0000 (UTC) Date: Tue, 25 Nov 2014 02:01:25 +0000 From: Eric Wong To: Ruby developers Message-ID: <20141125020125.GA18554@dcvr.yhbt.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ML-Name: ruby-core X-Mail-Count: 66450 Subject: [ruby-core:66450] Re: [ruby-trunk - Feature #8543] rb_iseq_load X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Sorry, the inline patch was an extremely hacky work-in-progress, but I think rb_iseq_load_fix@v1.txt should've been OK with your (non keyword) use cases. Here is a slightly less broken, but still hacky work-in-progress: http://80x24.org/spew/m/rb_iseq_load_fix@v3.txt http://80x24.org/spew/m/rb_iseq_load_fix@v3.txt This is on top of r48554, which was purely a cleanup commit in preparation for this. Notable changes since v1 (and my WIP v2): - iseq#to_ary dumps :kwbits => iseq->params.keyword->bits_start Current hacks: * peephole optimization seems to be not idempotent wrt jump elimination A second pass (optimize => to_ary => load(optimize) eliminates extra useless jumps such as: jump LABEL LABEL: I currently disable peephole optimization to on load to avoid running the optimizer twice, but ideally, the first pass should eliminate the above jump insn. * iseq->stack_size seems not calculated correctly upon load, so I'm currently blindly loading it from the misc hash :x