Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: src/ast/ast.cc

Issue 2654113002: [ast] Annotate CallRuntime ast node (Closed)
Patch Set: move to ast.cc Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/ast.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.cc
diff --git a/src/ast/ast.cc b/src/ast/ast.cc
index 80726ea364030aa01d6ab307136fb3e2cc75e5a0..0c0e535329b3b7d306b86e7a9e70cb63cf39b10c 100644
--- a/src/ast/ast.cc
+++ b/src/ast/ast.cc
@@ -29,6 +29,21 @@ namespace internal {
#ifdef DEBUG
+static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) {
+ 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";
+}
+
void AstNode::Print() { Print(Isolate::Current()); }
void AstNode::Print(Isolate* isolate) {
@@ -1064,5 +1079,13 @@ bool Literal::Match(void* literal1, void* literal2) {
(x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
}
+const char* CallRuntime::debug_name() {
+#ifdef DEBUG
+ return NameForNativeContextIntrinsicIndex(context_index_);
caitp 2017/01/29 05:32:33 Hey, sorry I didn't catch this sooner. This makes
+#else
+ return is_jsruntime() ? "(context function)" : function_->name;
+#endif // DEBUG
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/ast/ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698