| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 35284)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -11808,12 +11808,12 @@
|
| }
|
|
|
|
|
| -RawICData* ICData::New(const Function& function,
|
| +RawICData* ICData::New(const Function& caller_function,
|
| const String& target_name,
|
| const Array& arguments_descriptor,
|
| intptr_t deopt_id,
|
| intptr_t num_args_tested) {
|
| - ASSERT(!function.IsNull());
|
| + ASSERT(!caller_function.IsNull());
|
| ASSERT(!target_name.IsNull());
|
| ASSERT(!arguments_descriptor.IsNull());
|
| ASSERT(Object::icdata_class() != Class::null());
|
| @@ -11827,7 +11827,7 @@
|
| NoGCScope no_gc;
|
| result ^= raw;
|
| }
|
| - result.set_function(function);
|
| + result.set_function(caller_function);
|
| result.set_target_name(target_name);
|
| result.set_arguments_descriptor(arguments_descriptor);
|
| result.set_deopt_id(deopt_id);
|
| @@ -18098,7 +18098,8 @@
|
| }
|
|
|
|
|
| -const char* Stacktrace::ToCStringInternal(intptr_t* frame_index) const {
|
| +const char* Stacktrace::ToCStringInternal(intptr_t* frame_index,
|
| + intptr_t max_frames) const {
|
| Isolate* isolate = Isolate::Current();
|
| Function& function = Function::Handle();
|
| Code& code = Code::Handle();
|
| @@ -18106,7 +18107,7 @@
|
| // for each frame.
|
| intptr_t total_len = 0;
|
| GrowableArray<char*> frame_strings;
|
| - for (intptr_t i = 0; i < Length(); i++) {
|
| + for (intptr_t i = 0; (i < Length()) && (*frame_index < max_frames); i++) {
|
| function = FunctionAtFrame(i);
|
| if (function.IsNull()) {
|
| // Check if null function object indicates a stack trace overflow.
|
| @@ -18124,7 +18125,8 @@
|
| uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i));
|
| if (code.is_optimized() && expand_inlined()) {
|
| // Traverse inlined frames.
|
| - for (InlinedFunctionsIterator it(code, pc); !it.Done(); it.Advance()) {
|
| + for (InlinedFunctionsIterator it(code, pc);
|
| + !it.Done() && (*frame_index < max_frames); it.Advance()) {
|
| function = it.function();
|
| if (function.is_visible() || FLAG_verbose_stacktrace) {
|
| code = it.code();
|
| @@ -18135,8 +18137,8 @@
|
| ASSERT(pc < (code.EntryPoint() + code.Size()));
|
| total_len += PrintOneStacktrace(
|
| isolate, &frame_strings, pc, function, code, *frame_index);
|
| + (*frame_index)++; // To account for inlined frames.
|
| }
|
| - (*frame_index)++; // To account for inlined frames.
|
| }
|
| } else {
|
| total_len += PrintOneStacktrace(
|
|
|