OSDN Git Service

Subzero: Remove IceString.
authorJim Stichnoth <stichnot@chromium.org>
Tue, 29 Mar 2016 22:01:06 +0000 (15:01 -0700)
committerJim Stichnoth <stichnot@chromium.org>
Tue, 29 Mar 2016 22:01:06 +0000 (15:01 -0700)
commit467ffe51bebcb3ae3e3ce745c38fc20e8837c31c
tree78a0fec54164d68ee381c8c3beb701669f638630
parente73ee859fdc010f7a7d73f91b22f594af6e69525
Subzero: Remove IceString.

The purpose is to get control over excess string creation and deletion, especially when the strings are long enough to involve malloc/free.

Strings that interface with the outside world, or used for dump/debug, are now explicitly std::string.

Variable names and node names are represented as string IDs and pooled locally in the CFG.  (In a non-DUMP build, this pool should always be empty.)

Other strings that are used across functions are represented as string IDs and pooled globally in the GlobalContext.

The --dump-strings flag allows these strings to be dumped for sanity checking, even in a MINIMAL build.  In a MINIMAL build, the set of strings includes external symbol names, intrinsic names, helper function names, and label names of pooled constants to facilitate deterministic ELF string table output.  For now, it also includes jump table entry names until that gets sorted out.

Constants are fixed so that the name and pooled fields are properly immutable after the constant is fully initialized.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4360
R=jpp@chromium.org

Review URL: https://codereview.chromium.org/1838753002 .
62 files changed:
src/IceAssembler.h
src/IceAssemblerARM32.cpp
src/IceAssemblerARM32.h
src/IceBrowserCompileServer.cpp
src/IceBrowserCompileServer.h
src/IceCfg.cpp
src/IceCfg.h
src/IceCfgNode.cpp
src/IceCfgNode.h
src/IceClFlags.cpp
src/IceClFlags.def
src/IceCompileServer.cpp
src/IceCompiler.cpp
src/IceConverter.cpp
src/IceDefs.h
src/IceELFObjectWriter.cpp
src/IceELFObjectWriter.h
src/IceELFSection.cpp
src/IceELFSection.h
src/IceFixups.cpp
src/IceFixups.h
src/IceGlobalContext.cpp
src/IceGlobalContext.h
src/IceGlobalInits.cpp
src/IceGlobalInits.h
src/IceInst.cpp
src/IceInst.h
src/IceInstARM32.cpp
src/IceInstARM32.h
src/IceInstMIPS32.cpp
src/IceInstMIPS32.h
src/IceInstX8664.cpp
src/IceInstX86Base.h
src/IceInstX86BaseImpl.h
src/IceIntrinsics.cpp
src/IceIntrinsics.h
src/IceMangling.cpp
src/IceMangling.h
src/IceOperand.cpp
src/IceOperand.h
src/IceRegistersARM32.h
src/IceStringPool.h [new file with mode: 0644]
src/IceSwitchLowering.h
src/IceTargetLowering.cpp
src/IceTargetLowering.h
src/IceTargetLoweringARM32.cpp
src/IceTargetLoweringARM32.h
src/IceTargetLoweringMIPS32.cpp
src/IceTargetLoweringMIPS32.h
src/IceTargetLoweringX8632.cpp
src/IceTargetLoweringX8632Traits.h
src/IceTargetLoweringX8664.cpp
src/IceTargetLoweringX8664Traits.h
src/IceTargetLoweringX86Base.h
src/IceTargetLoweringX86BaseImpl.h
src/IceTimerTree.cpp
src/IceTimerTree.h
src/IceTranslator.cpp
src/IceTranslator.h
src/IceTypes.h
src/PNaClTranslator.cpp
unittest/IceELFSectionTest.cpp