!395 Set max bytecode size for optimizer

Merge pull request !395 from ctw-ian/set_optlimit
This commit is contained in:
openharmony_ci 2023-05-15 07:41:56 +00:00 committed by Gitee
commit 210838851b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -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);