[PATCH 1/4] embedded: Use more registers on ARM as there are plenty and reduce the alignment

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/4] embedded: Use more registers on ARM as there are plenty and reduce the alignment

Holger Freyther
2013-04-25  Holger Hans Peter Freyther  <[hidden email]>

        * libgst/md-config.h: Add cases for the ARM architecture.
---
 libgst/ChangeLog   |    4 ++++
 libgst/md-config.h |   10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index 9cf1626..4abaa9a 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
+
+ * libgst/md-config.h: Add cases for the ARM architecture.
+
 2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
 
  * libgst/cint.c: Bind link, fsync, sync for additional C level access.
diff --git a/libgst/md-config.h b/libgst/md-config.h
index 260cac0..862fdfd 100644
--- a/libgst/md-config.h
+++ b/libgst/md-config.h
@@ -66,6 +66,16 @@
 # define __DECL_REG3 __asm("%l2")
 #endif
 
+#if defined(__arm__)
+/* We have plenty of registers on ARM but do not enable pipeline */
+# define REG_AVAILABILITY 2
+# define __DECL_REG1 __asm("r4")
+# define __DECL_REG2 __asm("r5")
+# define __DECL_REG3 __asm("r6")
+# define BRANCH_REGISTER(name) register void *name __asm("r7")
+# define L1_CACHE_SHIFT 4
+#endif
+
 #if !defined(__DECL_REG1) && defined(__alpha__)
 # define REG_AVAILABILITY 2
 /* Note: REG3 causes compile problems when trying to fit 64-bit stuff in
--
1.7.10.4


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/4] embedded: Allow to disable the prefetching.

Holger Freyther
Disabling the prefetching is a win on arm9 (arm926ejs, e.g. TI
Davinci DM644x). This was benchmarked using the simple Bench.st
benchmark.

2013-04-28  Holger Hans Peter Freyther  <[hidden email]>

        * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
---
 configure.ac     |    9 +++++++++
 libgst/ChangeLog |    4 ++++
 libgst/gstpriv.h |    3 ++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index fbf1ce9..e0cb5e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -655,6 +655,15 @@ if test "$enable_preemption" != no; then
     [Define to enable preemptive multitasking of Smalltalk processes])
 fi
 
+AC_ARG_ENABLE(prefetch,
+[  --disable-prefetch      disable memory prefetch macros], ,
+enable_prefetch=yes)
+
+if test "$enable_prefetch" != no; then
+  AC_DEFINE(ENABLE_PREFETCH, 1,
+    [Define to enable usage of __builtin_prefetch])
+fi
+
 GST_ARG_ENABLE_MODULES([Blox,TCP])
 
 dnl
diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index 4abaa9a..f952307 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
+
+ * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
+
 2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
 
  * libgst/md-config.h: Add cases for the ARM architecture.
diff --git a/libgst/gstpriv.h b/libgst/gstpriv.h
index 7127438..b3d100f 100644
--- a/libgst/gstpriv.h
+++ b/libgst/gstpriv.h
@@ -175,7 +175,8 @@
 #define PREF_T2 8
 #define PREF_NTA 12
 
-#if GNUC_PREREQ (3, 1)
+/* the prefetch is a loss on on a ARM9 (TI Davinci), hack it out */
+#if defined(ENABLE_PREFETCH) && GNUC_PREREQ (3, 1)
 #define DO_PREFETCH(x, distance, k) \
   __builtin_prefetch (((char *) (x)) \
       + (((k) & PREF_BACKWARDS ? -(distance) : (distance)) \
--
1.7.10.4


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

[PATCH 3/4] embedded: Allow to disable the line number bytecode

Holger Freyther
In reply to this post by Holger Freyther
This is more noticable on smaller devices. Allow to disable the
line number bytecode. This changes the runtime of Bench.st for
4 iterations from 26s to 19s.
---
 gst-tool.c       |    7 ++++++-
 libgst/byte.c    |    8 ++++++--
 libgst/gstpriv.h |    3 +++
 libgst/gstpub.c  |    5 +++++
 libgst/gstpub.h  |    2 ++
 main.c           |    6 ++++++
 6 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/gst-tool.c b/gst-tool.c
index 9cbadce..3f777b4 100644
--- a/gst-tool.c
+++ b/gst-tool.c
@@ -138,7 +138,7 @@ const struct tool tools[] = {
     "gst-remote", "scripts/Remote.st",
     "-h|--help --version --daemon --server -p|--port: -f|--file: -e|--eval: \
  -l|--login: --package: --start: --stop: --pid --kill --snapshot:: \
- -I|--image-file: --kernel-directory: -v|-V|--verbose",
+ -I|--image-file: --kernel-directory: -v|-V|--verbose --no-line-numbers",
     NULL, true
   },
   {
@@ -293,6 +293,11 @@ parse_option (int short_opt, const char *long_opt, const char *arg)
 #endif
     }
 
+  if (long_opt && !strcmp (long_opt, "no-line-numbers"))
+    {
+      gst_omit_line_numbers(true);
+    }
+
   if (long_opt && !strcmp (long_opt, "version"))
     usage = 1;
 
diff --git a/libgst/byte.c b/libgst/byte.c
index 6eed361..50ff07c 100644
--- a/libgst/byte.c
+++ b/libgst/byte.c
@@ -59,6 +59,8 @@
 /* Where the compiled bytecodes go.  */
 bc_vector _gst_cur_bytecodes;
 
+mst_Boolean _gst_omit_line_numbers = 0;
+
 /* Reallocate an array of bytecodes, leaving space for DELTA more
    bytes.  */
 static void realloc_bytecodes (bc_vector bytecodes,
@@ -127,7 +129,8 @@ _gst_line_number (int n, int flags)
       assert (n > 0);
       if (flags & LN_ABSOLUTE)
  {
-  compile_byte (LINE_NUMBER_BYTECODE, n);
+          if (!_gst_omit_line_numbers)
+    compile_byte (LINE_NUMBER_BYTECODE, n);
   _gst_compiler_state->prev_line = n;
  }
       _gst_compiler_state->line_offset = n - 1;
@@ -158,7 +161,8 @@ _gst_compile_byte (gst_uchar byte, int arg)
 {
   if (next_line_number != -1)
     {
-      compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
+      if (!_gst_omit_line_numbers)
+        compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
       next_line_number = -1;
     }
 
diff --git a/libgst/gstpriv.h b/libgst/gstpriv.h
index b3d100f..7e9dcf7 100644
--- a/libgst/gstpriv.h
+++ b/libgst/gstpriv.h
@@ -552,6 +552,9 @@ extern OOP _gst_nil_oop
 #define MIN(x, y) ( ((x) > (y)) ? (y) : (x) )
 #endif
 
+/* helpers */
+extern mst_Boolean _gst_omit_line_numbers;
+
 #include "ansidecl.h"
 #include "mathl.h"
 #include "socketx.h"
diff --git a/libgst/gstpub.c b/libgst/gstpub.c
index 2ebdfe2..c1a17ea 100644
--- a/libgst/gstpub.c
+++ b/libgst/gstpub.c
@@ -609,3 +609,8 @@ gst_set_event_loop_handlers(mst_Boolean (*poll) (int ms),
 {
   return _gst_set_event_loop_handlers(poll, dispatch);
 }
+
+void gst_omit_line_numbers(mst_Boolean omit)
+{
+  _gst_omit_line_numbers = omit;
+}
diff --git a/libgst/gstpub.h b/libgst/gstpub.h
index cec9fc3..bc45bd9 100644
--- a/libgst/gstpub.h
+++ b/libgst/gstpub.h
@@ -342,6 +342,8 @@ extern wchar_t *gst_oop_to_wstring (OOP oop);
 extern mst_Boolean gst_set_event_loop_handlers(mst_Boolean (*poll) (int ms),
        void (*dispatch) (void));
 
+extern void gst_omit_line_numbers(mst_Boolean omit);
+
 /* This is exclusively for programs who link with libgst.a; plugins
    should not use this VMProxy but rather the one they receive in
    gst_initModule.  */
diff --git a/main.c b/main.c
index 9c6bc60..7c050d7 100644
--- a/main.c
+++ b/main.c
@@ -92,6 +92,7 @@ static const char help_text[] =
   "\n      --kernel-directory DIR\t Look for kernel files in directory DIR."
   "\n      --no-user-files\t\t Don't read user customization files.\n"
   "\n   -\t\t\t\t Read input from standard input explicitly."
+  "\n      --no-line-numbers\t\t Do not generate line numbers in the bytecode."
   "\n"
   "\nFiles are loaded one after the other.  After the last one is loaded,"
   "\nSmalltalk will exit.  If no files are specified, Smalltalk reads from"
@@ -122,6 +123,7 @@ static const char copyright_and_legal_stuff_text[] =
 #define OPT_NO_USER 3
 #define OPT_EMACS_MODE 4
 #define OPT_MAYBE_REBUILD 5
+#define OPT_NO_LINE_NUMBERS 6
 
 #define OPTIONS "-acDEf:ghiI:K:lL:QqrSvV"
 
@@ -147,6 +149,7 @@ static const struct option long_options[] = {
   {"snapshot", 0, 0, 'S'},
   {"version", 0, 0, 'v'},
   {"verbose", 0, 0, 'V'},
+  {"no-line-numbers", 0, 0, OPT_NO_LINE_NUMBERS},
   {NULL, 0, 0, 0}
 };
 
@@ -299,6 +302,9 @@ parse_args (int argc,
   loaded_files[n_loaded_files].kernel_path = false;
   loaded_files[n_loaded_files++].file_name = optarg;
   break;
+ case OPT_NO_LINE_NUMBERS:
+  gst_omit_line_numbers(true);
+  break;
 
  default:
   /* Fall through and show help message */
--
1.7.10.4


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

[PATCH 4/4] embedded: Allow to disable the profiling support in the interpreter

Holger Freyther
In reply to this post by Holger Freyther
On ARM9 (e.g. TI Davinci DM644x) disabling the bytecode counter makes
a significant difference on the Bench.st benchmark.

2013-04-28  Holger Hans Peter Freyther  <[hidden email]>

        * libgst/vm.def: Use INCR_LOCAL_COUNTER instead LOCAL_COUNTER++.
        * libgst/interp-bc.inl: Add INCR_LOCAL_COUNTER and allow to disable
        it when ENABLE_PROFILING is not defined.
---
 configure.ac         |    9 +++++++++
 libgst/ChangeLog     |    6 ++++++
 libgst/interp-bc.inl |    6 ++++++
 libgst/vm.def        |    4 ++--
 4 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e0cb5e6..77c0473 100644
--- a/configure.ac
+++ b/configure.ac
@@ -664,6 +664,15 @@ if test "$enable_prefetch" != no; then
     [Define to enable usage of __builtin_prefetch])
 fi
 
+AC_ARG_ENABLE(profiling,
+[  --disable-profiling     disable profiling support], ,
+enable_profiling=yes)
+
+if test "$enable_profiling" != no; then
+  AC_DEFINE(ENABLE_PROFILING, 1,
+    [Define to enable counting bytecodes for profiling support])
+fi
+
 GST_ARG_ENABLE_MODULES([Blox,TCP])
 
 dnl
diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index f952307..ea7ef85 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,5 +1,11 @@
 2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
 
+ * libgst/vm.def: Use INCR_LOCAL_COUNTER instead LOCAL_COUNTER++.
+ * libgst/interp-bc.inl: Add INCR_LOCAL_COUNTER and allow to disable
+ it when ENABLE_PROFILING is not defined.
+
+2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
+
  * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
 
 2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
diff --git a/libgst/interp-bc.inl b/libgst/interp-bc.inl
index 8819481..edfa0c6 100644
--- a/libgst/interp-bc.inl
+++ b/libgst/interp-bc.inl
@@ -463,6 +463,12 @@ _gst_interpret (OOP processOOP)
    LOCAL_COUNTER = 0)
 #endif
 
+#ifdef ENABLE_PROFILING
+# define INCR_LOCAL_COUNTER LOCAL_COUNTER++
+#else
+# define INCR_LOCAL_COUNTER
+#endif
+
 /* If we have a good quantity of registers, activate more caching mechanisms.  */
 #if  REG_AVAILABILITY >= 2
   OOP self_cache, *temp_cache, *lit_cache;
diff --git a/libgst/vm.def b/libgst/vm.def
index fb0b61b..0854828 100644
--- a/libgst/vm.def
+++ b/libgst/vm.def
@@ -205,12 +205,12 @@
 
 operation PREFETCH ( -- ) {
   PREFETCH;
-  LOCAL_COUNTER++;
+  INCR_LOCAL_COUNTER;
 }
 
 operation ADVANCE ( -- ) {
   ip += 2;
-  LOCAL_COUNTER++;
+  INCR_LOCAL_COUNTER;
 }
 
 /* EXT_BYTE extends the argument of the next bytecode; it includes a
--
1.7.10.4


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 3/4] embedded: Allow to disable the line number bytecode

Paolo Bonzini-2
In reply to this post by Holger Freyther
Il 05/05/2013 11:26, Holger Hans Peter Freyther ha scritto:
> This is more noticable on smaller devices. Allow to disable the
> line number bytecode. This changes the runtime of Bench.st for
> 4 iterations from 26s to 19s.

Please use gst_get_var/gst_set_var, otherwise ok.

Paolo

> ---
>  gst-tool.c       |    7 ++++++-
>  libgst/byte.c    |    8 ++++++--
>  libgst/gstpriv.h |    3 +++
>  libgst/gstpub.c  |    5 +++++
>  libgst/gstpub.h  |    2 ++
>  main.c           |    6 ++++++
>  6 files changed, 28 insertions(+), 3 deletions(-)
>
> diff --git a/gst-tool.c b/gst-tool.c
> index 9cbadce..3f777b4 100644
> --- a/gst-tool.c
> +++ b/gst-tool.c
> @@ -138,7 +138,7 @@ const struct tool tools[] = {
>      "gst-remote", "scripts/Remote.st",
>      "-h|--help --version --daemon --server -p|--port: -f|--file: -e|--eval: \
>   -l|--login: --package: --start: --stop: --pid --kill --snapshot:: \
> - -I|--image-file: --kernel-directory: -v|-V|--verbose",
> + -I|--image-file: --kernel-directory: -v|-V|--verbose --no-line-numbers",
>      NULL, true
>    },
>    {
> @@ -293,6 +293,11 @@ parse_option (int short_opt, const char *long_opt, const char *arg)
>  #endif
>      }
>  
> +  if (long_opt && !strcmp (long_opt, "no-line-numbers"))
> +    {
> +      gst_omit_line_numbers(true);
> +    }
> +
>    if (long_opt && !strcmp (long_opt, "version"))
>      usage = 1;
>  
> diff --git a/libgst/byte.c b/libgst/byte.c
> index 6eed361..50ff07c 100644
> --- a/libgst/byte.c
> +++ b/libgst/byte.c
> @@ -59,6 +59,8 @@
>  /* Where the compiled bytecodes go.  */
>  bc_vector _gst_cur_bytecodes;
>  
> +mst_Boolean _gst_omit_line_numbers = 0;
> +
>  /* Reallocate an array of bytecodes, leaving space for DELTA more
>     bytes.  */
>  static void realloc_bytecodes (bc_vector bytecodes,
> @@ -127,7 +129,8 @@ _gst_line_number (int n, int flags)
>        assert (n > 0);
>        if (flags & LN_ABSOLUTE)
>   {
> -  compile_byte (LINE_NUMBER_BYTECODE, n);
> +          if (!_gst_omit_line_numbers)
> +    compile_byte (LINE_NUMBER_BYTECODE, n);
>    _gst_compiler_state->prev_line = n;
>   }
>        _gst_compiler_state->line_offset = n - 1;
> @@ -158,7 +161,8 @@ _gst_compile_byte (gst_uchar byte, int arg)
>  {
>    if (next_line_number != -1)
>      {
> -      compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
> +      if (!_gst_omit_line_numbers)
> +        compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
>        next_line_number = -1;
>      }
>  
> diff --git a/libgst/gstpriv.h b/libgst/gstpriv.h
> index b3d100f..7e9dcf7 100644
> --- a/libgst/gstpriv.h
> +++ b/libgst/gstpriv.h
> @@ -552,6 +552,9 @@ extern OOP _gst_nil_oop
>  #define MIN(x, y) ( ((x) > (y)) ? (y) : (x) )
>  #endif
>  
> +/* helpers */
> +extern mst_Boolean _gst_omit_line_numbers;
> +
>  #include "ansidecl.h"
>  #include "mathl.h"
>  #include "socketx.h"
> diff --git a/libgst/gstpub.c b/libgst/gstpub.c
> index 2ebdfe2..c1a17ea 100644
> --- a/libgst/gstpub.c
> +++ b/libgst/gstpub.c
> @@ -609,3 +609,8 @@ gst_set_event_loop_handlers(mst_Boolean (*poll) (int ms),
>  {
>    return _gst_set_event_loop_handlers(poll, dispatch);
>  }
> +
> +void gst_omit_line_numbers(mst_Boolean omit)
> +{
> +  _gst_omit_line_numbers = omit;
> +}
> diff --git a/libgst/gstpub.h b/libgst/gstpub.h
> index cec9fc3..bc45bd9 100644
> --- a/libgst/gstpub.h
> +++ b/libgst/gstpub.h
> @@ -342,6 +342,8 @@ extern wchar_t *gst_oop_to_wstring (OOP oop);
>  extern mst_Boolean gst_set_event_loop_handlers(mst_Boolean (*poll) (int ms),
>         void (*dispatch) (void));
>  
> +extern void gst_omit_line_numbers(mst_Boolean omit);
> +
>  /* This is exclusively for programs who link with libgst.a; plugins
>     should not use this VMProxy but rather the one they receive in
>     gst_initModule.  */
> diff --git a/main.c b/main.c
> index 9c6bc60..7c050d7 100644
> --- a/main.c
> +++ b/main.c
> @@ -92,6 +92,7 @@ static const char help_text[] =
>    "\n      --kernel-directory DIR\t Look for kernel files in directory DIR."
>    "\n      --no-user-files\t\t Don't read user customization files.\n"
>    "\n   -\t\t\t\t Read input from standard input explicitly."
> +  "\n      --no-line-numbers\t\t Do not generate line numbers in the bytecode."
>    "\n"
>    "\nFiles are loaded one after the other.  After the last one is loaded,"
>    "\nSmalltalk will exit.  If no files are specified, Smalltalk reads from"
> @@ -122,6 +123,7 @@ static const char copyright_and_legal_stuff_text[] =
>  #define OPT_NO_USER 3
>  #define OPT_EMACS_MODE 4
>  #define OPT_MAYBE_REBUILD 5
> +#define OPT_NO_LINE_NUMBERS 6
>  
>  #define OPTIONS "-acDEf:ghiI:K:lL:QqrSvV"
>  
> @@ -147,6 +149,7 @@ static const struct option long_options[] = {
>    {"snapshot", 0, 0, 'S'},
>    {"version", 0, 0, 'v'},
>    {"verbose", 0, 0, 'V'},
> +  {"no-line-numbers", 0, 0, OPT_NO_LINE_NUMBERS},
>    {NULL, 0, 0, 0}
>  };
>  
> @@ -299,6 +302,9 @@ parse_args (int argc,
>    loaded_files[n_loaded_files].kernel_path = false;
>    loaded_files[n_loaded_files++].file_name = optarg;
>    break;
> + case OPT_NO_LINE_NUMBERS:
> +  gst_omit_line_numbers(true);
> +  break;
>  
>   default:
>    /* Fall through and show help message */
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 4/4] embedded: Allow to disable the profiling support in the interpreter

Paolo Bonzini-2
In reply to this post by Holger Freyther
Il 05/05/2013 11:26, Holger Hans Peter Freyther ha scritto:
> On ARM9 (e.g. TI Davinci DM644x) disabling the bytecode counter makes
> a significant difference on the Bench.st benchmark.
>
> 2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
>
> * libgst/vm.def: Use INCR_LOCAL_COUNTER instead LOCAL_COUNTER++.
> * libgst/interp-bc.inl: Add INCR_LOCAL_COUNTER and allow to disable
> it when ENABLE_PROFILING is not defined.

Please adjust comp.c to not print the value.  Also you need to make the
rawProfile primitive fail, and signal an exception in the Smalltalk code
that calls it.

Paolo


> ---
>  configure.ac         |    9 +++++++++
>  libgst/ChangeLog     |    6 ++++++
>  libgst/interp-bc.inl |    6 ++++++
>  libgst/vm.def        |    4 ++--
>  4 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index e0cb5e6..77c0473 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -664,6 +664,15 @@ if test "$enable_prefetch" != no; then
>      [Define to enable usage of __builtin_prefetch])
>  fi
>  
> +AC_ARG_ENABLE(profiling,
> +[  --disable-profiling     disable profiling support], ,
> +enable_profiling=yes)
> +
> +if test "$enable_profiling" != no; then
> +  AC_DEFINE(ENABLE_PROFILING, 1,
> +    [Define to enable counting bytecodes for profiling support])
> +fi
> +
>  GST_ARG_ENABLE_MODULES([Blox,TCP])
>  
>  dnl
> diff --git a/libgst/ChangeLog b/libgst/ChangeLog
> index f952307..ea7ef85 100644
> --- a/libgst/ChangeLog
> +++ b/libgst/ChangeLog
> @@ -1,5 +1,11 @@
>  2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
>  
> + * libgst/vm.def: Use INCR_LOCAL_COUNTER instead LOCAL_COUNTER++.
> + * libgst/interp-bc.inl: Add INCR_LOCAL_COUNTER and allow to disable
> + it when ENABLE_PROFILING is not defined.
> +
> +2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
> +
>   * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
>  
>  2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
> diff --git a/libgst/interp-bc.inl b/libgst/interp-bc.inl
> index 8819481..edfa0c6 100644
> --- a/libgst/interp-bc.inl
> +++ b/libgst/interp-bc.inl
> @@ -463,6 +463,12 @@ _gst_interpret (OOP processOOP)
>     LOCAL_COUNTER = 0)
>  #endif
>  
> +#ifdef ENABLE_PROFILING
> +# define INCR_LOCAL_COUNTER LOCAL_COUNTER++
> +#else
> +# define INCR_LOCAL_COUNTER
> +#endif
> +
>  /* If we have a good quantity of registers, activate more caching mechanisms.  */
>  #if  REG_AVAILABILITY >= 2
>    OOP self_cache, *temp_cache, *lit_cache;
> diff --git a/libgst/vm.def b/libgst/vm.def
> index fb0b61b..0854828 100644
> --- a/libgst/vm.def
> +++ b/libgst/vm.def
> @@ -205,12 +205,12 @@
>  
>  operation PREFETCH ( -- ) {
>    PREFETCH;
> -  LOCAL_COUNTER++;
> +  INCR_LOCAL_COUNTER;
>  }
>  
>  operation ADVANCE ( -- ) {
>    ip += 2;
> -  LOCAL_COUNTER++;
> +  INCR_LOCAL_COUNTER;
>  }
>  
>  /* EXT_BYTE extends the argument of the next bytecode; it includes a
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 2/4] embedded: Allow to disable the prefetching.

Paolo Bonzini-2
In reply to this post by Holger Freyther
Il 05/05/2013 11:26, Holger Hans Peter Freyther ha scritto:
> Disabling the prefetching is a win on arm9 (arm926ejs, e.g. TI
> Davinci DM644x). This was benchmarked using the simple Bench.st
> benchmark.

Can you do this from md-config.h instead?

Paolo

> 2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
>
> * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
> ---
>  configure.ac     |    9 +++++++++
>  libgst/ChangeLog |    4 ++++
>  libgst/gstpriv.h |    3 ++-
>  3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index fbf1ce9..e0cb5e6 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -655,6 +655,15 @@ if test "$enable_preemption" != no; then
>      [Define to enable preemptive multitasking of Smalltalk processes])
>  fi
>  
> +AC_ARG_ENABLE(prefetch,
> +[  --disable-prefetch      disable memory prefetch macros], ,
> +enable_prefetch=yes)
> +
> +if test "$enable_prefetch" != no; then
> +  AC_DEFINE(ENABLE_PREFETCH, 1,
> +    [Define to enable usage of __builtin_prefetch])
> +fi
> +
>  GST_ARG_ENABLE_MODULES([Blox,TCP])
>  
>  dnl
> diff --git a/libgst/ChangeLog b/libgst/ChangeLog
> index 4abaa9a..f952307 100644
> --- a/libgst/ChangeLog
> +++ b/libgst/ChangeLog
> @@ -1,3 +1,7 @@
> +2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
> +
> + * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
> +
>  2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
>  
>   * libgst/md-config.h: Add cases for the ARM architecture.
> diff --git a/libgst/gstpriv.h b/libgst/gstpriv.h
> index 7127438..b3d100f 100644
> --- a/libgst/gstpriv.h
> +++ b/libgst/gstpriv.h
> @@ -175,7 +175,8 @@
>  #define PREF_T2 8
>  #define PREF_NTA 12
>  
> -#if GNUC_PREREQ (3, 1)
> +/* the prefetch is a loss on on a ARM9 (TI Davinci), hack it out */
> +#if defined(ENABLE_PREFETCH) && GNUC_PREREQ (3, 1)
>  #define DO_PREFETCH(x, distance, k) \
>    __builtin_prefetch (((char *) (x)) \
>        + (((k) & PREF_BACKWARDS ? -(distance) : (distance)) \
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/4] embedded: Use more registers on ARM as there are plenty and reduce the alignment

Paolo Bonzini-2
In reply to this post by Holger Freyther
Il 05/05/2013 11:25, Holger Hans Peter Freyther ha scritto:
> 2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
>
> * libgst/md-config.h: Add cases for the ARM architecture.

Ok.

Paolo

> ---
>  libgst/ChangeLog   |    4 ++++
>  libgst/md-config.h |   10 ++++++++++
>  2 files changed, 14 insertions(+)
>
> diff --git a/libgst/ChangeLog b/libgst/ChangeLog
> index 9cf1626..4abaa9a 100644
> --- a/libgst/ChangeLog
> +++ b/libgst/ChangeLog
> @@ -1,3 +1,7 @@
> +2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
> +
> + * libgst/md-config.h: Add cases for the ARM architecture.
> +
>  2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
>  
>   * libgst/cint.c: Bind link, fsync, sync for additional C level access.
> diff --git a/libgst/md-config.h b/libgst/md-config.h
> index 260cac0..862fdfd 100644
> --- a/libgst/md-config.h
> +++ b/libgst/md-config.h
> @@ -66,6 +66,16 @@
>  # define __DECL_REG3 __asm("%l2")
>  #endif
>  
> +#if defined(__arm__)
> +/* We have plenty of registers on ARM but do not enable pipeline */
> +# define REG_AVAILABILITY 2
> +# define __DECL_REG1 __asm("r4")
> +# define __DECL_REG2 __asm("r5")
> +# define __DECL_REG3 __asm("r6")
> +# define BRANCH_REGISTER(name) register void *name __asm("r7")
> +# define L1_CACHE_SHIFT 4
> +#endif
> +
>  #if !defined(__DECL_REG1) && defined(__alpha__)
>  # define REG_AVAILABILITY 2
>  /* Note: REG3 causes compile problems when trying to fit 64-bit stuff in
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

[PATCH] embedded: Allow to disable the line number bytecode

Holger Freyther
In reply to this post by Paolo Bonzini-2
This is more noticable on smaller devices. Allow to disable the
line number bytecode. This changes the runtime of Bench.st for
4 iterations from 26s to 19s.
---
 gst-tool.c      |    7 ++++++-
 libgst/byte.c   |    8 ++++++--
 libgst/files.h  |    5 +++++
 libgst/gst.h    |    3 ++-
 libgst/gstpub.c |    1 +
 libgst/interp.c |    5 +++++
 main.c          |    6 ++++++
 7 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/gst-tool.c b/gst-tool.c
index 9cbadce..552c214 100644
--- a/gst-tool.c
+++ b/gst-tool.c
@@ -138,7 +138,7 @@ const struct tool tools[] = {
     "gst-remote", "scripts/Remote.st",
     "-h|--help --version --daemon --server -p|--port: -f|--file: -e|--eval: \
  -l|--login: --package: --start: --stop: --pid --kill --snapshot:: \
- -I|--image-file: --kernel-directory: -v|-V|--verbose",
+ -I|--image-file: --kernel-directory: -v|-V|--verbose --no-line-numbers",
     NULL, true
   },
   {
@@ -293,6 +293,11 @@ parse_option (int short_opt, const char *long_opt, const char *arg)
 #endif
     }
 
+  if (long_opt && !strcmp (long_opt, "no-line-numbers"))
+    {
+      gst_set_var(GST_NO_LINE_NUMBERS, true);
+    }
+
   if (long_opt && !strcmp (long_opt, "version"))
     usage = 1;
 
diff --git a/libgst/byte.c b/libgst/byte.c
index 6eed361..50ff07c 100644
--- a/libgst/byte.c
+++ b/libgst/byte.c
@@ -59,6 +59,8 @@
 /* Where the compiled bytecodes go.  */
 bc_vector _gst_cur_bytecodes;
 
+mst_Boolean _gst_omit_line_numbers = 0;
+
 /* Reallocate an array of bytecodes, leaving space for DELTA more
    bytes.  */
 static void realloc_bytecodes (bc_vector bytecodes,
@@ -127,7 +129,8 @@ _gst_line_number (int n, int flags)
       assert (n > 0);
       if (flags & LN_ABSOLUTE)
  {
-  compile_byte (LINE_NUMBER_BYTECODE, n);
+          if (!_gst_omit_line_numbers)
+    compile_byte (LINE_NUMBER_BYTECODE, n);
   _gst_compiler_state->prev_line = n;
  }
       _gst_compiler_state->line_offset = n - 1;
@@ -158,7 +161,8 @@ _gst_compile_byte (gst_uchar byte, int arg)
 {
   if (next_line_number != -1)
     {
-      compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
+      if (!_gst_omit_line_numbers)
+        compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
       next_line_number = -1;
     }
 
diff --git a/libgst/files.h b/libgst/files.h
index 2983c32..68f5f68 100644
--- a/libgst/files.h
+++ b/libgst/files.h
@@ -142,4 +142,9 @@ extern char *_gst_find_file (const char *fileName,
      enum gst_file_dir dir)
   ATTRIBUTE_HIDDEN;
 
+/* Omit line numbers in the generated bytecode.  */
+extern mst_Boolean _gst_omit_line_numbers
+   ATTRIBUTE_HIDDEN;
+
+
 #endif /* GST_LIB_H */
diff --git a/libgst/gst.h b/libgst/gst.h
index 5b95023..da81618 100644
--- a/libgst/gst.h
+++ b/libgst/gst.h
@@ -222,7 +222,8 @@ enum gst_var_index {
   GST_GC_MESSAGE,
   GST_VERBOSITY,
   GST_MAKE_CORE_FILE,
-  GST_REGRESSION_TESTING
+  GST_REGRESSION_TESTING,
+  GST_NO_LINE_NUMBERS
 };
 
 enum gst_init_flags {
diff --git a/libgst/gstpub.c b/libgst/gstpub.c
index 2ebdfe2..29c4d19 100644
--- a/libgst/gstpub.c
+++ b/libgst/gstpub.c
@@ -609,3 +609,4 @@ gst_set_event_loop_handlers(mst_Boolean (*poll) (int ms),
 {
   return _gst_set_event_loop_handlers(poll, dispatch);
 }
+
diff --git a/libgst/interp.c b/libgst/interp.c
index 3b74614..0ec2def 100644
--- a/libgst/interp.c
+++ b/libgst/interp.c
@@ -2160,6 +2160,8 @@ _gst_get_var (enum gst_var_index index)
       return (_gst_make_core_file);
     case GST_REGRESSION_TESTING:
       return (_gst_regression_testing);
+    case GST_NO_LINE_NUMBERS:
+      return (_gst_omit_line_numbers);
     default:
       return (-1);
     }
@@ -2195,6 +2197,9 @@ _gst_set_var (enum gst_var_index index, int value)
     case GST_REGRESSION_TESTING:
       _gst_regression_testing = true;
       break;
+    case GST_NO_LINE_NUMBERS:
+      _gst_omit_line_numbers = value;
+      break;
     default:
       return (-1);
     }
diff --git a/main.c b/main.c
index 9c6bc60..f28aad3 100644
--- a/main.c
+++ b/main.c
@@ -92,6 +92,7 @@ static const char help_text[] =
   "\n      --kernel-directory DIR\t Look for kernel files in directory DIR."
   "\n      --no-user-files\t\t Don't read user customization files.\n"
   "\n   -\t\t\t\t Read input from standard input explicitly."
+  "\n      --no-line-numbers\t\t Do not generate line numbers in the bytecode."
   "\n"
   "\nFiles are loaded one after the other.  After the last one is loaded,"
   "\nSmalltalk will exit.  If no files are specified, Smalltalk reads from"
@@ -122,6 +123,7 @@ static const char copyright_and_legal_stuff_text[] =
 #define OPT_NO_USER 3
 #define OPT_EMACS_MODE 4
 #define OPT_MAYBE_REBUILD 5
+#define OPT_NO_LINE_NUMBERS 6
 
 #define OPTIONS "-acDEf:ghiI:K:lL:QqrSvV"
 
@@ -147,6 +149,7 @@ static const struct option long_options[] = {
   {"snapshot", 0, 0, 'S'},
   {"version", 0, 0, 'v'},
   {"verbose", 0, 0, 'V'},
+  {"no-line-numbers", 0, 0, OPT_NO_LINE_NUMBERS},
   {NULL, 0, 0, 0}
 };
 
@@ -299,6 +302,9 @@ parse_args (int argc,
   loaded_files[n_loaded_files].kernel_path = false;
   loaded_files[n_loaded_files++].file_name = optarg;
   break;
+ case OPT_NO_LINE_NUMBERS:
+  gst_set_var(GST_NO_LINE_NUMBERS, true);
+  break;
 
  default:
   /* Fall through and show help message */
--
1.7.10.4


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

[PATCH] embedded: Allow to disable the prefetching.

Holger Freyther
In reply to this post by Paolo Bonzini-2
Disabling the prefetching is a win on arm9 (arm926ejs, e.g. TI
Davinci DM644x). This was benchmarked using the simple Bench.st
benchmark.

2013-04-28  Holger Hans Peter Freyther  <[hidden email]>

        * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
---
 libgst/ChangeLog   |    4 ++++
 libgst/gstpriv.h   |    7 +++++--
 libgst/md-config.h |    1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/libgst/ChangeLog b/libgst/ChangeLog
index 4a51cee..3812850 100644
--- a/libgst/ChangeLog
+++ b/libgst/ChangeLog
@@ -1,5 +1,9 @@
 2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
 
+ * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
+
+2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
+
  * libgst/cint.c: Bind link, fsync, sync for additional C level access.
 
 2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
diff --git a/libgst/gstpriv.h b/libgst/gstpriv.h
index 7127438..7ffe37b 100644
--- a/libgst/gstpriv.h
+++ b/libgst/gstpriv.h
@@ -115,6 +115,7 @@
 #endif
 
 #include "gst.h"
+#include "md-config.h"
 
 /* Convenience macros to test the versions of GCC.  Note - they won't
    work for GCC1, since the _MINOR macros were not defined then, but
@@ -175,7 +176,9 @@
 #define PREF_T2 8
 #define PREF_NTA 12
 
-#if GNUC_PREREQ (3, 1)
+/* the prefetch is a loss on on a ARM9 (TI Davinci), hack it out */
+#if !defined(DISABLE_PREFETCH) && GNUC_PREREQ (3, 1)
+#warning "ENABLE PREFETCH"
 #define DO_PREFETCH(x, distance, k) \
   __builtin_prefetch (((char *) (x)) \
       + (((k) & PREF_BACKWARDS ? -(distance) : (distance)) \
@@ -183,6 +186,7 @@
       (k) & PREF_WRITE, \
       3 - (k) / (PREF_NTA / 3))
 #else
+#warning "DISABLE PREFETCH"
 #define DO_PREFETCH(x, distance, kind) ((void)(x))
 #endif
 
@@ -556,7 +560,6 @@ extern OOP _gst_nil_oop
 #include "socketx.h"
 #include "strspell.h"
 #include "alloc.h"
-#include "md-config.h"
 #include "avltrees.h"
 #include "rbtrees.h"
 
diff --git a/libgst/md-config.h b/libgst/md-config.h
index 862fdfd..b8ba5bf 100644
--- a/libgst/md-config.h
+++ b/libgst/md-config.h
@@ -74,6 +74,7 @@
 # define __DECL_REG3 __asm("r6")
 # define BRANCH_REGISTER(name) register void *name __asm("r7")
 # define L1_CACHE_SHIFT 4
+# define DISABLE_PREFETCH
 #endif
 
 #if !defined(__DECL_REG1) && defined(__alpha__)
--
1.7.10.4


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] embedded: Allow to disable the prefetching.

Paolo Bonzini-2
Il 17/05/2013 14:40, Holger Hans Peter Freyther ha scritto:

> Disabling the prefetching is a win on arm9 (arm926ejs, e.g. TI
> Davinci DM644x). This was benchmarked using the simple Bench.st
> benchmark.
>
> 2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
>
> * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
> ---
>  libgst/ChangeLog   |    4 ++++
>  libgst/gstpriv.h   |    7 +++++--
>  libgst/md-config.h |    1 +
>  3 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/libgst/ChangeLog b/libgst/ChangeLog
> index 4a51cee..3812850 100644
> --- a/libgst/ChangeLog
> +++ b/libgst/ChangeLog
> @@ -1,5 +1,9 @@
>  2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
>  
> + * libgst/gstpriv.h: Allow to disable the DO_PREFETCH.
> +
> +2013-04-28  Holger Hans Peter Freyther  <[hidden email]>
> +
>   * libgst/cint.c: Bind link, fsync, sync for additional C level access.
>  
>  2013-04-25  Holger Hans Peter Freyther  <[hidden email]>
> diff --git a/libgst/gstpriv.h b/libgst/gstpriv.h
> index 7127438..7ffe37b 100644
> --- a/libgst/gstpriv.h
> +++ b/libgst/gstpriv.h
> @@ -115,6 +115,7 @@
>  #endif
>  
>  #include "gst.h"
> +#include "md-config.h"
>  
>  /* Convenience macros to test the versions of GCC.  Note - they won't
>     work for GCC1, since the _MINOR macros were not defined then, but
> @@ -175,7 +176,9 @@
>  #define PREF_T2 8
>  #define PREF_NTA 12
>  
> -#if GNUC_PREREQ (3, 1)
> +/* the prefetch is a loss on on a ARM9 (TI Davinci), hack it out */
> +#if !defined(DISABLE_PREFETCH) && GNUC_PREREQ (3, 1)
> +#warning "ENABLE PREFETCH"
>  #define DO_PREFETCH(x, distance, k) \
>    __builtin_prefetch (((char *) (x)) \
>        + (((k) & PREF_BACKWARDS ? -(distance) : (distance)) \
> @@ -183,6 +186,7 @@
>        (k) & PREF_WRITE, \
>        3 - (k) / (PREF_NTA / 3))
>  #else
> +#warning "DISABLE PREFETCH"

Remove the warnings and it's ok.

Paolo

>  #define DO_PREFETCH(x, distance, kind) ((void)(x))
>  #endif
>  
> @@ -556,7 +560,6 @@ extern OOP _gst_nil_oop
>  #include "socketx.h"
>  #include "strspell.h"
>  #include "alloc.h"
> -#include "md-config.h"
>  #include "avltrees.h"
>  #include "rbtrees.h"
>  
> diff --git a/libgst/md-config.h b/libgst/md-config.h
> index 862fdfd..b8ba5bf 100644
> --- a/libgst/md-config.h
> +++ b/libgst/md-config.h
> @@ -74,6 +74,7 @@
>  # define __DECL_REG3 __asm("r6")
>  # define BRANCH_REGISTER(name) register void *name __asm("r7")
>  # define L1_CACHE_SHIFT 4
> +# define DISABLE_PREFETCH
>  #endif
>  
>  #if !defined(__DECL_REG1) && defined(__alpha__)
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] embedded: Allow to disable the line number bytecode

Paolo Bonzini-2
In reply to this post by Holger Freyther
Il 17/05/2013 14:31, Holger Hans Peter Freyther ha scritto:
> This is more noticable on smaller devices. Allow to disable the
> line number bytecode. This changes the runtime of Bench.st for
> 4 iterations from 26s to 19s.

Just a couple of nits below.  Please fix them and commit!

> ---
>  gst-tool.c      |    7 ++++++-
>  libgst/byte.c   |    8 ++++++--
>  libgst/files.h  |    5 +++++
>  libgst/gst.h    |    3 ++-
>  libgst/gstpub.c |    1 +
>  libgst/interp.c |    5 +++++
>  main.c          |    6 ++++++
>  7 files changed, 31 insertions(+), 4 deletions(-)
>
> diff --git a/gst-tool.c b/gst-tool.c
> index 9cbadce..552c214 100644
> --- a/gst-tool.c
> +++ b/gst-tool.c
> @@ -138,7 +138,7 @@ const struct tool tools[] = {
>      "gst-remote", "scripts/Remote.st",
>      "-h|--help --version --daemon --server -p|--port: -f|--file: -e|--eval: \
>   -l|--login: --package: --start: --stop: --pid --kill --snapshot:: \
> - -I|--image-file: --kernel-directory: -v|-V|--verbose",
> + -I|--image-file: --kernel-directory: -v|-V|--verbose --no-line-numbers",
>      NULL, true
>    },
>    {
> @@ -293,6 +293,11 @@ parse_option (int short_opt, const char *long_opt, const char *arg)
>  #endif
>      }
>  
> +  if (long_opt && !strcmp (long_opt, "no-line-numbers"))
> +    {
> +      gst_set_var(GST_NO_LINE_NUMBERS, true);
> +    }

Extra braces.

> +
>    if (long_opt && !strcmp (long_opt, "version"))
>      usage = 1;
>  
> diff --git a/libgst/byte.c b/libgst/byte.c
> index 6eed361..50ff07c 100644
> --- a/libgst/byte.c
> +++ b/libgst/byte.c
> @@ -59,6 +59,8 @@
>  /* Where the compiled bytecodes go.  */
>  bc_vector _gst_cur_bytecodes;
>  
> +mst_Boolean _gst_omit_line_numbers = 0;
> +
>  /* Reallocate an array of bytecodes, leaving space for DELTA more
>     bytes.  */
>  static void realloc_bytecodes (bc_vector bytecodes,
> @@ -127,7 +129,8 @@ _gst_line_number (int n, int flags)
>        assert (n > 0);
>        if (flags & LN_ABSOLUTE)
>   {
> -  compile_byte (LINE_NUMBER_BYTECODE, n);
> +          if (!_gst_omit_line_numbers)
> +    compile_byte (LINE_NUMBER_BYTECODE, n);
>    _gst_compiler_state->prev_line = n;
>   }
>        _gst_compiler_state->line_offset = n - 1;
> @@ -158,7 +161,8 @@ _gst_compile_byte (gst_uchar byte, int arg)
>  {
>    if (next_line_number != -1)
>      {
> -      compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
> +      if (!_gst_omit_line_numbers)
> +        compile_byte (LINE_NUMBER_BYTECODE, next_line_number);
>        next_line_number = -1;
>      }
>  
> diff --git a/libgst/files.h b/libgst/files.h
> index 2983c32..68f5f68 100644
> --- a/libgst/files.h
> +++ b/libgst/files.h
> @@ -142,4 +142,9 @@ extern char *_gst_find_file (const char *fileName,
>       enum gst_file_dir dir)
>    ATTRIBUTE_HIDDEN;
>  
> +/* Omit line numbers in the generated bytecode.  */
> +extern mst_Boolean _gst_omit_line_numbers
> +   ATTRIBUTE_HIDDEN;
> +
> +
>  #endif /* GST_LIB_H */
> diff --git a/libgst/gst.h b/libgst/gst.h
> index 5b95023..da81618 100644
> --- a/libgst/gst.h
> +++ b/libgst/gst.h
> @@ -222,7 +222,8 @@ enum gst_var_index {
>    GST_GC_MESSAGE,
>    GST_VERBOSITY,
>    GST_MAKE_CORE_FILE,
> -  GST_REGRESSION_TESTING
> +  GST_REGRESSION_TESTING,
> +  GST_NO_LINE_NUMBERS
>  };
>  
>  enum gst_init_flags {
> diff --git a/libgst/gstpub.c b/libgst/gstpub.c
> index 2ebdfe2..29c4d19 100644
> --- a/libgst/gstpub.c
> +++ b/libgst/gstpub.c
> @@ -609,3 +609,4 @@ gst_set_event_loop_handlers(mst_Boolean (*poll) (int ms),
>  {
>    return _gst_set_event_loop_handlers(poll, dispatch);
>  }
> +

Spurious diff.
f

> diff --git a/libgst/interp.c b/libgst/interp.c
> index 3b74614..0ec2def 100644
> --- a/libgst/interp.c
> +++ b/libgst/interp.c
> @@ -2160,6 +2160,8 @@ _gst_get_var (enum gst_var_index index)
>        return (_gst_make_core_file);
>      case GST_REGRESSION_TESTING:
>        return (_gst_regression_testing);
> +    case GST_NO_LINE_NUMBERS:
> +      return (_gst_omit_line_numbers);
>      default:
>        return (-1);
>      }
> @@ -2195,6 +2197,9 @@ _gst_set_var (enum gst_var_index index, int value)
>      case GST_REGRESSION_TESTING:
>        _gst_regression_testing = true;
>        break;
> +    case GST_NO_LINE_NUMBERS:
> +      _gst_omit_line_numbers = value;
> +      break;
>      default:
>        return (-1);
>      }
> diff --git a/main.c b/main.c
> index 9c6bc60..f28aad3 100644
> --- a/main.c
> +++ b/main.c
> @@ -92,6 +92,7 @@ static const char help_text[] =
>    "\n      --kernel-directory DIR\t Look for kernel files in directory DIR."
>    "\n      --no-user-files\t\t Don't read user customization files.\n"
>    "\n   -\t\t\t\t Read input from standard input explicitly."
> +  "\n      --no-line-numbers\t\t Do not generate line numbers in the bytecode."
>    "\n"
>    "\nFiles are loaded one after the other.  After the last one is loaded,"
>    "\nSmalltalk will exit.  If no files are specified, Smalltalk reads from"
> @@ -122,6 +123,7 @@ static const char copyright_and_legal_stuff_text[] =
>  #define OPT_NO_USER 3
>  #define OPT_EMACS_MODE 4
>  #define OPT_MAYBE_REBUILD 5
> +#define OPT_NO_LINE_NUMBERS 6
>  
>  #define OPTIONS "-acDEf:ghiI:K:lL:QqrSvV"
>  
> @@ -147,6 +149,7 @@ static const struct option long_options[] = {
>    {"snapshot", 0, 0, 'S'},
>    {"version", 0, 0, 'v'},
>    {"verbose", 0, 0, 'V'},
> +  {"no-line-numbers", 0, 0, OPT_NO_LINE_NUMBERS},
>    {NULL, 0, 0, 0}
>  };
>  
> @@ -299,6 +302,9 @@ parse_args (int argc,
>    loaded_files[n_loaded_files].kernel_path = false;
>    loaded_files[n_loaded_files++].file_name = optarg;
>    break;
> + case OPT_NO_LINE_NUMBERS:
> +  gst_set_var(GST_NO_LINE_NUMBERS, true);
> +  break;
>  
>   default:
>    /* Fall through and show help message */
>


_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk