aboutsummaryrefslogtreecommitdiffstats
path: root/ChangeLog
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-14 07:53:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-14 07:53:39 +0000
commitea5e885a958967c999e15512c6e72defab232de4 (patch)
tree35b1713bacf79e68f79ec0f5a361e8ac1acae2ba /ChangeLog
parenta4e6f7d707293a71727ad18e75aae9639ba423f3 (diff)
downloadruby-ea5e885a958967c999e15512c6e72defab232de4.tar.gz
optimize named capture assignment
* compile.c (compile_named_capture_assign): optimize named capture assignments, by replacing repeating global variable accesses with `dup`, and by returning the matched result instead of re-getting it from the MatchData. * parse.y (reg_named_capture_assign_gen): build just assignment nodes for the optimization. ex. `/(?<x>.)/ =~ "bar"` - old ``` 0000 putstring "bar" 0002 opt_regexpmatch1 /(?<x>.)/ 0004 pop 0005 getglobal $~ 0007 branchunless 25 0009 getglobal $~ 0011 putobject :x 0013 opt_aref <callinfo!mid:[], argc:1, ARGS_SIMPLE> 0016 setlocal_OP__WC__0 2 0018 getglobal $~ 0020 putobject_OP_INT2FIX_O_0_C_ 0021 opt_send_without_block <callinfo!mid:begin, argc:1, ARGS_SIMPLE> 0024 leave 0025 putobject nil 0027 setlocal_OP__WC__0 2 0029 putobject nil 0031 leave ``` - new ``` 0000 putstring "bar" 0002 opt_regexpmatch1 /(?<x>.)/ 0004 getglobal $~ 0006 dup 0007 branchunless 14 0009 putobject :x 0011 opt_aref <callinfo!mid:[], argc:1, ARGS_SIMPLE> 0014 setlocal_OP__WC__0 2 0016 leave ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog10
1 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 11b2185e01..3e33e3db5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Mar 14 16:53:37 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * compile.c (compile_named_capture_assign): optimize named capture
+ assignments, by replacing repeating global variable accesses
+ with `dup`, and by returning the matched result instead of
+ re-getting it from the MatchData.
+
+ * parse.y (reg_named_capture_assign_gen): build just assignment
+ nodes for the optimization.
+
Mon Mar 14 16:02:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (ruby_is_fd_loadable): now return -1 if loadable but