[vm, aot] Further debugging aids for null function encountered when writing DWARF inlining data.

Bug: https://github.com/dart-lang/sdk/issues/31952
Change-Id: Iaf677c2dd15567772d1bb9f2482e749ef1139fe2
Reviewed-on: https://dart-review.googlesource.com/42060
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2018-02-16 20:48:59 +00:00 committed by commit-bot@chromium.org
parent 0d5cf900b0
commit 04100796c1
3 changed files with 9 additions and 6 deletions

View file

@ -373,6 +373,7 @@ intptr_t CodeSourceMapBuilder::GetFunctionId(intptr_t inline_id) {
return i;
}
}
RELEASE_ASSERT(!function.IsNull());
inlined_functions_.Add(function, Heap::kOld);
return inlined_functions_.Length() - 1;
}

View file

@ -2235,6 +2235,7 @@ intptr_t FlowGraphInliner::NextInlineId(const Function& function,
// TODO(johnmccutchan): Do not allow IsNoSource once all nodes have proper
// source positions.
ASSERT(tp.IsReal() || tp.IsSynthetic() || tp.IsNoSource());
RELEASE_ASSERT(!function.IsNull());
inline_id_to_function_->Add(&function);
inline_id_to_token_pos_->Add(tp);
caller_inline_id_->Add(parent_id);

View file

@ -29,8 +29,8 @@ class InliningNode : public ZoneAllocated {
children_head(NULL),
children_tail(NULL),
children_next(NULL) {
ASSERT(!function.IsNull());
ASSERT(function.IsNotTemporaryScopedHandle());
RELEASE_ASSERT(!function.IsNull());
RELEASE_ASSERT(function.IsNotTemporaryScopedHandle());
}
void AppendChild(InliningNode* child) {
@ -63,7 +63,7 @@ Dwarf::Dwarf(Zone* zone, WriteStream* stream)
temp_(0) {}
intptr_t Dwarf::AddCode(const Code& code) {
ASSERT(!code.IsNull());
RELEASE_ASSERT(!code.IsNull());
CodeIndexPair* pair = code_to_index_.Lookup(&code);
if (pair != NULL) {
return pair->index_;
@ -104,7 +104,7 @@ intptr_t Dwarf::AddFunction(const Function& function) {
}
intptr_t Dwarf::AddScript(const Script& script) {
ASSERT(!script.IsNull());
RELEASE_ASSERT(!script.IsNull());
ScriptIndexPair* pair = script_to_index_.Lookup(&script);
if (pair != NULL) {
return pair->index_;
@ -118,7 +118,7 @@ intptr_t Dwarf::AddScript(const Script& script) {
}
intptr_t Dwarf::LookupFunction(const Function& function) {
ASSERT(!function.IsNull());
RELEASE_ASSERT(!function.IsNull());
FunctionIndexPair* pair = function_to_index_.Lookup(&function);
if (pair == NULL) {
FATAL1("Function detected too late during DWARF generation: %s",
@ -128,7 +128,7 @@ intptr_t Dwarf::LookupFunction(const Function& function) {
}
intptr_t Dwarf::LookupScript(const Script& script) {
ASSERT(!script.IsNull());
RELEASE_ASSERT(!script.IsNull());
ScriptIndexPair* pair = script_to_index_.Lookup(&script);
if (pair == NULL) {
FATAL1("Script detected too late during DWARF generation: %s",
@ -308,6 +308,7 @@ void Dwarf::WriteConcreteFunctions() {
Script& script = Script::Handle(zone_);
for (intptr_t i = 0; i < codes_.length(); i++) {
const Code& code = *(codes_[i]);
RELEASE_ASSERT(!code.IsNull());
if (!code.IsFunctionCode()) {
continue;
}