diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-25 00:20:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-25 00:20:39 +0000 |
commit | 5ac58b272d65cc9921048c076e35df1f42979725 (patch) | |
tree | f3b8f3319c8c2b3b2f12b83c02d81e1b6a7aa373 /insns.def | |
parent | 2c8cea84cc8daf54622eae6907d869eba6f4c422 (diff) | |
download | bundler-5ac58b272d65cc9921048c076e35df1f42979725.tar.gz |
insns.def: reverse
* insns.def (reverse): add new instruction for massign.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -625,6 +625,28 @@ swap /** @c stack + @e reverse stack top N order. + @j スタックトップの n 個の値を逆転する。 + */ +DEFINE_INSN +reverse +(rb_num_t n) +(...) +(...) // inc += 0; +{ + rb_num_t i; + VALUE *sp = STACK_ADDR_FROM_TOP(n); + + for (i=0; i<n/2; i++) { + VALUE v0 = sp[i]; + VALUE v1 = TOPN(i); + sp[i] = v1; + TOPN(i) = v0; + } +} + +/** + @c stack @e for stack caching. @j スタックキャッシングの状態を調整するために必要な命令。 */ |