summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def12
1 files changed, 12 insertions, 0 deletions
diff --git a/insns.def b/insns.def
index 5d04e50..c6b5064 100644
--- a/insns.def
+++ b/insns.def
@@ -512,6 +512,18 @@ newhash
}
}
+/* make new Hash object from (frozen) Array object */
+DEFINE_INSN
+newhashfromarray
+(rb_num_t num, VALUE ary)
+()
+(VALUE hash)
+{
+ VM_ASSERT(num * 2 == RARRAY_LEN(ary));
+ hash = rb_hash_new_with_size(num);
+ rb_hash_bulk_insert(num * 2, RARRAY_CONST_PTR(ary), hash);
+}
+
/* put new Range object.(Range.new(low, high, flag)) */
DEFINE_INSN
newrange