Skip to content

Commit 1f05ba9

Browse files
ihnortonJeffBezanson
authored andcommitted
remove redundant jl_show entry point
1 parent 0c123c1 commit 1f05ba9

File tree

6 files changed

+4
-27
lines changed

6 files changed

+4
-27
lines changed

examples/embedding/embedding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int main()
9494
jl_eval_string("this_function_does_not_exist()");
9595

9696
if (jl_exception_occurred()) {
97-
jl_show(jl_stderr_obj(), jl_exception_occurred());
97+
jl_call2(jl_get_function(jl_base_module, "show"), jl_stderr_obj(), jl_exception_occurred());
9898
jl_printf(jl_stderr_stream(), "\n");
9999
}
100100

src/jlapi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ JL_DLLEXPORT jl_value_t *jl_eval_string(const char *str)
8080
jl_exception_clear();
8181
}
8282
JL_CATCH {
83-
//jl_show(jl_stderr_obj(), jl_exception_in_transit);
8483
r = NULL;
8584
}
8685
return r;

src/julia.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,6 @@ JL_DLLEXPORT JL_STREAM *jl_stdin_stream(void);
16671667
JL_DLLEXPORT JL_STREAM *jl_stderr_stream(void);
16681668

16691669
// showing and std streams
1670-
JL_DLLEXPORT void jl_show(jl_value_t *stream, jl_value_t *v);
16711670
JL_DLLEXPORT void jl_flush_cstdio(void);
16721671
JL_DLLEXPORT jl_value_t *jl_stdout_obj(void);
16731672
JL_DLLEXPORT jl_value_t *jl_stderr_obj(void);

src/rtutils.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -439,24 +439,6 @@ JL_DLLEXPORT jl_value_t *jl_stderr_obj(void)
439439
return stderr_obj;
440440
}
441441

442-
static jl_function_t *jl_show_gf=NULL;
443-
444-
JL_DLLEXPORT void jl_show(jl_value_t *stream, jl_value_t *v)
445-
{
446-
if (jl_base_module) {
447-
if (jl_show_gf == NULL) {
448-
jl_show_gf = (jl_function_t*)jl_get_global(jl_base_module, jl_symbol("show"));
449-
}
450-
if (jl_show_gf==NULL || stream==NULL) {
451-
jl_printf(JL_STDERR, " could not show value of type %s",
452-
jl_symbol_name(((jl_datatype_t*)jl_typeof(v))->name->name));
453-
return;
454-
}
455-
jl_value_t *args[3] = {jl_show_gf,stream,v};
456-
jl_apply(args, 3);
457-
}
458-
}
459-
460442
// toys for debugging ---------------------------------------------------------
461443

462444
static size_t jl_show_svec(JL_STREAM *out, jl_svec_t *t, const char *head, const char *opn, const char *cls)
@@ -868,8 +850,7 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt
868850

869851
static size_t jl_static_show_x(JL_STREAM *out, jl_value_t *v, struct recur_list *depth)
870852
{
871-
// mimic jl_show, but never calling a julia method and
872-
// never allocate through julia gc
853+
// show values without calling a julia method or allocating through the GC
873854
if (v == NULL) {
874855
return jl_printf(out, "#<null>");
875856
}

src/toplevel.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,6 @@ static jl_method_instance_t *jl_new_thunk(jl_code_info_t *src, jl_module_t *modu
461461
jl_value_t *jl_toplevel_eval_flex(jl_value_t *e, int fast, int expanded)
462462
{
463463
jl_ptls_t ptls = jl_get_ptls_states();
464-
//jl_show(ex);
465-
//jl_printf(JL_STDOUT, "\n");
466464
if (!jl_is_expr(e)) {
467465
if (jl_is_linenode(e)) {
468466
jl_lineno = jl_linenode_line(e);

ui/repl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static int exec_program(char *program)
5252
jl_value_t *errs = jl_stderr_obj();
5353
jl_value_t *e = ptls->exception_in_transit;
5454
// Manually save and restore the backtrace so that we print the original
55-
// one instead of the one caused by `jl_show`.
55+
// one instead of the one caused by `show`.
5656
// We can't use safe_restore since that will cause any error
5757
// (including the ones that would have been caught) to abort.
5858
uintptr_t *volatile bt_data = NULL;
@@ -61,7 +61,7 @@ static int exec_program(char *program)
6161
if (errs) {
6262
bt_data = (uintptr_t*)malloc(bt_size * sizeof(void*));
6363
memcpy(bt_data, ptls->bt_data, bt_size * sizeof(void*));
64-
jl_show(errs, e);
64+
jl_call2(jl_get_function(jl_base_module, "show"), errs, e);
6565
jl_printf(JL_STDERR, "\n");
6666
free(bt_data);
6767
}

0 commit comments

Comments
 (0)