From 52716d73c2f335fd3ecc81727ca3e77ae34b9e4a Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Tue, 10 Sep 2024 13:17:57 +0900 Subject: [PATCH] Fix minor defects Signed-off-by: HyukWoo Park --- src/jit/Backend.cpp | 3 +++ src/jit/Compiler.h | 2 ++ src/jit/FloatMathInl.h | 2 +- src/runtime/Memory.h | 7 +++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/jit/Backend.cpp b/src/jit/Backend.cpp index 6c3207abc..895d89ea9 100644 --- a/src/jit/Backend.cpp +++ b/src/jit/Backend.cpp @@ -215,6 +215,7 @@ class SlowCase { CompileContext::CompileContext(Module* module, JITCompiler* compiler) : compiler(compiler) + , branchTableOffset(0) #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) , shuffleOffset(0) #endif /* SLJIT_CONFIG_X86 */ @@ -1013,6 +1014,8 @@ JITCompiler::JITCompiler(Module* module, uint32_t JITFlags) , m_tryBlockOffset(0) , m_JITFlags(JITFlags) , m_options(0) + , m_savedIntegerRegCount(0) + , m_savedFloatRegCount(0) { if (module->m_jitModule != nullptr) { ASSERT(module->m_jitModule->m_instanceConstData != nullptr); diff --git a/src/jit/Compiler.h b/src/jit/Compiler.h index 3bf40d012..ea86bf503 100644 --- a/src/jit/Compiler.h +++ b/src/jit/Compiler.h @@ -342,6 +342,7 @@ class ExtendedInstruction : public Instruction { : Instruction(byteCode, group, opcode, paramCount, operands) { ASSERT(group == Instruction::DirectBranch || group == Instruction::Call || group == Instruction::StackInit); + m_value.targetLabel = nullptr; } private: @@ -489,6 +490,7 @@ struct TryBlock { TryBlock(Label* start, size_t size) : start(start) , parent(0) + , findHandlerLabel(nullptr) , returnToLabel(nullptr) { catchBlocks.reserve(size); diff --git a/src/jit/FloatMathInl.h b/src/jit/FloatMathInl.h index 83f09783b..766214d2d 100644 --- a/src/jit/FloatMathInl.h +++ b/src/jit/FloatMathInl.h @@ -308,7 +308,7 @@ static void emitFloatUnary(sljit_compiler* compiler, Instruction* instr) f32Func = floatNearest; break; case ByteCode::F32SqrtOpcode: - f32Func = sqrt; + f32Func = sqrtf; break; case ByteCode::F32NegOpcode: opcode = SLJIT_NEG_F32; diff --git a/src/runtime/Memory.h b/src/runtime/Memory.h index 4c2558012..726299ec3 100644 --- a/src/runtime/Memory.h +++ b/src/runtime/Memory.h @@ -36,6 +36,13 @@ class Memory : public Extern { // Caching memory target for fast access. struct TargetBuffer { + TargetBuffer() + : prev(nullptr) + , sizeInByte(0) + , buffer(nullptr) + { + } + TargetBuffer* prev; uint64_t sizeInByte; uint8_t* buffer;