comparison src/ov-usr-fcn.cc @ 12920:5d18231eee00

Extend profiling support to operators. * profiler.h: Always use std::string with profiler name instead of octave_function references for identifying functions. * profiler.cc: Adapt for that. * ov-builtin.cc: Ditto. * ov-mex-fcn.cc: Ditto. * ov-usr-fcn.cc: Ditto. * pt-binop.cc (tree_binary_expression::rvalue1): Collect profiler data. * pt-unop.cc (tree_prefix_expression::rvalue1): Ditto. (tree_postfix_expression::rvalue1): Ditto.
author Daniel Kraft <d@domob.eu>
date Fri, 29 Jul 2011 17:51:39 +0200
parents ad9263d965dc
children 43d78e103984
comparison
equal deleted inserted replaced
12899:0ca8f06aba7a 12920:5d18231eee00
133 133
134 frame.protect_var (tree_evaluator::statement_context); 134 frame.protect_var (tree_evaluator::statement_context);
135 tree_evaluator::statement_context = tree_evaluator::script; 135 tree_evaluator::statement_context = tree_evaluator::script;
136 136
137 { 137 {
138 profile_data_accumulator::enter pe (profiler, *this); 138 profile_data_accumulator::enter pe (profiler,
139 profiler_name ());
139 cmd_list->accept (*current_evaluator); 140 cmd_list->accept (*current_evaluator);
140 } 141 }
141 142
142 if (tree_return_command::returning) 143 if (tree_return_command::returning)
143 tree_return_command::returning = 0; 144 tree_return_command::returning = 0;
453 454
454 bool special_expr = (is_inline_function () 455 bool special_expr = (is_inline_function ()
455 || cmd_list->is_anon_function_body ()); 456 || cmd_list->is_anon_function_body ());
456 457
457 { 458 {
458 profile_data_accumulator::enter pe (profiler, *this); 459 profile_data_accumulator::enter pe (profiler, profiler_name ());
459 460
460 if (special_expr) 461 if (special_expr)
461 { 462 {
462 assert (cmd_list->length () == 1); 463 assert (cmd_list->length () == 1);
463 464