Chromium Code Reviews| Index: src/ast/ast.h |
| diff --git a/src/ast/ast.h b/src/ast/ast.h |
| index d5fffda23912a01696b4cbf9615375764686e370..f79c13ea6507094258912cc66d4497fbbf44da89 100644 |
| --- a/src/ast/ast.h |
| +++ b/src/ast/ast.h |
| @@ -19,7 +19,6 @@ |
| #include "src/parsing/token.h" |
| #include "src/runtime/runtime.h" |
| #include "src/small-pointer-list.h" |
| -#include "src/utils.h" |
| namespace v8 { |
| namespace internal { |
| @@ -112,6 +111,23 @@ namespace internal { |
| STATEMENT_NODE_LIST(V) \ |
| EXPRESSION_NODE_LIST(V) |
| +#ifdef DEBUG |
| +static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { |
|
adamk
2017/01/25 20:26:43
Rather than copying this, what about exposing it i
gsathya
2017/01/25 21:05:19
Why is moving to contexts.h better?
adamk
2017/01/25 21:11:17
I'd rather not have two copies of this function. M
gsathya
2017/01/25 21:17:17
It's not exactly the same. As mentioned in my prev
adamk
2017/01/25 23:13:58
Sorry, missed the details of the macros. I'm ok wi
gsathya
2017/01/25 23:27:25
Done.
|
| + switch (idx) { |
| +#define NATIVE_CONTEXT_FIELDS_IDX(NAME, Type, name) \ |
| + case Context::NAME: \ |
| + return #name; |
| + |
| + NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELDS_IDX) |
| + |
| + default: |
| + break; |
| + } |
| + |
| + return "UnknownIntrinsicIndex"; |
| +} |
| +#endif // DEBUG |
| + |
| // Forward declarations |
| class AstNodeFactory; |
| class Declaration; |
| @@ -2057,7 +2073,11 @@ class CallRuntime final : public Expression { |
| BailoutId CallId() { return BailoutId(local_id(0)); } |
| const char* debug_name() { |
| +#ifdef DEBUG |
| + return NameForNativeContextIntrinsicIndex(context_index_); |
| +#else |
| return is_jsruntime() ? "(context function)" : function_->name; |
| +#endif // DEBUG |
| } |
| private: |