summaryrefslogtreecommitdiff
path: root/tool/mk_call_iseq_optimized.rb
diff options
context:
space:
mode:
authorsvn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-23 17:53:53 +0000
committersvn <svn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-23 17:53:53 +0000
commit31f21aed2cee297a1fc316d60744697580446608 (patch)
tree1743b32239795859770ffa356ce93e4303497918 /tool/mk_call_iseq_optimized.rb
parent593cf11adbf8b133bc027d1b467ca91f47cb5b7f (diff)
* properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/mk_call_iseq_optimized.rb')
-rw-r--r--tool/mk_call_iseq_optimized.rb144
1 files changed, 72 insertions, 72 deletions
diff --git a/tool/mk_call_iseq_optimized.rb b/tool/mk_call_iseq_optimized.rb
index d99de0a..3d98a14 100644
--- a/tool/mk_call_iseq_optimized.rb
+++ b/tool/mk_call_iseq_optimized.rb
@@ -1,72 +1,72 @@
-
-puts <<EOS
-#if 1 /* enable or disable this optimization */
-
-/* DO NOT EDIT THIS FILE DIRECTLY
- *
- * This file is enerated by tool/mkcall_iseq.rb
- */
-
-EOS
-
-P = (0..3)
-L = (1..6)
-
-def fname param, local
- "vm_call_iseq_setup_normal_0start_#{param}params_#{local}locals"
-end
-
-P.each{|param|
- L.each{|local|
- puts <<EOS
-static VALUE
-#{fname(param, local)}(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
-{
- return vm_call_iseq_setup_normal(th, cfp, calling, ci, cc, 0, #{param}, #{local});
-}
-
-EOS
- #
- }
-}
-
-puts <<EOS
-/* vm_call_iseq_handlers[param][local] */
-static const vm_call_handler vm_call_iseq_handlers[][#{L.to_a.size}] = {
-#{P.map{|param| '{' + L.map{|local| fname(param, local)}.join(",\n ") + '}'}.join(",\n")}
-};
-
-static inline vm_call_handler
-vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size)
-{
- if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
- return vm_call_iseq_setup_tailcall_0start;
- }
- else if (0) { /* to disable optimize */
- return vm_call_iseq_setup_normal_0start;
- }
- else {
- if (param_size <= #{P.end} &&
- local_size <= #{L.end}) {
- VM_ASSERT(local_size != 0);
- return vm_call_iseq_handlers[param_size][local_size-1];
- }
- return vm_call_iseq_setup_normal_0start;
- }
-}
-
-#else
-
-
-static inline vm_call_handler
-vm_call_iseq_setup_func(const struct rb_call_info *ci, struct rb_call_cache *cc)
-{
- if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
- return vm_call_iseq_setup_tailcall_0start;
- }
- else {
- return vm_call_iseq_setup_normal_0start;
- }
-}
-#endif
-EOS
+
+puts <<EOS
+#if 1 /* enable or disable this optimization */
+
+/* DO NOT EDIT THIS FILE DIRECTLY
+ *
+ * This file is enerated by tool/mkcall_iseq.rb
+ */
+
+EOS
+
+P = (0..3)
+L = (1..6)
+
+def fname param, local
+ "vm_call_iseq_setup_normal_0start_#{param}params_#{local}locals"
+end
+
+P.each{|param|
+ L.each{|local|
+ puts <<EOS
+static VALUE
+#{fname(param, local)}(rb_thread_t *th, rb_control_frame_t *cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc)
+{
+ return vm_call_iseq_setup_normal(th, cfp, calling, ci, cc, 0, #{param}, #{local});
+}
+
+EOS
+ #
+ }
+}
+
+puts <<EOS
+/* vm_call_iseq_handlers[param][local] */
+static const vm_call_handler vm_call_iseq_handlers[][#{L.to_a.size}] = {
+#{P.map{|param| '{' + L.map{|local| fname(param, local)}.join(",\n ") + '}'}.join(",\n")}
+};
+
+static inline vm_call_handler
+vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size)
+{
+ if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
+ return vm_call_iseq_setup_tailcall_0start;
+ }
+ else if (0) { /* to disable optimize */
+ return vm_call_iseq_setup_normal_0start;
+ }
+ else {
+ if (param_size <= #{P.end} &&
+ local_size <= #{L.end}) {
+ VM_ASSERT(local_size != 0);
+ return vm_call_iseq_handlers[param_size][local_size-1];
+ }
+ return vm_call_iseq_setup_normal_0start;
+ }
+}
+
+#else
+
+
+static inline vm_call_handler
+vm_call_iseq_setup_func(const struct rb_call_info *ci, struct rb_call_cache *cc)
+{
+ if (UNLIKELY(ci->flag & VM_CALL_TAILCALL)) {
+ return vm_call_iseq_setup_tailcall_0start;
+ }
+ else {
+ return vm_call_iseq_setup_normal_0start;
+ }
+}
+#endif
+EOS