[前][次][番号順一覧][スレッド一覧]

ruby-changes:72885

From: Jeremy <ko1@a...>
Date: Wed, 10 Aug 2022 14:20:00 +0900 (JST)
Subject: [ruby-changes:72885] d9167491db (master): Revert "Remove reverse VM instruction"

https://git.ruby-lang.org/ruby.git/commit/?id=d9167491db

From d9167491db220756df159048348f006619df28c1 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Wed, 20 Jul 2022 12:24:50 -0700
Subject: Revert "Remove reverse VM instruction"

This reverts commit 5512353d97250e85c13bf10b9b32e750478cf474.
---
 insns.def | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/insns.def b/insns.def
index 06ca31a850..ebdbed6237 100644
--- a/insns.def
+++ b/insns.def
@@ -597,6 +597,25 @@ swap https://github.com/ruby/ruby/blob/trunk/insns.def#L597
     /* none */
 }
 
+/* reverse stack top N order. */
+DEFINE_INSN
+reverse
+(rb_num_t n)
+(...)
+(...)
+// attr rb_snum_t sp_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;
+    }
+}
+
 /* for stack caching. */
 DEFINE_INSN_IF(STACK_CACHING)
 reput
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]