[ast-printer] Print useful runtime function names for non-jsruntime calls

R=gsathya@chromium.org

Review-Url: https://codereview.chromium.org/2693063005
Cr-Commit-Position: refs/heads/master@{#43226}
This commit is contained in:
adamk 2017-02-15 17:51:57 -08:00 committed by Commit bot
parent c96a47deef
commit 6e31fcfec6

View File

@ -37,6 +37,7 @@ static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) {
return #name;
NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELDS_IDX)
#undef NATIVE_CONTEXT_FIELDS_IDX
default:
break;
@ -1103,7 +1104,8 @@ bool Literal::Match(void* literal1, void* literal2) {
const char* CallRuntime::debug_name() {
#ifdef DEBUG
return NameForNativeContextIntrinsicIndex(context_index_);
return is_jsruntime() ? NameForNativeContextIntrinsicIndex(context_index_)
: function_->name;
#else
return is_jsruntime() ? "(context function)" : function_->name;
#endif // DEBUG