Skip to content

Commit 15111da

Browse files
update: remove frameIndex, frame` and comments
1 parent 44c92e9 commit 15111da

File tree

1 file changed

+0
-118
lines changed

1 file changed

+0
-118
lines changed

cobj/codegen.c

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,35 +2975,7 @@ static void joutput_perform_call(struct cb_label *lb, struct cb_label *le) {
29752975
find_label_id(lb), find_label_id(le));
29762976
}
29772977

2978-
// if (cb_flag_stack_check) {
2979-
// joutput_line ("if (unlikely(frame_ptr == frame_overflow))");
2980-
// joutput_line (" cob_fatal_error (COB_FERROR_STACK);");
2981-
// }
2982-
#ifndef __GNUC__
2983-
// l = cobc_malloc (sizeof (struct label_list));
2984-
// l->next = label_cache;
2985-
// l->id = cb_id;
2986-
// if (label_cache == NULL) {
2987-
// l->call_num = 0;
2988-
// } else {
2989-
// l->call_num = label_cache->call_num + 1;
2990-
// }
2991-
// label_cache = l;
2992-
// joutput_line ("frame_ptr->return_address = %d;", l->call_num);
2993-
// joutput_line ("goto %s%d;", CB_PREFIX_LABEL, lb->id);
2994-
// joutput_line ("%s%d:", CB_PREFIX_LABEL, cb_id);
2995-
#elif COB_USE_SETJMP
2996-
// joutput_line ("if (setjmp (frame_ptr->return_address) == 0)");
2997-
// joutput_line (" goto %s%d;", CB_PREFIX_LABEL, lb->id);
2998-
#else
2999-
// joutput_line ("frame_ptr->return_address = &&%s%d;",
3000-
// CB_PREFIX_LABEL, cb_id);
3001-
// joutput_line ("goto %s%d;", CB_PREFIX_LABEL, lb->id);
3002-
// joutput_line ("%s%d:", CB_PREFIX_LABEL, cb_id);
3003-
#endif
30042978
cb_id++;
3005-
// joutput_line ("frame_ptr--;");
3006-
// joutput_line ("throw new CobolRuntimeException(0, \"\");");
30072979
}
30082980

30092981
static void joutput_perform_once(struct cb_perform *p) {
@@ -3141,64 +3113,8 @@ static void joutput_sort_proc(struct cb_sort_proc *p) {
31413113
joutput_line("CobolControl.performThrough(contList, %d, %d).run();",
31423114
find_label_id(lb), find_label_id(le));
31433115
}
3144-
// joutput_line ("this.frameIndex++;");
31453116

3146-
// if (cb_flag_stack_check) {
3147-
// joutput_line ("if (unlikely(frame_ptr == frame_overflow))");
3148-
// joutput_line (" cob_fatal_error (COB_FERROR_STACK);");
3149-
// }
3150-
// joutput_line ("this.frameStack[this.frameIndex].setPerformThrough(%d);",
3151-
// le->id); joutput_line ("frame_ptr++;"); joutput_line ("memset (frame_ptr,
3152-
// 0, sizeof (struct cob_frame));"); if (cb_flag_stack_check) {
3153-
// joutput_line
3154-
//("if (unlikely(frame_ptr == frame_overflow))"); joutput_line ("
3155-
// cob_fatal_error (COB_FERROR_STACK);");
3156-
// }
3157-
// joutput_line ("frame_ptr->perform_through = %d;", le->id);
3158-
// joutput_prefix ();
3159-
// joutput ("frame_ptr->current_sort_merge_file = ");
3160-
// joutput_param (p->sort_file, 0);
3161-
// joutput (";\n");
3162-
#ifndef __GNUC__
3163-
// l = cobc_malloc (sizeof (struct label_list));
3164-
// l->next = label_cache;
3165-
// l->id = cb_id;
3166-
// if (label_cache == NULL) {
3167-
// l->call_num = 0;
3168-
// } else {
3169-
// l->call_num = label_cache->call_num + 1;
3170-
// }
3171-
// label_cache = l;
3172-
// joutput_line ("frame_ptr->return_address = %d;", l->call_num);
3173-
// joutput_prefix ();
3174-
// joutput ("if (unlikely(*(int*)(");
3175-
// joutput_param (p->sort_return, 0);
3176-
// joutput (") != 0))\n");
3177-
// joutput_prefix ();
3178-
// joutput_line ("goto %s%d;", CB_PREFIX_LABEL, cb_id);
3179-
// joutput_line ("goto %s%d;", CB_PREFIX_LABEL, lb->id);
3180-
// joutput_line ("%s%d:", CB_PREFIX_LABEL, cb_id);
3181-
#elif COB_USE_SETJMP
3182-
// joutput_line ("if (setjmp (frame_ptr->return_address) == 0)");
3183-
// joutput_line (" goto %s%d;", CB_PREFIX_LABEL, lb->id);
3184-
#else
3185-
// joutput_line ("frame_ptr->return_address = &&%s%d;",
3186-
// CB_PREFIX_LABEL, cb_id);
3187-
// joutput_prefix ();
3188-
// joutput ("if (unlikely(*(int*)(");
3189-
// joutput_param (p->sort_return, 0);
3190-
// joutput (") != 0))\n");
3191-
// joutput_prefix ();
3192-
// joutput_line ("goto %s%d;", CB_PREFIX_LABEL, cb_id);
3193-
// joutput_line ("goto %s%d;", CB_PREFIX_LABEL, lb->id);
3194-
// joutput_line ("%s%d:", CB_PREFIX_LABEL, cb_id);
3195-
#endif
3196-
// joutput_line ("/* perform call */");
3197-
// joutput_line("entryFunc(%d, %d);", lb->id, le->id);
3198-
// cb_id++;
3199-
// joutput_line ("frame_ptr--;");
32003117
cb_id++;
3201-
// joutput_line ("this.frameIndex--;");
32023118
}
32033119

32043120
static void joutput_file_return(struct cb_return *p) {
@@ -4346,38 +4262,6 @@ static void joutput_internal_function(struct cb_program *prog,
43464262
joutput_line(" this.initialized = false;");
43474263
joutput_line(" return 0;");
43484264
joutput_line("}");
4349-
// output_newline ();
4350-
// if (cb_sticky_linkage && parmnum) {
4351-
// output_line ("if (cob_call_params < %d) {", parmnum);
4352-
// output_line (" switch (cob_call_params) {");
4353-
// for (i = 0, l = parameter_list; l; l = CB_CHAIN (l), i++) {
4354-
// output_line (" case %d:", i);
4355-
// output_line (" if (cob_parm_%d != NULL)", i);
4356-
// output_line (" %s%d = cob_parm_%d;",
4357-
// CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id, i);
4358-
// }
4359-
// output_line (" }");
4360-
// output_line ("}");
4361-
// for (i = 0, l = parameter_list; l; l = CB_CHAIN (l), i++) {
4362-
// output_line ("if (%s%d != NULL)",
4363-
// CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id);
4364-
// output_line (" cob_parm_%d = %s%d;", i,
4365-
// CB_PREFIX_BASE, cb_field (CB_VALUE (l))->id);
4366-
// }
4367-
// output_newline ();
4368-
// }
4369-
4370-
// joutput_line("/* Initialize frame stack */");
4371-
// joutput_line("this.frameIndex = 0;");
4372-
// joutput_line("this.frameStack = new CobolFrame[255];");
4373-
// joutput_line("for(int i=0; i<frameStack.length; ++i){");
4374-
// joutput_line(" frameStack[i] = new CobolFrame();");
4375-
// joutput_line("}");
4376-
// joutput_line("this.frame = frameStack[0];");
4377-
// joutput_line("frameStack[0].setPerformThrough(0);");
4378-
// if (cb_flag_stack_check) {
4379-
// output_line ("frame_overflow = &frame_stack[COB_STACK_SIZE - 1];");
4380-
// }
43814265
joutput_newline();
43824266

43834267
joutput_line("/* Push module stack */");
@@ -5740,10 +5624,8 @@ void codegen(struct cb_program *prog, const int nested,
57405624

57415625
joutput_line("private boolean initialized = false;");
57425626
joutput_line("private CobolModule cobolCurrentModule;");
5743-
joutput_line("private int frameIndex;");
57445627
joutput_line("private CobolModule module;");
57455628
joutput_line("private CobolFrame frame;");
5746-
// joutput_line("private CobolFrame[] frameStack;");
57475629
joutput_line("private static boolean cobolInitialized = false;");
57485630
joutput_line("private CobolCallParams cobolSaveCallParams = null;");
57495631
joutput_line("private CobolCallParams cobolCallParams = null;");

0 commit comments

Comments
 (0)