summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Winblad <kjellwinblad@gmail.com>2021-03-18 08:49:13 +0100
committerKjell Winblad <kjellwinblad@gmail.com>2021-04-06 11:44:34 +0200
commit014589a76b634feb6d281d96ad41a1863ba1c0f4 (patch)
tree817d719aeb7b26e8280e7cc84bb671d3b3d173f5
parent5f41ef5d3b8bc49b102ed3ee503e913ead08c005 (diff)
downloaderlang-014589a76b634feb6d281d96ad41a1863ba1c0f4.tar.gz
jit: Move struct to where it is used and remove constructor
This change makes it clear where the struct is used and where its members are set.
-rw-r--r--erts/emulator/beam/jit/x86/beam_asm_perf.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/erts/emulator/beam/jit/x86/beam_asm_perf.cpp b/erts/emulator/beam/jit/x86/beam_asm_perf.cpp
index d0beec7eb3..5f7c274195 100644
--- a/erts/emulator/beam/jit/x86/beam_asm_perf.cpp
+++ b/erts/emulator/beam/jit/x86/beam_asm_perf.cpp
@@ -71,24 +71,6 @@ class JitPerfDump {
Uint64 timestamp;
};
- struct JitCodeLoadRecord {
- RecordHeader header;
- Uint32 pid;
- Uint32 tid;
- Uint64 vma;
- Uint64 code_addr;
- Uint64 code_size;
- Uint64 code_index;
- /* Null terminated M:F/A */
- /* Native code */
-
- JitCodeLoadRecord() {
- header.id = JIT_CODE_LOAD;
- pid = getpid();
- tid = erts_thr_self();
- }
- };
-
public:
bool init() {
char name[MAXPATHLEN];
@@ -137,7 +119,21 @@ public:
void update_perf_info(std::string modulename,
std::vector<BeamAssembler::AsmRange> &ranges) {
+ struct JitCodeLoadRecord {
+ RecordHeader header;
+ Uint32 pid;
+ Uint32 tid;
+ Uint64 vma;
+ Uint64 code_addr;
+ Uint64 code_size;
+ Uint64 code_index;
+ /* Null terminated M:F/A */
+ /* Native code */
+ };
JitCodeLoadRecord record;
+ record.header.id = JIT_CODE_LOAD;
+ record.pid = getpid();
+ record.tid = erts_thr_self();
for (BeamAssembler::AsmRange &r : ranges) {
size_t nameLen = r.name.size();
ptrdiff_t codeSize = (char *)r.stop - (char *)r.start;