1 /* 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ECMASCRIPT_JS_RUNTIME_OPTIONS_H_ 17 #define ECMASCRIPT_JS_RUNTIME_OPTIONS_H_ 18 19 #include <optional> 20 #include <string> 21 #include <string_view> 22 #include <vector> 23 24 #include "ecmascript/compiler/assembler/assembler.h" 25 #include "ecmascript/compiler/bc_call_signature.h" 26 #include "ecmascript/mem/mem_common.h" 27 #include "libpandabase/os/file.h" 28 #include "ecmascript/base/number_helper.h" 29 30 namespace { 31 constexpr size_t DEFAULT_OPT_LEVEL = 3; // 3: default opt level 32 constexpr size_t DEFAULT_REL_MODE = 2; 33 } // namespace 34 35 // namespace panda { 36 namespace panda::ecmascript { 37 using arg_list_t = std::vector<std::string>; 38 enum ArkProperties { 39 DEFAULT = -1, // default value 000'0000'0001'0000'0101'1100 -> 0x105c 40 OPTIONAL_LOG = 1, 41 GC_STATS_PRINT = 1 << 1, 42 PARALLEL_GC = 1 << 2, // default enable 43 CONCURRENT_MARK = 1 << 3, // default enable 44 CONCURRENT_SWEEP = 1 << 4, // default enable 45 THREAD_CHECK = 1 << 5, 46 ENABLE_ARKTOOLS = 1 << 6, // default enable 47 ENABLE_SNAPSHOT_SERIALIZE = 1 << 7, 48 ENABLE_SNAPSHOT_DESERIALIZE = 1 << 8, 49 EXCEPTION_BACKTRACE = 1 << 9, 50 GLOBAL_OBJECT_LEAK_CHECK = 1 << 10, 51 GLOBAL_PRIMITIVE_LEAK_CHECK = 1 << 11, 52 ENABLE_IDLE_GC = 1 << 12, // default enable 53 CPU_PROFILER_COLD_START_MAIN_THREAD = 1 << 13, 54 ENABLE_CPU_PROFILER_VM_TAG = 1 << 14, 55 ENABLE_GC_TRACER = 1 << 15, 56 CPU_PROFILER_COLD_START_WORKER_THREAD = 1 << 16, 57 CPU_PROFILER_ANY_TIME_MAIN_THREAD = 1 << 17, 58 CPU_PROFILER_ANY_TIME_WORKER_THREAD = 1 << 18, 59 ENABLE_HEAP_VERIFY = 1 << 19, 60 ENABLE_MICROJOB_TRACE = 1 << 20, 61 // Use DISABLE to adapt to the exsiting ArkProperties in testing scripts. 62 DISABLE_SHARED_CONCURRENT_MARK = 1 << 22, 63 ENABLE_ESM_TRACE = 1 << 24, 64 ENABLE_MODULE_LOG = 1 << 25, 65 ENABLE_SERIALIZATION_TIMEOUT_CHECK = 1 << 26, 66 ENABLE_PAGETAG_THREAD_ID = 1 << 27, 67 }; 68 69 // asm interpreter control parsed option 70 struct AsmInterParsedOption { 71 int handleStart {-1}; 72 int handleEnd {-1}; 73 bool enableAsm {false}; 74 }; 75 76 extern const std::string PUBLIC_API COMMON_HELP_HEAD_MSG; 77 extern const std::string PUBLIC_API STUB_HELP_HEAD_MSG; 78 extern const std::string PUBLIC_API COMPILER_HELP_HEAD_MSG; 79 extern const std::string PUBLIC_API HELP_OPTION_MSG; 80 81 enum CommandValues { 82 OPTION_DEFAULT, 83 OPTION_HELP, 84 OPTION_ENABLE_ARK_TOOLS, 85 OPTION_STUB_FILE, 86 OPTION_ENABLE_FORCE_GC, 87 OPTION_FORCE_FULL_GC, 88 OPTION_ENABLE_FORCE_SHARED_GC_FREQUENCY, 89 OPTION_ARK_PROPERTIES, 90 OPTION_ARK_BUNDLENAME, 91 OPTION_GC_THREADNUM, 92 OPTION_GC_LONG_PAUSED_TIME, 93 OPTION_AOT_FILE, 94 OPTION_COMPILER_TARGET_TRIPLE, 95 OPTION_ASM_OPT_LEVEL, 96 OPTION_RELOCATION_MODE, 97 OPTION_MAX_UNMOVABLE_SPACE, 98 OPTION_ENABLE_ASM_INTERPRETER, 99 OPTION_ENABLE_BUILTINS_LAZY, 100 OPTION_ASM_OPCODE_DISABLE_RANGE, 101 OPTION_SERIALIZER_BUFFER_SIZE_LIMIT, 102 OPTION_HEAP_SIZE_LIMIT, 103 OPTION_ENABLE_IC, 104 OPTION_ICU_DATA_PATH, 105 OPTION_STARTUP_TIME, 106 OPTION_COMPILER_LOG_OPT, 107 OPTION_COMPILER_LOG_METHODS, 108 OPTION_COMPILER_TYPE_THRESHOLD, 109 OPTION_ENABLE_RUNTIME_STAT, 110 OPTION_COMPILER_LOG_SNAPSHOT, 111 OPTION_COMPILER_LOG_TIME, 112 OPTION_ENABLE_WORKER, 113 OPTION_COMPILER_TRACE_BC, 114 OPTION_COMPILER_TRACE_DEOPT, 115 OPTION_COMPILER_TRACE_INLINE, 116 OPTION_COMPILER_MAX_INLINE_BYTECODES, 117 OPTION_COMPILER_DEOPT_THRESHOLD, 118 OPTION_COMPILER_STRESS_DEOPT, 119 OPTION_COMPILER_OPT_CODE_PROFILER, 120 OPTION_COMPILER_OPT_BC_RANGE, 121 OPTION_LOG_LEVEL, 122 OPTION_LOG_DEBUG, 123 OPTION_LOG_INFO, 124 OPTION_LOG_WARNING, 125 OPTION_LOG_ERROR, 126 OPTION_LOG_FATAL, 127 OPTION_LOG_COMPONENTS, 128 OPTION_COMPILER_OPT_MAX_METHOD, 129 OPTION_COMPILER_MODULE_METHODS, 130 OPTION_ENTRY_POINT, 131 OPTION_MERGE_ABC, 132 OPTION_ENABLE_CONTEXT, 133 OPTION_COMPILER_OPT_TYPE_LOWERING, 134 OPTION_COMPILER_OPT_EARLY_ELIMINATION, 135 OPTION_COMPILER_OPT_LATER_ELIMINATION, 136 OPTION_COMPILER_OPT_STRING, 137 OPTION_COMPILER_OPT_VALUE_NUMBERING, 138 OPTION_COMPILER_OPT_INLINING, 139 OPTION_COMPILER_OPT_PGOTYPE, 140 OPTION_COMPILER_OPT_TRACK_FIELD, 141 OPTION_COMPILER_PGO_PROFILER_PATH, 142 OPTION_COMPILER_PGO_HOTNESS_THRESHOLD, 143 OPTION_COMPILER_PGO_SAVE_MIN_INTERVAL, 144 OPTION_ENABLE_PGO_PROFILER, 145 OPTION_INVALID, 146 OPTION_SPLIT_ONE, 147 OPTION_PRINT_EXECUTE_TIME, 148 OPTION_ENABLE_EDEN_GC, 149 OPTION_COMPILER_DEVICE_STATE, 150 OPTION_COMPILER_VERIFY_VTABLE, 151 OPTION_COMPILER_SELECT_METHODS, 152 OPTION_COMPILER_SKIP_METHODS, 153 OPTION_TARGET_COMPILER_MODE, 154 OPTION_HAP_PATH, 155 OPTION_HAP_ABC_OFFSET, 156 OPTION_HAP_ABC_SIZE, 157 OPTION_COMPILER_NOCHECK, 158 OPTION_COMPILER_PIPELINE_HOST_AOT, 159 OPTION_FAST_AOT_COMPILE_MODE, 160 OPTION_COMPILER_OPT_LOOP_PEELING, 161 OPTION_COMPILER_OPT_ON_HEAP_CHECK, 162 OPTION_COMPILER_PKG_INFO, 163 OPTION_COMPILER_EXTERNAL_PKG_INFO, 164 OPTION_COMPILER_ENABLE_EXTERNAL_PKG, 165 OPTION_COMPILER_FRAMEWORK_ABC_PATH, 166 OPTION_COMPILER_OPT_ARRAY_BOUNDS_CHECK_ELIMINATION, 167 OPTION_COMPILER_OPT_LOOP_INVARIANT_CODE_MOTION, 168 OPTION_COMPILER_OPT_CONSTANT_FOLDING, 169 OPTION_COMPILER_ENABLE_LEXENV_SPECIALIZATION, 170 OPTION_COMPILER_TRACE_INSTRUCTION_COMBINE, 171 OPTION_COMPILER_TRACE_VALUE_NUMBERING, 172 OPTION_COMPILER_OPT_INSTRUCTIONE_COMBINE, 173 OPTION_COMPILER_OPT_NEW_VALUE_NUMBERING, 174 OPTION_COMPILER_ENABLE_NATIVE_INLINE, 175 OPTION_COMPILER_ENABLE_LOWERING_BUILTIN, 176 OPTION_COMPILER_ENABLE_LITECG, 177 OPTION_COMPILER_ENABLE_JIT, 178 OPTION_COMPILER_ENABLE_OSR, 179 OPTION_COMPILER_JIT_HOTNESS_THRESHOLD, 180 OPTION_COMPILER_JIT_CALL_THRESHOLD, 181 OPTION_COMPILER_OSR_HOTNESS_THRESHOLD, 182 OPTION_COMPILER_FORCE_JIT_COMPILE_MAIN, 183 OPTION_COMPILER_TRACE_JIT, 184 OPTION_COMPILER_ENABLE_JIT_PGO, 185 OPTION_COMPILER_ENABLE_AOT_PGO, 186 OPTION_COMPILER_ENABLE_FRAMEWORK_AOT, 187 OPTION_COMPILER_ENABLE_PROPFILE_DUMP, 188 OPTION_ENABLE_ELEMENTSKIND, 189 OPTION_COMPILER_TYPED_OP_PROFILER, 190 OPTION_COMPILER_OPT_BRANCH_PROFILING, 191 OPTION_TEST_ASSERT, 192 OPTION_COMPILER_METHODS_RANGE, 193 OPTION_COMPILER_CODEGEN_OPT, 194 OPTION_COMPILER_OPT_BC_RANGE_HELP, 195 OPTION_COMPILER_MEMORY_ANALYSIS, 196 OPTION_COMPILER_CHECK_PGO_VERSION, 197 OPTION_COMPILER_OPT_ESCAPE_ANALYSIS, 198 OPTION_COMPILER_TRACE_ESCAPE_ANALYSIS, 199 OPTION_ENABLE_JITFORT, 200 OPTION_CODESIGN_DISABLE, 201 OPTION_ENABLE_ASYNC_COPYTOFORT, 202 OPTION_COMPILER_OPT_INDUCTION_VARIABLE, 203 OPTION_COMPILER_TRACE_INDUCTION_VARIABLE, 204 OPTION_ENABLE_AOT_CRASH_ESCAPE, 205 OPTION_COMPILER_ENABLE_BASELINEJIT, 206 OPTION_COMPILER_BASELINEJIT_HOTNESS_THRESHOLD, 207 OPTION_COMPILER_FORCE_BASELINEJIT_COMPILE_MAIN, 208 OPTION_COMPILER_ENABLE_JIT_FAST_COMPILE, 209 OPTION_LAST, 210 OPTION_SPLIT_TWO, 211 OPTION_COMPILER_BASELINE_PGO, 212 OPTION_ASYNC_LOAD_ABC, 213 OPTION_ASYNC_LOAD_ABC_TEST, 214 OPTION_PGO_TRACE, 215 OPTION_COMPILER_PGO_FORCE_DUMP, 216 OPTION_OPEN_ARK_TOOLS, 217 OPTION_COMPILER_ENABLE_CONCURRENT, 218 OPTION_COMPILER_OPT_FRAME_STATE_ELIMINATION, 219 OPTION_COMPILER_EMPTY_CATCH_FUNCTION, 220 }; 221 static_assert(OPTION_INVALID == 63); // Placeholder for invalid options 222 static_assert(OPTION_SPLIT_ONE == 64); 223 static_assert(OPTION_SPLIT_TWO == 128); // add new option at the bottom, DO NOT modify this value 224 225 class PUBLIC_API JSRuntimeOptions { 226 public: JSRuntimeOptions()227 JSRuntimeOptions() {} 228 ~JSRuntimeOptions() = default; 229 DEFAULT_COPY_SEMANTIC(JSRuntimeOptions); 230 DEFAULT_MOVE_SEMANTIC(JSRuntimeOptions); 231 232 bool ParseCommand(const int argc, const char** argv); 233 bool SetDefaultValue(char* argv); 234 EnableArkTools()235 bool EnableArkTools() const 236 { 237 return (enableArkTools_) || ((static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_ARKTOOLS) != 0); 238 } 239 SetEnableArkTools(bool value)240 void SetEnableArkTools(bool value) 241 { 242 enableArkTools_ = value; 243 } 244 WasSetEnableArkTools()245 bool WasSetEnableArkTools() const 246 { 247 return WasOptionSet(OPTION_ENABLE_ARK_TOOLS); 248 } 249 IsOpenArkTools()250 bool IsOpenArkTools() const 251 { 252 return openArkTools_; 253 } 254 SetOpenArkTools(bool value)255 void SetOpenArkTools(bool value) 256 { 257 openArkTools_ = value; 258 } 259 WasSetOpenArkTools()260 bool WasSetOpenArkTools() const 261 { 262 return WasOptionSet(OPTION_OPEN_ARK_TOOLS); 263 } 264 IsEnableRuntimeStat()265 bool IsEnableRuntimeStat() const 266 { 267 return enableRuntimeStat_; 268 } 269 SetEnableRuntimeStat(bool value)270 void SetEnableRuntimeStat(bool value) 271 { 272 enableRuntimeStat_ = value; 273 } 274 WasSetEnableRuntimeStat()275 bool WasSetEnableRuntimeStat() const 276 { 277 return WasOptionSet(OPTION_ENABLE_RUNTIME_STAT); 278 } 279 GetStubFile()280 std::string GetStubFile() const 281 { 282 return stubFile_; 283 } 284 SetStubFile(std::string value)285 void SetStubFile(std::string value) 286 { 287 stubFile_ = std::move(value); 288 } 289 SetCompilerPkgJsonInfo(std::string pkgJsonInfo)290 void SetCompilerPkgJsonInfo(std::string pkgJsonInfo) 291 { 292 compilerPkgInfo_ = std::move(pkgJsonInfo); 293 } 294 GetCompilerPkgJsonInfo()295 const std::string& GetCompilerPkgJsonInfo() const 296 { 297 return compilerPkgInfo_; 298 } 299 SetCompilerExternalPkgJsonInfo(std::string pkgJsonInfo)300 void SetCompilerExternalPkgJsonInfo(std::string pkgJsonInfo) 301 { 302 compilerExternalPkgInfo_ = std::move(pkgJsonInfo); 303 } 304 GetCompilerExternalPkgJsonInfo()305 const std::string& GetCompilerExternalPkgJsonInfo() const 306 { 307 return compilerExternalPkgInfo_; 308 } 309 SetCompilerEnableExternalPkg(bool compilerEnableExternalPkg)310 void SetCompilerEnableExternalPkg(bool compilerEnableExternalPkg) 311 { 312 compilerEnableExternalPkg_ = compilerEnableExternalPkg; 313 } 314 GetCompilerEnableExternalPkg()315 bool GetCompilerEnableExternalPkg() const 316 { 317 return compilerEnableExternalPkg_; 318 } 319 WasStubFileSet()320 bool WasStubFileSet() const 321 { 322 return WasOptionSet(OPTION_STUB_FILE); 323 } 324 SetEnableAOT(bool value)325 void SetEnableAOT(bool value) 326 { 327 enableAOT_ = value; 328 } 329 GetEnableAOT()330 bool GetEnableAOT() const 331 { 332 return enableAOT_; 333 } 334 GetAOTOutputFile()335 std::string GetAOTOutputFile() const 336 { 337 return aotOutputFile_; 338 } 339 SetAOTOutputFile(const std::string & value)340 void SetAOTOutputFile(const std::string& value) 341 { 342 aotOutputFile_ = panda::os::file::File::GetExtendedFilePath(value); 343 } 344 WasAOTOutputFileSet()345 bool WasAOTOutputFileSet() const 346 { 347 return WasOptionSet(OPTION_AOT_FILE); 348 } 349 GetTargetTriple()350 std::string GetTargetTriple() const 351 { 352 return targetTriple_; 353 } 354 SetTargetTriple(std::string value)355 void SetTargetTriple(std::string value) 356 { 357 targetTriple_ = std::move(value); 358 } 359 GetOptLevel()360 size_t GetOptLevel() const 361 { 362 return asmOptLevel_; 363 } 364 SetOptLevel(size_t value)365 void SetOptLevel(size_t value) 366 { 367 asmOptLevel_ = value; 368 } 369 GetRelocMode()370 size_t GetRelocMode() const 371 { 372 return relocationMode_; 373 } 374 SetRelocMode(size_t value)375 void SetRelocMode(size_t value) 376 { 377 relocationMode_ = value; 378 } 379 EnableForceGC()380 bool EnableForceGC() const 381 { 382 return enableForceGc_; 383 } 384 SetEnableForceGC(bool value)385 void SetEnableForceGC(bool value) 386 { 387 enableForceGc_ = value; 388 } 389 EnableEdenGC()390 bool EnableEdenGC() const 391 { 392 return enableEdenGC_; 393 } 394 SetEnableEdenGC(bool value)395 void SetEnableEdenGC(bool value) 396 { 397 enableEdenGC_ = value; 398 } 399 ForceFullGC()400 bool ForceFullGC() const 401 { 402 return forceFullGc_; 403 } 404 SetForceFullGC(bool value)405 void SetForceFullGC(bool value) 406 { 407 forceFullGc_ = value; 408 } 409 SetForceSharedGCFrequency(size_t frequency)410 void SetForceSharedGCFrequency(size_t frequency) 411 { 412 forceSharedGc_ = frequency; 413 } 414 GetForceSharedGCFrequency()415 uint32_t GetForceSharedGCFrequency() const 416 { 417 return forceSharedGc_; 418 } 419 SetGcThreadNum(size_t num)420 void SetGcThreadNum(size_t num) 421 { 422 gcThreadNum_ = num; 423 } 424 GetGcThreadNum()425 size_t GetGcThreadNum() const 426 { 427 return gcThreadNum_; 428 } 429 SetLongPauseTime(size_t time)430 void SetLongPauseTime(size_t time) 431 { 432 longPauseTime_ = time; 433 } 434 GetLongPauseTime()435 size_t GetLongPauseTime() const 436 { 437 return longPauseTime_; 438 } 439 SetArkProperties(int prop)440 void SetArkProperties(int prop) 441 { 442 if (prop != ArkProperties::DEFAULT) { 443 arkProperties_ = prop; 444 } 445 } 446 SetArkBundleName(std::string bundleName)447 void SetArkBundleName(std::string bundleName) 448 { 449 if (bundleName != "") { 450 arkBundleName_ = bundleName; 451 } 452 } 453 SetMemConfigProperty(std::string configProperty)454 void SetMemConfigProperty(std::string configProperty) 455 { 456 if (configProperty != "") { 457 std::string key; 458 std::string value; 459 for (char c: configProperty) { 460 if (isdigit(c)) { 461 value += c; 462 } else { 463 key += c; 464 } 465 } 466 if (key == "jsHeap") { 467 heapSize_ = static_cast<size_t>(stoi(value)) * 1_MB; 468 } 469 if (key == "openArkTools") { 470 openArkTools_ = true; 471 } 472 } 473 } 474 GetHeapSize()475 size_t GetHeapSize() const 476 { 477 return heapSize_; 478 } 479 GetDefaultProperties()480 int GetDefaultProperties() 481 { 482 return ArkProperties::PARALLEL_GC | ArkProperties::CONCURRENT_MARK | ArkProperties::CONCURRENT_SWEEP | 483 ArkProperties::ENABLE_ARKTOOLS | ArkProperties::ENABLE_IDLE_GC; 484 } 485 GetArkProperties()486 int GetArkProperties() 487 { 488 return arkProperties_; 489 } 490 GetArkBundleName()491 std::string GetArkBundleName() const 492 { 493 return arkBundleName_; 494 } 495 EnableOptionalLog()496 bool EnableOptionalLog() const 497 { 498 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::OPTIONAL_LOG) != 0; 499 } 500 EnableGCStatsPrint()501 bool EnableGCStatsPrint() const 502 { 503 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::GC_STATS_PRINT) != 0; 504 } 505 EnableParallelGC()506 bool EnableParallelGC() const 507 { 508 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::PARALLEL_GC) != 0; 509 } 510 EnableConcurrentMark()511 bool EnableConcurrentMark() const 512 { 513 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::CONCURRENT_MARK) != 0; 514 } 515 EnableSharedConcurrentMark()516 bool EnableSharedConcurrentMark() const 517 { 518 // Use DISABLE to adapt to the exsiting ArkProperties in testing scripts. 519 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::DISABLE_SHARED_CONCURRENT_MARK) == 0; 520 } 521 EnableExceptionBacktrace()522 bool EnableExceptionBacktrace() const 523 { 524 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::EXCEPTION_BACKTRACE) != 0; 525 } 526 EnableConcurrentSweep()527 bool EnableConcurrentSweep() const 528 { 529 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::CONCURRENT_SWEEP) != 0; 530 } 531 EnableThreadCheck()532 bool EnableThreadCheck() const 533 { 534 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::THREAD_CHECK) != 0; 535 } 536 EnableIdleGC()537 bool EnableIdleGC() const 538 { 539 return false; 540 } 541 EnableGCTracer()542 bool EnableGCTracer() const 543 { 544 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_GC_TRACER) != 0; 545 } 546 EnableGlobalObjectLeakCheck()547 bool EnableGlobalObjectLeakCheck() const 548 { 549 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::GLOBAL_OBJECT_LEAK_CHECK) != 0; 550 } 551 EnableGlobalPrimitiveLeakCheck()552 bool EnableGlobalPrimitiveLeakCheck() const 553 { 554 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::GLOBAL_PRIMITIVE_LEAK_CHECK) != 0; 555 } 556 EnableGlobalLeakCheck()557 bool EnableGlobalLeakCheck() const 558 { 559 return EnableGlobalObjectLeakCheck() || EnableGlobalPrimitiveLeakCheck(); 560 } 561 EnableCpuProfilerColdStartMainThread()562 bool EnableCpuProfilerColdStartMainThread() const 563 { 564 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::CPU_PROFILER_COLD_START_MAIN_THREAD) != 0; 565 } 566 EnableCpuProfilerColdStartWorkerThread()567 bool EnableCpuProfilerColdStartWorkerThread() const 568 { 569 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::CPU_PROFILER_COLD_START_WORKER_THREAD) != 0; 570 } 571 EnableCpuProfilerAnyTimeMainThread()572 bool EnableCpuProfilerAnyTimeMainThread() const 573 { 574 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::CPU_PROFILER_ANY_TIME_MAIN_THREAD) != 0; 575 } 576 EnableCpuProfilerAnyTimeWorkerThread()577 bool EnableCpuProfilerAnyTimeWorkerThread() const 578 { 579 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::CPU_PROFILER_ANY_TIME_WORKER_THREAD) != 0; 580 } 581 EnableCpuProfilerVMTag()582 bool EnableCpuProfilerVMTag() const 583 { 584 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_CPU_PROFILER_VM_TAG) != 0; 585 } 586 IsStartGlobalLeakCheck()587 bool IsStartGlobalLeakCheck() const 588 { 589 return startGlobalLeakCheck_; 590 } 591 SwitchStartGlobalLeakCheck()592 void SwitchStartGlobalLeakCheck() 593 { 594 startGlobalLeakCheck_ = !startGlobalLeakCheck_; 595 } 596 EnableSnapshotSerialize()597 bool EnableSnapshotSerialize() const 598 { 599 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_SNAPSHOT_SERIALIZE) != 0; 600 } 601 EnableSnapshotDeserialize()602 bool EnableSnapshotDeserialize() const 603 { 604 if (WIN_OR_MAC_OR_IOS_PLATFORM) { 605 return false; 606 } 607 608 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_SNAPSHOT_DESERIALIZE) != 0; 609 } 610 EnableHeapVerify()611 bool EnableHeapVerify() const 612 { 613 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_HEAP_VERIFY) != 0; 614 } 615 EnableMicroJobTrace()616 bool EnableMicroJobTrace() const 617 { 618 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_MICROJOB_TRACE) != 0; 619 } 620 EnableESMTrace()621 bool EnableESMTrace() const 622 { 623 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_ESM_TRACE) != 0; 624 } 625 EnableModuleLog()626 bool EnableModuleLog() const 627 { 628 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_MODULE_LOG) != 0; 629 } 630 EnableSerializationTimeoutCheck()631 bool EnableSerializationTimeoutCheck() const 632 { 633 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_SERIALIZATION_TIMEOUT_CHECK) != 0; 634 } 635 EnablePageTagThreadId()636 bool EnablePageTagThreadId() const 637 { 638 return (static_cast<uint32_t>(arkProperties_) & ArkProperties::ENABLE_PAGETAG_THREAD_ID) != 0; 639 } 640 WasSetMaxNonmovableSpaceCapacity()641 bool WasSetMaxNonmovableSpaceCapacity() const 642 { 643 return WasOptionSet(OPTION_MAX_UNMOVABLE_SPACE); 644 } 645 MaxNonmovableSpaceCapacity()646 size_t MaxNonmovableSpaceCapacity() const 647 { 648 return maxNonmovableSpaceCapacity_; 649 } 650 SetMaxNonmovableSpaceCapacity(uint32_t value)651 void SetMaxNonmovableSpaceCapacity(uint32_t value) 652 { 653 maxNonmovableSpaceCapacity_ = value; 654 } 655 SetEnableAsmInterpreter(bool value)656 void SetEnableAsmInterpreter(bool value) 657 { 658 enableAsmInterpreter_ = value; 659 } 660 GetEnableAsmInterpreter()661 bool GetEnableAsmInterpreter() const 662 { 663 return enableAsmInterpreter_; 664 } 665 SetEnableBuiltinsLazy(bool value)666 void SetEnableBuiltinsLazy(bool value) 667 { 668 enableBuiltinsLazy_ = value; 669 } 670 GetEnableBuiltinsLazy()671 bool GetEnableBuiltinsLazy() const 672 { 673 return enableBuiltinsLazy_; 674 } 675 SetAsmOpcodeDisableRange(std::string value)676 void SetAsmOpcodeDisableRange(std::string value) 677 { 678 asmOpcodeDisableRange_ = std::move(value); 679 } 680 SetDisableCodeSign(bool value)681 void SetDisableCodeSign(bool value) 682 { 683 disableCodeSign_ = value; 684 } 685 GetDisableCodeSign()686 bool GetDisableCodeSign() const 687 { 688 return disableCodeSign_; 689 } 690 SetEnableJitFort(bool value)691 void SetEnableJitFort(bool value) 692 { 693 enableJitFort_ = value; 694 } 695 GetEnableJitFort()696 bool GetEnableJitFort() const 697 { 698 return enableJitFort_; 699 } 700 SetEnableAsyncCopyToFort(bool value)701 void SetEnableAsyncCopyToFort(bool value) 702 { 703 enableAsyncCopyToFort_ = value; 704 } 705 GetEnableAsyncCopyToFort()706 bool GetEnableAsyncCopyToFort() const 707 { 708 return enableAsyncCopyToFort_; 709 } 710 ParseAsmInterOption()711 void ParseAsmInterOption() 712 { 713 asmInterParsedOption_.enableAsm = enableAsmInterpreter_; 714 std::string strAsmOpcodeDisableRange = asmOpcodeDisableRange_; 715 if (strAsmOpcodeDisableRange.empty()) { 716 return; 717 } 718 719 // asm interpreter handle disable range 720 size_t pos = strAsmOpcodeDisableRange.find(","); 721 if (pos != std::string::npos) { 722 std::string strStart = strAsmOpcodeDisableRange.substr(0, pos); 723 std::string strEnd = strAsmOpcodeDisableRange.substr(pos + 1); 724 int64_t inputStart; 725 int64_t inputEnd; 726 if (!base::NumberHelper::StringToInt64(strStart, inputStart)) { 727 inputStart = 0; 728 LOG_ECMA_IF(!strStart.empty(), INFO) << "when get start, strStart is " << strStart; 729 } 730 if (!base::NumberHelper::StringToInt64(strEnd, inputEnd)) { 731 inputEnd = kungfu::BYTECODE_STUB_END_ID; 732 LOG_ECMA_IF(!strEnd.empty(), INFO) << "when get end, strEnd is " << strEnd; 733 } 734 int start = static_cast<int>(inputStart); 735 int end = static_cast<int>(inputEnd); 736 if (start >= 0 && start < kungfu::BytecodeStubCSigns::NUM_OF_ALL_NORMAL_STUBS && end >= 0 && 737 end < kungfu::BytecodeStubCSigns::NUM_OF_ALL_NORMAL_STUBS && start <= end) { 738 asmInterParsedOption_.handleStart = start; 739 asmInterParsedOption_.handleEnd = end; 740 } 741 } 742 } 743 GetAsmInterParsedOption()744 AsmInterParsedOption GetAsmInterParsedOption() const 745 { 746 return asmInterParsedOption_; 747 } 748 GetCompilerLogOption()749 std::string GetCompilerLogOption() const 750 { 751 return compilerLogOpt_; 752 } 753 SetCompilerLogOption(std::string value)754 void SetCompilerLogOption(std::string value) 755 { 756 compilerLogOpt_ = std::move(value); 757 } 758 WasSetCompilerLogOption()759 bool WasSetCompilerLogOption() const 760 { 761 return WasOptionSet(OPTION_COMPILER_LOG_OPT) && GetCompilerLogOption().find("none") == std::string::npos; 762 } 763 GetMethodsListForLog()764 std::string GetMethodsListForLog() const 765 { 766 return compilerLogMethods_; 767 } 768 SetMethodsListForLog(std::string value)769 void SetMethodsListForLog(std::string value) 770 { 771 compilerLogMethods_ = std::move(value); 772 } 773 WasSetMethodsListForLog()774 bool WasSetMethodsListForLog() const 775 { 776 return WasOptionSet(OPTION_COMPILER_LOG_METHODS) && GetCompilerLogOption().find("none") == std::string::npos && 777 GetCompilerLogOption().find("all") == std::string::npos; 778 } 779 SetCompilerLogSnapshot(bool value)780 void SetCompilerLogSnapshot(bool value) 781 { 782 compilerLogSnapshot_ = value; 783 } 784 IsEnableCompilerLogSnapshot()785 bool IsEnableCompilerLogSnapshot() const 786 { 787 return compilerLogSnapshot_; 788 } 789 WasSetCompilerLogSnapshot()790 bool WasSetCompilerLogSnapshot() const 791 { 792 return WasOptionSet(OPTION_COMPILER_LOG_SNAPSHOT); 793 } 794 SetCompilerLogTime(bool value)795 void SetCompilerLogTime(bool value) 796 { 797 compilerLogTime_ = value; 798 } 799 IsEnableCompilerLogTime()800 bool IsEnableCompilerLogTime() const 801 { 802 return compilerLogTime_; 803 } 804 WasSetCompilerLogTime()805 bool WasSetCompilerLogTime() const 806 { 807 return WasOptionSet(OPTION_COMPILER_LOG_TIME); 808 } 809 GetSerializerBufferSizeLimit()810 uint64_t GetSerializerBufferSizeLimit() const 811 { 812 return serializerBufferSizeLimit_; 813 } 814 SetSerializerBufferSizeLimit(uint64_t value)815 void SetSerializerBufferSizeLimit(uint64_t value) 816 { 817 serializerBufferSizeLimit_ = value; 818 } 819 GetHeapSizeLimit()820 uint32_t GetHeapSizeLimit() const 821 { 822 return heapSizeLimit_; 823 } 824 SetHeapSizeLimit(uint32_t value)825 void SetHeapSizeLimit(uint32_t value) 826 { 827 heapSizeLimit_ = value; 828 } 829 WasSetHeapSizeLimit()830 bool WasSetHeapSizeLimit() const 831 { 832 return WasOptionSet(OPTION_HEAP_SIZE_LIMIT); 833 } 834 SetIsWorker(bool isWorker)835 void SetIsWorker(bool isWorker) 836 { 837 isWorker_ = isWorker; 838 } 839 SetIsRestrictedWorker(bool isRestrictedWorker)840 inline void SetIsRestrictedWorker(bool isRestrictedWorker) 841 { 842 isRestrictedWorker_ = isRestrictedWorker; 843 } 844 IsWorker()845 bool IsWorker() const 846 { 847 return isWorker_; 848 } 849 IsRestrictedWorker()850 bool IsRestrictedWorker() const 851 { 852 return isRestrictedWorker_; 853 } 854 EnableIC()855 bool EnableIC() const 856 { 857 return enableIC_; 858 } 859 SetEnableIC(bool value)860 void SetEnableIC(bool value) 861 { 862 enableIC_ = value; 863 } 864 WasSetEnableIC()865 bool WasSetEnableIC() const 866 { 867 return WasOptionSet(OPTION_ENABLE_IC); 868 } 869 GetIcuDataPath()870 std::string GetIcuDataPath() const 871 { 872 return icuDataPath_; 873 } 874 SetIcuDataPath(std::string value)875 void SetIcuDataPath(std::string value) 876 { 877 icuDataPath_ = std::move(value); 878 } 879 WasSetIcuDataPath()880 bool WasSetIcuDataPath() const 881 { 882 return WasOptionSet(OPTION_ICU_DATA_PATH); 883 } 884 IsStartupTime()885 bool IsStartupTime() const 886 { 887 return startupTime_; 888 } 889 SetStartupTime(bool value)890 void SetStartupTime(bool value) 891 { 892 startupTime_ = value; 893 } 894 WasSetStartupTime()895 bool WasSetStartupTime() const 896 { 897 return WasOptionSet(OPTION_STARTUP_TIME); 898 } 899 SetTraceBc(bool value)900 void SetTraceBc(bool value) 901 { 902 traceBc_ = value; 903 } 904 IsTraceBC()905 bool IsTraceBC() const 906 { 907 return traceBc_; 908 } 909 WasSetTraceBc()910 bool WasSetTraceBc() const 911 { 912 return WasOptionSet(OPTION_COMPILER_TRACE_BC); 913 } 914 GetLogLevel()915 std::string GetLogLevel() const 916 { 917 return logLevel_; 918 } 919 SetLogLevel(std::string value)920 void SetLogLevel(std::string value) 921 { 922 logLevel_ = std::move(value); 923 } 924 WasSetLogLevel()925 bool WasSetLogLevel() const 926 { 927 return WasOptionSet(OPTION_LOG_LEVEL); 928 } 929 GetLogComponents()930 arg_list_t GetLogComponents() const 931 { 932 return logComponents_; 933 } 934 SetLogComponents(arg_list_t value)935 void SetLogComponents(arg_list_t value) 936 { 937 logComponents_ = std::move(value); 938 } 939 WasSetLogComponents()940 bool WasSetLogComponents() const 941 { 942 return WasOptionSet(OPTION_LOG_COMPONENTS); 943 } 944 GetLogDebug()945 arg_list_t GetLogDebug() const 946 { 947 return logDebug_; 948 } 949 SetLogDebug(arg_list_t value)950 void SetLogDebug(arg_list_t value) 951 { 952 logDebug_ = std::move(value); 953 } 954 WasSetLogDebug()955 bool WasSetLogDebug() const 956 { 957 return WasOptionSet(OPTION_LOG_DEBUG); 958 } 959 GetLogInfo()960 arg_list_t GetLogInfo() const 961 { 962 return logInfo_; 963 } 964 SetLogInfo(arg_list_t value)965 void SetLogInfo(arg_list_t value) 966 { 967 logInfo_ = std::move(value); 968 } 969 WasSetLogInfo()970 bool WasSetLogInfo() const 971 { 972 return WasOptionSet(OPTION_LOG_INFO); 973 } 974 GetLogWarning()975 arg_list_t GetLogWarning() const 976 { 977 return logWarning_; 978 } 979 SetLogWarning(arg_list_t value)980 void SetLogWarning(arg_list_t value) 981 { 982 logWarning_ = std::move(value); 983 } 984 WasSetLogWarning()985 bool WasSetLogWarning() const 986 { 987 return WasOptionSet(OPTION_LOG_WARNING); 988 } 989 GetLogError()990 arg_list_t GetLogError() const 991 { 992 return logError_; 993 } 994 SetLogError(arg_list_t value)995 void SetLogError(arg_list_t value) 996 { 997 logError_ = std::move(value); 998 } 999 WasSetLogError()1000 bool WasSetLogError() const 1001 { 1002 return WasOptionSet(OPTION_LOG_ERROR); 1003 } 1004 GetLogFatal()1005 arg_list_t GetLogFatal() const 1006 { 1007 return logFatal_; 1008 } 1009 SetLogFatal(arg_list_t value)1010 void SetLogFatal(arg_list_t value) 1011 { 1012 logFatal_ = std::move(value); 1013 } 1014 WasSetLogFatal()1015 bool WasSetLogFatal() const 1016 { 1017 return WasOptionSet(OPTION_LOG_FATAL); 1018 } 1019 GetMaxAotMethodSize()1020 size_t GetMaxAotMethodSize() const 1021 { 1022 return maxAotMethodSize_; 1023 } 1024 SetMaxAotMethodSize(uint32_t value)1025 void SetMaxAotMethodSize(uint32_t value) 1026 { 1027 maxAotMethodSize_ = value; 1028 } 1029 GetTypeThreshold()1030 double GetTypeThreshold() const 1031 { 1032 return typeThreshold_; 1033 } 1034 SetTypeThreshold(double threshold)1035 void SetTypeThreshold(double threshold) 1036 { 1037 typeThreshold_ = threshold; 1038 } 1039 GetEntryPoint()1040 std::string GetEntryPoint() const 1041 { 1042 return entryPoint_; 1043 } 1044 SetEntryPoint(std::string value)1045 void SetEntryPoint(std::string value) 1046 { 1047 entryPoint_ = std::move(value); 1048 } 1049 WasSetEntryPoint()1050 bool WasSetEntryPoint() const 1051 { 1052 return WasOptionSet(OPTION_ENTRY_POINT); 1053 } 1054 GetMergeAbc()1055 bool GetMergeAbc() const 1056 { 1057 return mergeAbc_; 1058 } 1059 SetMergeAbc(bool value)1060 void SetMergeAbc(bool value) 1061 { 1062 mergeAbc_ = value; 1063 } 1064 SetEnableContext(bool value)1065 void SetEnableContext(bool value) 1066 { 1067 enableContext_ = value; 1068 } 1069 IsEnableContext()1070 bool IsEnableContext() const 1071 { 1072 return enableContext_; 1073 } 1074 SetEnablePrintExecuteTime(bool value)1075 void SetEnablePrintExecuteTime(bool value) 1076 { 1077 enablePrintExecuteTime_ = value; 1078 } 1079 IsEnablePrintExecuteTime()1080 bool IsEnablePrintExecuteTime() const 1081 { 1082 return enablePrintExecuteTime_; 1083 } 1084 SetEnableElementsKind(bool value)1085 void SetEnableElementsKind(bool value) 1086 { 1087 enableElementsKind_ = value; 1088 } 1089 IsEnableElementsKind()1090 bool IsEnableElementsKind() const 1091 { 1092 return enableElementsKind_; 1093 } 1094 SetEnablePGOProfiler(bool value)1095 void SetEnablePGOProfiler(bool value) 1096 { 1097 enablePGOProfiler_ = value; 1098 } 1099 IsEnablePGOProfiler()1100 bool IsEnablePGOProfiler() const 1101 { 1102 return enablePGOProfiler_; 1103 } 1104 GetPGOHotnessThreshold()1105 uint32_t GetPGOHotnessThreshold() const 1106 { 1107 return pgoHotnessThreshold_; 1108 } 1109 SetPGOHotnessThreshold(uint32_t threshold)1110 void SetPGOHotnessThreshold(uint32_t threshold) 1111 { 1112 pgoHotnessThreshold_ = threshold; 1113 } 1114 GetPGOSaveMinInterval()1115 uint32_t GetPGOSaveMinInterval() const 1116 { 1117 return pgoSaveMinInterval_; 1118 } 1119 SetPGOSaveMinInterval(uint32_t value)1120 void SetPGOSaveMinInterval(uint32_t value) 1121 { 1122 pgoSaveMinInterval_ = value; 1123 } 1124 GetPGOProfilerPath()1125 std::string GetPGOProfilerPath() const 1126 { 1127 return pgoProfilerPath_; 1128 } 1129 SetEnableBaselinePgo(bool value)1130 void SetEnableBaselinePgo(bool value) 1131 { 1132 enableBaselinePgo_ = value; 1133 } 1134 IsEnableBaselinePgo()1135 bool IsEnableBaselinePgo() const 1136 { 1137 return enableBaselinePgo_; 1138 } 1139 SetPGOProfilerPath(const std::string & value)1140 void SetPGOProfilerPath(const std::string& value) 1141 { 1142 pgoProfilerPath_ = panda::os::file::File::GetExtendedFilePath(value); 1143 } 1144 IsPGOProfilerPathEmpty()1145 bool IsPGOProfilerPathEmpty() const 1146 { 1147 return pgoProfilerPath_.empty(); 1148 } 1149 SetEnableTypeLowering(bool value)1150 void SetEnableTypeLowering(bool value) 1151 { 1152 enableTypeLowering_ = value; 1153 } 1154 IsEnableArrayBoundsCheckElimination()1155 bool IsEnableArrayBoundsCheckElimination() const 1156 { 1157 return enableArrayBoundsCheckElimination_; 1158 } 1159 SetEnableArrayBoundsCheckElimination(bool value)1160 void SetEnableArrayBoundsCheckElimination(bool value) 1161 { 1162 enableArrayBoundsCheckElimination_ = value; 1163 } 1164 IsEnableFrameStateElimination()1165 bool IsEnableFrameStateElimination() const 1166 { 1167 return enableFrameStateElimination_; 1168 } 1169 SetEnableFrameStateElimination(bool value)1170 void SetEnableFrameStateElimination(bool value) 1171 { 1172 enableFrameStateElimination_ = value; 1173 } 1174 IsEnableTypeLowering()1175 bool IsEnableTypeLowering() const 1176 { 1177 return enableTypeLowering_; 1178 } 1179 SetEnableEarlyElimination(bool value)1180 void SetEnableEarlyElimination(bool value) 1181 { 1182 enableEarlyElimination_ = value; 1183 } 1184 IsEnableEarlyElimination()1185 bool IsEnableEarlyElimination() const 1186 { 1187 return enableEarlyElimination_; 1188 } 1189 SetEnableLaterElimination(bool value)1190 void SetEnableLaterElimination(bool value) 1191 { 1192 enableLaterElimination_ = value; 1193 } 1194 IsEnableLaterElimination()1195 bool IsEnableLaterElimination() const 1196 { 1197 return enableLaterElimination_; 1198 } 1199 SetEnableInstrcutionCombine(bool value)1200 void SetEnableInstrcutionCombine(bool value) 1201 { 1202 enableInstrcutionCombine = value; 1203 } 1204 IsEnableInstrcutionCombine()1205 bool IsEnableInstrcutionCombine() const 1206 { 1207 return enableInstrcutionCombine; 1208 } 1209 SetEnableValueNumbering(bool value)1210 void SetEnableValueNumbering(bool value) 1211 { 1212 enableValueNumbering_ = value; 1213 } 1214 IsEnableValueNumbering()1215 bool IsEnableValueNumbering() const 1216 { 1217 return enableValueNumbering_; 1218 } 1219 SetEnableJIT(bool value)1220 void SetEnableJIT(bool value) 1221 { 1222 enableFastJIT_ = value; 1223 } 1224 IsEnableJIT()1225 bool IsEnableJIT() const 1226 { 1227 return enableFastJIT_; 1228 } 1229 SetEnableAPPJIT(bool value)1230 void SetEnableAPPJIT(bool value) 1231 { 1232 enableAPPJIT_ = value; 1233 } 1234 IsEnableAPPJIT()1235 bool IsEnableAPPJIT() const 1236 { 1237 return enableAPPJIT_; 1238 } 1239 SetEnableJitFrame(bool value)1240 void SetEnableJitFrame(bool value) 1241 { 1242 enableJitFrame_ = value; 1243 } 1244 IsEnableJitFrame()1245 bool IsEnableJitFrame() const 1246 { 1247 return enableJitFrame_; 1248 } 1249 IsEnableJitDfxDump()1250 bool IsEnableJitDfxDump() const 1251 { 1252 return isEnableJitDfxDump_; 1253 } 1254 SetEnableJitDfxDump(bool value)1255 void SetEnableJitDfxDump(bool value) 1256 { 1257 isEnableJitDfxDump_ = value; 1258 } 1259 SetEnableOSR(bool value)1260 void SetEnableOSR(bool value) 1261 { 1262 enableOSR_ = value; 1263 } 1264 IsEnableOSR()1265 bool IsEnableOSR() const 1266 { 1267 return enableOSR_; 1268 } 1269 SetJitHotnessThreshold(uint16_t value)1270 void SetJitHotnessThreshold(uint16_t value) 1271 { 1272 jitHotnessThreshold_ = value; 1273 } 1274 GetJitHotnessThreshold()1275 uint16_t GetJitHotnessThreshold() const 1276 { 1277 return jitHotnessThreshold_; 1278 } 1279 SetJitCallThreshold(uint8_t value)1280 void SetJitCallThreshold(uint8_t value) 1281 { 1282 jitCallThreshold_ = value; 1283 } 1284 GetJitCallThreshold()1285 uint8_t GetJitCallThreshold() const 1286 { 1287 return jitCallThreshold_; 1288 } 1289 SetOsrHotnessThreshold(uint16_t value)1290 void SetOsrHotnessThreshold(uint16_t value) 1291 { 1292 osrHotnessThreshold_ = value; 1293 } 1294 GetOsrHotnessThreshold()1295 uint16_t GetOsrHotnessThreshold() const 1296 { 1297 return osrHotnessThreshold_; 1298 } 1299 SetForceJitCompileMain(bool value)1300 void SetForceJitCompileMain(bool value) 1301 { 1302 forceJitCompileMain_ = value; 1303 } 1304 IsEnableForceJitCompileMain()1305 bool IsEnableForceJitCompileMain() const 1306 { 1307 return forceJitCompileMain_; 1308 } 1309 SetEnableBaselineJIT(bool value)1310 void SetEnableBaselineJIT(bool value) 1311 { 1312 enableBaselineJIT_ = value; 1313 } 1314 IsEnableBaselineJIT()1315 bool IsEnableBaselineJIT() const 1316 { 1317 return enableBaselineJIT_; 1318 } 1319 SetBaselineJitHotnessThreshold(uint16_t value)1320 void SetBaselineJitHotnessThreshold(uint16_t value) 1321 { 1322 baselineJitHotnessThreshold_ = value; 1323 } 1324 GetBaselineJitHotnessThreshold()1325 uint16_t GetBaselineJitHotnessThreshold() const 1326 { 1327 return baselineJitHotnessThreshold_; 1328 } 1329 SetForceBaselineCompileMain(bool value)1330 void SetForceBaselineCompileMain(bool value) 1331 { 1332 forceBaselineCompileMain_ = value; 1333 } 1334 IsEnableForceBaselineCompileMain()1335 bool IsEnableForceBaselineCompileMain() const 1336 { 1337 return forceBaselineCompileMain_; 1338 } 1339 SetEnableNewValueNumbering(bool value)1340 void SetEnableNewValueNumbering(bool value) 1341 { 1342 enableNewValueNumbering_ = value; 1343 } 1344 IsEnableNewValueNumbering()1345 bool IsEnableNewValueNumbering() const 1346 { 1347 return enableNewValueNumbering_; 1348 } 1349 SetEnableOptString(bool value)1350 void SetEnableOptString(bool value) 1351 { 1352 enableOptString_ = value; 1353 } 1354 IsEnableOptString()1355 bool IsEnableOptString() const 1356 { 1357 return enableOptString_; 1358 } 1359 SetEnableOptInlining(bool value)1360 void SetEnableOptInlining(bool value) 1361 { 1362 enableOptInlining_ = value; 1363 } 1364 SetEnableEmptyCatchFunction(bool value)1365 void SetEnableEmptyCatchFunction(bool value) 1366 { 1367 enableEmptyCatchFunction_ = value; 1368 } 1369 IsEnableEmptyCatchFunction()1370 bool IsEnableEmptyCatchFunction() const 1371 { 1372 return enableEmptyCatchFunction_; 1373 } 1374 IsEnableOptInlining()1375 bool IsEnableOptInlining() const 1376 { 1377 return enableOptInlining_; 1378 } 1379 SetEnableOptPGOType(bool value)1380 void SetEnableOptPGOType(bool value) 1381 { 1382 enableOptPGOType_ = value; 1383 } 1384 IsEnableOptPGOType()1385 bool IsEnableOptPGOType() const 1386 { 1387 return enableOptPGOType_; 1388 } 1389 SetEnableOptTrackField(bool value)1390 void SetEnableOptTrackField(bool value) 1391 { 1392 enableOptTrackField_ = value; 1393 } 1394 IsEnableOptTrackField()1395 bool IsEnableOptTrackField() const 1396 { 1397 return enableOptTrackField_; 1398 } 1399 GetCompilerModuleMethods()1400 uint32_t GetCompilerModuleMethods() const 1401 { 1402 return compilerModuleMethods_; 1403 } 1404 SetCompilerModuleMethods(uint32_t compilerModuleMethods)1405 void SetCompilerModuleMethods(uint32_t compilerModuleMethods) 1406 { 1407 compilerModuleMethods_ = compilerModuleMethods; 1408 } 1409 SetTraceDeopt(bool value)1410 void SetTraceDeopt(bool value) 1411 { 1412 traceDeopt_ = value; 1413 } 1414 GetTraceDeopt()1415 bool GetTraceDeopt() const 1416 { 1417 return traceDeopt_; 1418 } 1419 SetDeoptThreshold(uint8_t value)1420 void SetDeoptThreshold(uint8_t value) 1421 { 1422 deoptThreshold_ = value; 1423 } 1424 GetDeoptThreshold()1425 uint32_t GetDeoptThreshold() const 1426 { 1427 return deoptThreshold_; 1428 } 1429 SetStressDeopt(bool value)1430 void SetStressDeopt(bool value) 1431 { 1432 stressDeopt_ = value; 1433 } 1434 GetStressDeopt()1435 bool GetStressDeopt() const 1436 { 1437 return stressDeopt_; 1438 } 1439 SetDeviceState(bool value)1440 void SetDeviceState(bool value) 1441 { 1442 deviceIsScreenOff_ = value; 1443 } 1444 GetDeviceState()1445 bool GetDeviceState() const 1446 { 1447 return deviceIsScreenOff_; 1448 } 1449 WasSetDeviceState()1450 bool WasSetDeviceState() const 1451 { 1452 return WasOptionSet(OPTION_COMPILER_DEVICE_STATE); 1453 } 1454 SetOptCodeProfiler(bool value)1455 void SetOptCodeProfiler(bool value) 1456 { 1457 optCodeProfiler_ = value; 1458 } 1459 GetOptCodeProfiler()1460 bool GetOptCodeProfiler() const 1461 { 1462 return optCodeProfiler_; 1463 } 1464 SetVerifyVTable(bool value)1465 void SetVerifyVTable(bool value) 1466 { 1467 verifyVTable_ = value; 1468 } 1469 GetVerifyVTable()1470 bool GetVerifyVTable() const 1471 { 1472 return verifyVTable_; 1473 } 1474 GetCompilerSelectMethods()1475 std::string GetCompilerSelectMethods() const 1476 { 1477 return compilerSelectMethods_; 1478 } 1479 SetCompilerSelectMethods(std::string value)1480 void SetCompilerSelectMethods(std::string value) 1481 { 1482 compilerSelectMethods_ = std::move(value); 1483 } 1484 GetCompilerSkipMethods()1485 std::string GetCompilerSkipMethods() const 1486 { 1487 return compilerSkipMethods_; 1488 } 1489 SetCompilerSkipMethods(std::string value)1490 void SetCompilerSkipMethods(std::string value) 1491 { 1492 compilerSkipMethods_ = std::move(value); 1493 } 1494 SetPGOTrace(bool value)1495 void SetPGOTrace(bool value) 1496 { 1497 pgoTrace_ = value; 1498 } 1499 GetPGOTrace()1500 bool GetPGOTrace() const 1501 { 1502 return pgoTrace_; 1503 } 1504 SetTraceInline(bool value)1505 void SetTraceInline(bool value) 1506 { 1507 traceInline_ = value; 1508 } 1509 GetTraceInline()1510 bool GetTraceInline() const 1511 { 1512 return traceInline_; 1513 } 1514 SetTraceValueNumbering(bool value)1515 void SetTraceValueNumbering(bool value) 1516 { 1517 traceValueNumbering_ = value; 1518 } 1519 GetTraceValueNumbering()1520 bool GetTraceValueNumbering() const 1521 { 1522 return traceValueNumbering_; 1523 } 1524 SetTraceJIT(bool value)1525 void SetTraceJIT(bool value) 1526 { 1527 traceJIT_ = value; 1528 } 1529 GetTraceJIT()1530 bool GetTraceJIT() const 1531 { 1532 return traceJIT_; 1533 } 1534 SetTraceInstructionCombine(bool value)1535 void SetTraceInstructionCombine(bool value) 1536 { 1537 traceInstructionCombine_ = value; 1538 } 1539 GetTraceInstructionCombine()1540 bool GetTraceInstructionCombine() const 1541 { 1542 return traceInstructionCombine_; 1543 } 1544 SetMaxInlineBytecodes(size_t value)1545 void SetMaxInlineBytecodes(size_t value) 1546 { 1547 maxInlineBytecodes_ = value; 1548 } 1549 GetMaxInlineBytecodes()1550 size_t GetMaxInlineBytecodes() 1551 { 1552 return maxInlineBytecodes_; 1553 } 1554 SetCompilerFrameworkAbcPath(std::string frameworkAbcPath)1555 void SetCompilerFrameworkAbcPath(std::string frameworkAbcPath) 1556 { 1557 frameworkAbcPath_ = std::move(frameworkAbcPath); 1558 } 1559 GetCompilerFrameworkAbcPath()1560 std::string GetCompilerFrameworkAbcPath() const 1561 { 1562 return frameworkAbcPath_; 1563 } 1564 WasSetCompilerFrameworkAbcPath()1565 bool WasSetCompilerFrameworkAbcPath() const 1566 { 1567 return WasOptionSet(OPTION_COMPILER_FRAMEWORK_ABC_PATH); 1568 } 1569 SetTargetCompilerMode(std::string mode)1570 void SetTargetCompilerMode(std::string mode) 1571 { 1572 targetCompilerMode_ = std::move(mode); 1573 } 1574 GetTargetCompilerMode()1575 std::string GetTargetCompilerMode() const 1576 { 1577 return targetCompilerMode_; 1578 } 1579 IsTargetCompilerMode()1580 bool IsTargetCompilerMode() const 1581 { 1582 return IsPartialCompilerMode() || IsFullCompilerMode(); 1583 } 1584 IsPartialCompilerMode()1585 bool IsPartialCompilerMode() const 1586 { 1587 return targetCompilerMode_ == "partial"; 1588 } 1589 IsFullCompilerMode()1590 bool IsFullCompilerMode() const 1591 { 1592 return targetCompilerMode_ == "full"; 1593 } 1594 SetHapPath(std::string path)1595 void SetHapPath(std::string path) 1596 { 1597 hapPath_ = std::move(path); 1598 } 1599 GetHapPath()1600 std::string GetHapPath() const 1601 { 1602 return hapPath_; 1603 } 1604 SetHapAbcOffset(uint32_t offset)1605 void SetHapAbcOffset(uint32_t offset) 1606 { 1607 hapAbcOffset_ = offset; 1608 } 1609 GetHapAbcOffset()1610 uint32_t GetHapAbcOffset() const 1611 { 1612 return hapAbcOffset_; 1613 } 1614 SetHapAbcSize(uint32_t size)1615 void SetHapAbcSize(uint32_t size) 1616 { 1617 hapAbcSize_ = size; 1618 } 1619 GetHapAbcSize()1620 uint32_t GetHapAbcSize() const 1621 { 1622 return hapAbcSize_; 1623 } 1624 SetCompilerNoCheck(bool value)1625 void SetCompilerNoCheck(bool value) 1626 { 1627 compilerNoCheck_ = value; 1628 } 1629 IsCompilerNoCheck()1630 bool IsCompilerNoCheck() const 1631 { 1632 return compilerNoCheck_; 1633 } 1634 1635 void SetOptionsForTargetCompilation(); 1636 SetCompilerPipelineHostAOT(bool value)1637 void SetCompilerPipelineHostAOT(bool value) 1638 { 1639 compilerPipelineHostAOT_ = value; 1640 } 1641 IsCompilerPipelineHostAOT()1642 bool IsCompilerPipelineHostAOT() const 1643 { 1644 return compilerPipelineHostAOT_; 1645 } 1646 SetFastAOTCompileMode(bool value)1647 void SetFastAOTCompileMode(bool value) 1648 { 1649 fastAOTCompileMode_ = value; 1650 } 1651 GetFastAOTCompileMode()1652 bool GetFastAOTCompileMode() const 1653 { 1654 return fastAOTCompileMode_; 1655 } 1656 SetEnableOptLoopPeeling(bool value)1657 void SetEnableOptLoopPeeling(bool value) 1658 { 1659 enableOptLoopPeeling_ = value; 1660 } 1661 IsEnableOptLoopPeeling()1662 bool IsEnableOptLoopPeeling() const 1663 { 1664 return enableOptLoopPeeling_; 1665 } 1666 SetEnableOptLoopInvariantCodeMotion(bool value)1667 void SetEnableOptLoopInvariantCodeMotion(bool value) 1668 { 1669 enableOptLoopInvariantCodeMotion_ = value; 1670 } 1671 IsEnableOptLoopInvariantCodeMotion()1672 bool IsEnableOptLoopInvariantCodeMotion() const 1673 { 1674 return enableOptLoopInvariantCodeMotion_; 1675 } 1676 IsEnableOptConstantFolding()1677 bool IsEnableOptConstantFolding() const 1678 { 1679 return enableOptConstantFolding_; 1680 } 1681 SetEnableOptConstantFolding(bool value)1682 void SetEnableOptConstantFolding(bool value) 1683 { 1684 enableOptConstantFolding_ = value; 1685 } 1686 SetEnableOptOnHeapCheck(bool value)1687 void SetEnableOptOnHeapCheck(bool value) 1688 { 1689 enableOptOnHeapCheck_ = value; 1690 } 1691 IsEnableOptOnHeapCheck()1692 bool IsEnableOptOnHeapCheck() const 1693 { 1694 return enableOptOnHeapCheck_; 1695 } 1696 IsEnableLexenvSpecialization()1697 bool IsEnableLexenvSpecialization() const 1698 { 1699 return enableLexenvSpecialization_; 1700 } 1701 SetEnableLexenvSpecialization(bool value)1702 void SetEnableLexenvSpecialization(bool value) 1703 { 1704 enableLexenvSpecialization_ = value; 1705 } 1706 IsEnableNativeInline()1707 bool IsEnableNativeInline() const 1708 { 1709 return enableNativeInline_; 1710 } 1711 SetEnableNativeInline(bool value)1712 void SetEnableNativeInline(bool value) 1713 { 1714 enableNativeInline_ = value; 1715 } 1716 IsEnableLoweringBuiltin()1717 bool IsEnableLoweringBuiltin() const 1718 { 1719 return enableLoweringBuiltin_; 1720 } 1721 SetEnableLoweringBuiltin(bool value)1722 void SetEnableLoweringBuiltin(bool value) 1723 { 1724 enableLoweringBuiltin_ = value; 1725 } 1726 SetCompilerEnableLiteCG(bool value)1727 void SetCompilerEnableLiteCG(bool value) 1728 { 1729 enableLiteCG_ = value; 1730 } 1731 IsCompilerEnableLiteCG()1732 bool IsCompilerEnableLiteCG() const 1733 { 1734 return enableLiteCG_; 1735 } 1736 SetTypedOpProfiler(bool value)1737 void SetTypedOpProfiler(bool value) 1738 { 1739 enableTypedOpProfiler_ = value; 1740 } 1741 GetTypedOpProfiler()1742 bool GetTypedOpProfiler() const 1743 { 1744 return enableTypedOpProfiler_; 1745 } 1746 IsEnableBranchProfiling()1747 bool IsEnableBranchProfiling() const 1748 { 1749 return enableBranchProfiling_; 1750 } 1751 SetEnableBranchProfiling(bool value)1752 void SetEnableBranchProfiling(bool value) 1753 { 1754 enableBranchProfiling_ = value; 1755 } 1756 SetCompilerMethodsRange(arg_list_t * argListStr)1757 void SetCompilerMethodsRange(arg_list_t* argListStr) 1758 { 1759 compileMethodsRange_.first = std::stoull((*argListStr)[0]); 1760 compileMethodsRange_.second = std::stoull((*argListStr)[1]); 1761 } 1762 GetCompilerMethodsRange()1763 const std::pair<uint32_t, uint32_t>& GetCompilerMethodsRange() const 1764 { 1765 return compileMethodsRange_; 1766 } 1767 SetCompilerCodegenOptions(arg_list_t argListStr)1768 void SetCompilerCodegenOptions(arg_list_t argListStr) 1769 { 1770 compileCodegenOption_ = std::move(argListStr); 1771 } 1772 GetCompilerCodegenOptions()1773 const arg_list_t& GetCompilerCodegenOptions() const 1774 { 1775 return compileCodegenOption_; 1776 } SetOptCodeRange(std::string value)1777 void SetOptCodeRange(std::string value) 1778 { 1779 optBCRange_ = std::move(value); 1780 } 1781 GetOptCodeRange()1782 std::string GetOptCodeRange() const 1783 { 1784 return optBCRange_; 1785 } 1786 SetTestAssert(bool value)1787 void SetTestAssert(bool value) 1788 { 1789 testAssert_ = value; 1790 } 1791 GetTestAssert()1792 bool GetTestAssert() const 1793 { 1794 return testAssert_; 1795 } 1796 SetEnableEscapeAnalysis(bool value)1797 void SetEnableEscapeAnalysis(bool value) 1798 { 1799 enableEscapeAnalysis_ = value; 1800 } 1801 IsEnableEscapeAnalysis()1802 bool IsEnableEscapeAnalysis() const 1803 { 1804 return enableEscapeAnalysis_; 1805 } 1806 SetEnableTraceEscapeAnalysis(bool value)1807 void SetEnableTraceEscapeAnalysis(bool value) 1808 { 1809 traceEscapeAnalysis_ = value; 1810 } 1811 GetTraceEscapeAnalysis()1812 bool GetTraceEscapeAnalysis() const 1813 { 1814 return traceEscapeAnalysis_; 1815 } 1816 SetEnableInductionVariableAnalysis(bool value)1817 void SetEnableInductionVariableAnalysis(bool value) 1818 { 1819 enableInductionVariableAnalysis_ = value; 1820 } 1821 IsEnableInductionVariableAnalysis()1822 bool IsEnableInductionVariableAnalysis() const 1823 { 1824 return enableInductionVariableAnalysis_; 1825 } 1826 SetEnableTraceInductionVariableAnalysis(bool value)1827 void SetEnableTraceInductionVariableAnalysis(bool value) 1828 { 1829 traceInductionVariableAnalysis_ = value; 1830 } 1831 GetTraceInductionVariableAnalysis()1832 bool GetTraceInductionVariableAnalysis() const 1833 { 1834 return traceInductionVariableAnalysis_; 1835 } 1836 SetEnableMemoryAnalysis(bool value)1837 void SetEnableMemoryAnalysis(bool value) 1838 { 1839 enableMemoryAnalysis_ = value; 1840 } 1841 IsEnableMemoryAnalysis()1842 bool IsEnableMemoryAnalysis() const 1843 { 1844 return enableMemoryAnalysis_; 1845 } 1846 SetCheckPgoVersion(bool value)1847 void SetCheckPgoVersion(bool value) 1848 { 1849 checkPgoVersion_ = value; 1850 } 1851 IsCheckPgoVersion()1852 bool IsCheckPgoVersion() const 1853 { 1854 return checkPgoVersion_; 1855 } 1856 SetEnableJITPGO(bool value)1857 void SetEnableJITPGO(bool value) 1858 { 1859 enableJITPGO_ = value; 1860 } 1861 IsEnableJITPGO()1862 bool IsEnableJITPGO() const 1863 { 1864 return enableJITPGO_; 1865 } 1866 SetEnableProfileDump(bool value)1867 void SetEnableProfileDump(bool value) 1868 { 1869 enableProfileDump_ = value; 1870 } 1871 IsEnableProfileDump()1872 bool IsEnableProfileDump() const 1873 { 1874 return enableProfileDump_; 1875 } 1876 SetEnableAOTPGO(bool value)1877 void SetEnableAOTPGO(bool value) 1878 { 1879 enableAOTPGO_ = value; 1880 } 1881 IsEnableAOTPGO()1882 bool IsEnableAOTPGO() const 1883 { 1884 return enableAOTPGO_; 1885 } 1886 SetEnableJitFastCompile(bool value)1887 void SetEnableJitFastCompile(bool value) 1888 { 1889 enableJitFastCompile_ = value; 1890 } 1891 IsEnableJitFastCompile()1892 bool IsEnableJitFastCompile() const 1893 { 1894 return enableJitFastCompile_; 1895 } 1896 SetEnableFrameworkAOT(bool value)1897 void SetEnableFrameworkAOT(bool value) 1898 { 1899 enableFrameworkAOT_ = value; 1900 } 1901 IsEnableFrameworkAOT()1902 bool IsEnableFrameworkAOT() const 1903 { 1904 return enableFrameworkAOT_; 1905 } 1906 SetAsyncLoadAbc(bool value)1907 void SetAsyncLoadAbc(bool value) 1908 { 1909 asyncLoadAbc_ = value; 1910 } 1911 IsAsyncLoadAbc()1912 bool IsAsyncLoadAbc() const 1913 { 1914 return asyncLoadAbc_; 1915 } 1916 SetAsyncLoadAbcTest(bool value)1917 void SetAsyncLoadAbcTest(bool value) 1918 { 1919 asyncLoadAbcTest_ = value; 1920 } 1921 IsAsyncLoadAbcTest()1922 bool IsAsyncLoadAbcTest() const 1923 { 1924 return asyncLoadAbcTest_; 1925 } 1926 IsPgoForceDump()1927 bool IsPgoForceDump() const 1928 { 1929 return forceDump_; 1930 } 1931 SetPgoForceDump(bool value)1932 void SetPgoForceDump(bool value) 1933 { 1934 forceDump_ = value; 1935 } 1936 SetConcurrentCompile(bool value)1937 void SetConcurrentCompile(bool value) 1938 { 1939 concurrentCompile = value; 1940 } 1941 IsConcurrentCompile()1942 bool IsConcurrentCompile() const 1943 { 1944 return concurrentCompile; 1945 } 1946 SetAOTHasException(bool value)1947 void SetAOTHasException(bool value) 1948 { 1949 aotHasException_ = value; 1950 } 1951 GetAOTHasException()1952 bool GetAOTHasException() const 1953 { 1954 return aotHasException_; 1955 } 1956 public: 1957 static constexpr int32_t MAX_APP_COMPILE_METHOD_SIZE = 4_KB; 1958 1959 private: 1960 StartsWith(const std::string & haystack,const std::string & needle)1961 static bool StartsWith(const std::string& haystack, const std::string& needle) 1962 { 1963 return std::equal(needle.begin(), needle.end(), haystack.begin()); 1964 } 1965 WasSet(int option)1966 void WasSet(int option) 1967 { 1968 if (option < OPTION_SPLIT_ONE) { 1969 wasSetPartOne_ |= (1ULL << static_cast<uint64_t>(option)); 1970 } else if (option < OPTION_SPLIT_TWO) { 1971 wasSetPartTwo_ |= (1ULL << static_cast<uint64_t>(option - OPTION_SPLIT_ONE)); 1972 } else { 1973 wasSetPartThree_ |= (1ULL << static_cast<uint64_t>(option - OPTION_SPLIT_TWO)); 1974 } 1975 } 1976 WasOptionSet(int option)1977 bool WasOptionSet(int option) const 1978 { 1979 if (option < OPTION_SPLIT_ONE) { 1980 return ((1ULL << static_cast<uint64_t>(option)) & wasSetPartOne_) != 0; 1981 } else if (option < OPTION_SPLIT_TWO) { 1982 return ((1ULL << static_cast<uint64_t>(option - OPTION_SPLIT_ONE)) & wasSetPartTwo_) != 0; 1983 } 1984 return ((1ULL << static_cast<uint64_t>(option - OPTION_SPLIT_TWO)) & wasSetPartThree_) != 0; 1985 } 1986 1987 bool ParseBoolParam(bool* argBool); 1988 bool ParseDoubleParam(const std::string& option, double* argDouble); 1989 bool ParseIntParam(const std::string& option, int* argInt); 1990 bool ParseUint32Param(const std::string& option, uint32_t* argUInt32); 1991 bool ParseUint64Param(const std::string& option, uint64_t* argUInt64); 1992 void ParseListArgParam(const std::string& option, arg_list_t* argListStr, std::string delimiter); 1993 1994 bool enableArkTools_ {true}; 1995 bool openArkTools_ {false}; 1996 std::string stubFile_ {"stub.an"}; 1997 std::string compilerPkgInfo_ {}; 1998 std::string compilerExternalPkgInfo_ {}; 1999 bool compilerEnableExternalPkg_ {true}; 2000 bool enableForceGc_ {true}; 2001 bool enableEdenGC_ {false}; 2002 bool forceFullGc_ {true}; 2003 uint32_t forceSharedGc_ {1}; 2004 int arkProperties_ = GetDefaultProperties(); 2005 std::string arkBundleName_ = {""}; 2006 size_t heapSize_ = {0}; 2007 uint32_t gcThreadNum_ {7}; // 7: default thread num 2008 uint32_t longPauseTime_ {40}; // 40: default pause time 2009 std::string aotOutputFile_ {""}; 2010 std::string targetTriple_ {TARGET_X64}; 2011 uint32_t asmOptLevel_ {2}; 2012 uint32_t relocationMode_ {2}; // 2: default relocation mode 2013 uint32_t maxNonmovableSpaceCapacity_ {4_MB}; 2014 bool enableAsmInterpreter_ {true}; 2015 bool enableBuiltinsLazy_ {true}; 2016 std::string asmOpcodeDisableRange_ {""}; 2017 AsmInterParsedOption asmInterParsedOption_; 2018 uint64_t serializerBufferSizeLimit_ {2_GB}; 2019 uint32_t heapSizeLimit_ {512_MB}; 2020 bool enableIC_ {true}; 2021 std::string icuDataPath_ {"default"}; 2022 bool startupTime_ {false}; 2023 std::string compilerLogOpt_ {"none"}; 2024 std::string compilerLogMethods_ {"none"}; 2025 bool compilerLogSnapshot_ {false}; 2026 bool compilerLogTime_ {false}; 2027 bool enableRuntimeStat_ {false}; 2028 bool isWorker_ {false}; 2029 bool isRestrictedWorker_ {false}; 2030 bool traceBc_ {false}; 2031 std::string logLevel_ {"error"}; 2032 arg_list_t logDebug_ {{"all"}}; 2033 arg_list_t logInfo_ {{"all"}}; 2034 arg_list_t logWarning_ {{"all"}}; 2035 arg_list_t logError_ {{"all"}}; 2036 arg_list_t logFatal_ {{"all"}}; 2037 arg_list_t logComponents_ {{"all"}}; 2038 bool enableAOT_ {false}; 2039 uint32_t maxAotMethodSize_ {32_KB}; 2040 double typeThreshold_ {-1}; 2041 std::string entryPoint_ {"_GLOBAL::func_main_0"}; 2042 bool mergeAbc_ {false}; 2043 bool enableArrayBoundsCheckElimination_ {false}; 2044 bool enableFrameStateElimination_ {true}; 2045 bool enableTypeLowering_ {true}; 2046 bool enableEarlyElimination_ {true}; 2047 bool enableLaterElimination_ {true}; 2048 bool enableValueNumbering_ {true}; 2049 bool enableOptString_ {true}; 2050 bool enableElementsKind_ {false}; 2051 bool enableInstrcutionCombine {true}; 2052 bool enableNewValueNumbering_ {true}; 2053 bool enableOptInlining_ {true}; 2054 bool enableEmptyCatchFunction_ {false}; 2055 bool enableOptPGOType_ {true}; 2056 bool enableFastJIT_ {false}; 2057 bool enableAPPJIT_ {false}; 2058 bool isEnableJitDfxDump_ {false}; 2059 bool enableOSR_ {false}; 2060 uint16_t jitHotnessThreshold_ {2}; 2061 uint8_t jitCallThreshold_ {0}; 2062 uint16_t osrHotnessThreshold_ {2}; 2063 bool forceJitCompileMain_ {false}; 2064 bool enableBaselineJIT_ {false}; 2065 uint16_t baselineJitHotnessThreshold_ {1}; 2066 bool forceBaselineCompileMain_ {false}; 2067 bool enableOptTrackField_ {true}; 2068 uint32_t compilerModuleMethods_ {100}; 2069 uint64_t wasSetPartOne_ {0}; 2070 uint64_t wasSetPartTwo_ {0}; 2071 uint64_t wasSetPartThree_ {0}; 2072 bool enableContext_ {false}; 2073 bool enablePrintExecuteTime_ {false}; 2074 bool enablePGOProfiler_ {false}; 2075 bool enableJITPGO_ {true}; 2076 bool enableAOTPGO_ {true}; 2077 bool enableProfileDump_ {true}; 2078 bool enableFrameworkAOT_ {false}; 2079 uint32_t pgoHotnessThreshold_ {1}; 2080 std::string pgoProfilerPath_ {""}; 2081 uint32_t pgoSaveMinInterval_ {30}; 2082 bool traceDeopt_ {false}; 2083 uint8_t deoptThreshold_ {10}; 2084 bool stressDeopt_ {false}; 2085 bool deviceIsScreenOff_ {true}; 2086 bool optCodeProfiler_ {false}; 2087 bool startGlobalLeakCheck_ {false}; 2088 bool verifyVTable_ {false}; 2089 std::string compilerSelectMethods_ {""}; 2090 std::string compilerSkipMethods_ {""}; 2091 bool pgoTrace_ {false}; 2092 bool traceInline_ {false}; 2093 bool traceJIT_ {false}; 2094 bool traceValueNumbering_ {false}; 2095 bool traceInstructionCombine_ {false}; 2096 bool compilerPipelineHostAOT_ {false}; 2097 size_t maxInlineBytecodes_ {45}; 2098 std::string targetCompilerMode_ {""}; 2099 std::string frameworkAbcPath_ {""}; 2100 std::string hapPath_ {""}; 2101 uint32_t hapAbcOffset_ {0}; 2102 uint32_t hapAbcSize_ {0}; 2103 std::string optBCRange_ {""}; 2104 bool compilerNoCheck_ {false}; 2105 bool fastAOTCompileMode_ {false}; 2106 bool enableOptLoopPeeling_ {true}; 2107 bool enableOptConstantFolding_ {true}; 2108 bool enableOptOnHeapCheck_ {true}; 2109 bool enableOptLoopInvariantCodeMotion_ {false}; 2110 bool enableLexenvSpecialization_ {false}; 2111 bool enableNativeInline_ {true}; 2112 bool enableLoweringBuiltin_ {true}; 2113 bool enableLiteCG_ {false}; 2114 bool enableTypedOpProfiler_ {false}; 2115 bool enableBranchProfiling_ {true}; 2116 bool testAssert_ {false}; 2117 std::pair<uint32_t, uint32_t> compileMethodsRange_ {0, UINT32_MAX}; 2118 arg_list_t compileCodegenOption_ {{""}}; 2119 bool enableEscapeAnalysis_ {false}; 2120 bool traceEscapeAnalysis_ {false}; 2121 bool enableInductionVariableAnalysis_ {false}; 2122 bool traceInductionVariableAnalysis_ {false}; 2123 bool enableMemoryAnalysis_ {true}; 2124 bool checkPgoVersion_ {false}; 2125 bool enableJitFastCompile_ {false}; 2126 bool enableJitFrame_ {false}; 2127 bool disableCodeSign_ {true}; 2128 bool enableJitFort_ {true}; 2129 bool enableAsyncCopyToFort_ {true}; 2130 bool enableBaselinePgo_ {false}; 2131 bool asyncLoadAbc_ {true}; 2132 bool asyncLoadAbcTest_ {false}; 2133 bool forceDump_ {true}; 2134 bool concurrentCompile {true}; 2135 bool aotHasException_ {false}; 2136 }; 2137 } // namespace panda::ecmascript 2138 2139 #endif // ECMASCRIPT_JS_RUNTIME_OPTIONS_H_ 2140