MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / isZeroSizeFrame

Function isZeroSizeFrame

src/stackFrame_aarch64.cpp:99–143  ·  view source on GitHub ↗

Check if this is a well-known leaf stub that does not change stack pointer

Source from the content-addressed store, hash-verified

97
98// Check if this is a well-known leaf stub that does not change stack pointer
99static inline bool isZeroSizeFrame(const char* name) {
100 // Dispatch by the first character to optimize lookup
101 switch (name[0]) {
102 case 'I':
103 return streq(name, "InlineCacheBuffer");
104 case 'S':
105 return startsWith(name, "SafeFetch");
106 case 'a':
107 return startsWith(name, "atomic");
108 case 'b':
109 return startsWith(name, "bigInteger")
110 || startsWith(name, "base64_encodeBlock")
111 || streq(name, "backward_copy_longs");
112 case 'c':
113 return startsWith(name, "copy_")
114 || startsWith(name, "compare_long_string_");
115 case 'e':
116 return streq(name, "encodeBlock");
117 case 'f':
118 return startsWith(name, "f2hf")
119 || streq(name, "forward_copy_longs")
120 || streq(name, "foward_copy_longs"); // there is a typo in JDK 8
121 case 'g':
122 return startsWith(name, "ghash_processBlocks") && strchr(name + 19, 'w') == NULL;
123 case 'h':
124 return startsWith(name, "hf2f");
125 case 'i':
126 return startsWith(name, "itable");
127 case 'l':
128 return startsWith(name, "large_byte_array_inflate")
129 || startsWith(name, "lookup_secondary_supers_");
130 case 'm':
131 return startsWith(name, "md5_implCompress");
132 case 's':
133 return startsWith(name, "sha1_implCompress");
134 case 'u':
135 return startsWith(name, "updateBytesAdler32");
136 case 'v':
137 return startsWith(name, "vtable");
138 case 'z':
139 return startsWith(name, "zero_");
140 default:
141 return false;
142 }
143}
144
145bool StackFrame::unwindStub(instruction_t* entry, const char* name, uintptr_t& pc, uintptr_t& sp, uintptr_t& fp) {
146 instruction_t* ip = (instruction_t*)pc;

Callers 1

unwindStubMethod · 0.85

Calls 2

streqFunction · 0.85
startsWithFunction · 0.85

Tested by

no test coverage detected