diff --git a/bytecode_optimizer/common.h b/bytecode_optimizer/common.h index c2d9d4f32abb1d902b765d0eaa155c348372aee9..ff12a24c38b69dca7ed4ad4b05277750a88e9ec9 100644 --- a/bytecode_optimizer/common.h +++ b/bytecode_optimizer/common.h @@ -25,6 +25,7 @@ static constexpr compiler::Register MAX_NUM_SHORT_CALL_ARGS = 2; static constexpr compiler::Register MAX_NUM_NON_RANGE_ARGS = 4; static constexpr compiler::Register MAX_NUM_INPUTS = MAX_NUM_NON_RANGE_ARGS; static constexpr panda::compiler::Register NUM_COMPACTLY_ENCODED_REGS = 16; +static constexpr uint32_t MAX_BYTECODE_SIZE = 100000U; // Get the position where accumulator read happens. uint8_t AccReadIndex(const compiler::Inst *inst); diff --git a/bytecode_optimizer/optimize_bytecode.cpp b/bytecode_optimizer/optimize_bytecode.cpp index 29c8b8df8ff47b626a0c8e8d927db4ab45850f7d..878474b6869cc7f10b9d623d0569ccf6a07c55a9 100644 --- a/bytecode_optimizer/optimize_bytecode.cpp +++ b/bytecode_optimizer/optimize_bytecode.cpp @@ -277,7 +277,7 @@ static void SetCompilerOptions(bool is_dynamic) compiler::options.SetCompilerUseSafepoint(false); compiler::options.SetCompilerSupportInitObjectInst(true); if (!compiler::options.WasSetCompilerMaxBytecodeSize()) { - compiler::options.SetCompilerMaxBytecodeSize(~0U); + compiler::options.SetCompilerMaxBytecodeSize(MAX_BYTECODE_SIZE); } if (is_dynamic) { panda::bytecodeopt::options.SetSkipMethodsWithEh(true);