From 220d002727df791bf286e4d92bf706b66831d39e Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Wed, 22 Dec 2021 10:44:52 +0800 Subject: [PATCH] disable call optimization in debug mode Signed-off-by: zhangrengao Change-Id: I1e840e86e2e6b9770390f1608ef5513be1cd63ee --- ts2panda/src/compiler.ts | 4 ++++ ts2panda/ts2abc/ts2abc.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ts2panda/src/compiler.ts b/ts2panda/src/compiler.ts index b323fc7b57..d576ff58db 100644 --- a/ts2panda/src/compiler.ts +++ b/ts2panda/src/compiler.ts @@ -33,6 +33,7 @@ import { setVariableExported } from "./base/util"; import { CacheList, getVregisterCache } from "./base/vregisterCache"; +import { CmdOptions } from "./cmdOptions"; import { CompilerDriver } from "./compilerDriver"; import { DebugInfo, NodeKind } from "./debuginfo"; import { DiagnosticCode, DiagnosticError } from "./diagnostic"; @@ -176,6 +177,9 @@ export class Compiler { } private callOpt() { + if (CmdOptions.isDebugMode()) { + return; + } let CallMap: Map = new Map([ ["this", 1], ["4newTarget", 2], diff --git a/ts2panda/ts2abc/ts2abc.cpp b/ts2panda/ts2abc/ts2abc.cpp index 6d5e7b14a7..b4c7559336 100644 --- a/ts2panda/ts2abc/ts2abc.cpp +++ b/ts2panda/ts2abc/ts2abc.cpp @@ -612,6 +612,10 @@ static void ParseFunctionCatchTables(const Json::Value &function, panda::pandasm static void ParseFunctionCallType(const Json::Value &function, panda::pandasm::Function &pandaFunc) { + if (g_debugModeEnabled) { + return; + } + std::string funcName = ""; if (function.isMember("name") && function["name"].isString()) { funcName = function["name"].asString(); -- Gitee