Browse Source

make pc2line recording conditional to compilation option DUK_OPT_NO_PC2LINE (DUK_USE_PC2LINE)

pull/1/head
Sami Vaarala 11 years ago
parent
commit
ed4af7f169
  1. 9
      src/duk_features.h
  2. 6
      src/duk_js_compiler.c

9
src/duk_features.h

@ -1227,6 +1227,15 @@ extern double duk_computed_nan;
#undef DUK_USE_SECTION_B
#endif
/*
* Function instance features.
*/
#define DUK_USE_PC2LINE
#if defined(DUK_OPT_NO_PC2LINE)
#undef DUK_USE_PC2LINE
#endif
/*
* Deep vs. shallow stack.
*

6
src/duk_js_compiler.c

@ -837,7 +837,8 @@ static void convert_to_function_template(duk_compiler_ctx *comp_ctx) {
}
/* _pc2line */
if (1) { /* FIXME: condition */
#ifdef DUK_USE_PC2LINE
if (1) {
/*
* Size-optimized pc->line mapping.
*/
@ -846,10 +847,11 @@ static void convert_to_function_template(duk_compiler_ctx *comp_ctx) {
duk_hobject_pc2line_pack(thr, q_instr, (duk_uint_fast32_t) code_count); /* -> pushes fixed buffer */
duk_def_prop_stridx(ctx, -2, DUK_STRIDX_INT_PC2LINE, DUK_PROPDESC_FLAGS_NONE);
/* FIXME: if assertions enabled, walk through all valid PCs
/* XXX: if assertions enabled, walk through all valid PCs
* and check line mapping.
*/
}
#endif /* DUK_USE_PC2LINE */
/* fileName */
if (comp_ctx->h_filename) {

Loading…
Cancel
Save