Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: src/IceAssemblerARM32.cpp

Issue 1407273006: Generate block labels in the ARM hybrid assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Ready for review. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceAssemblerMIPS32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerARM32.cpp
diff --git a/src/IceAssemblerARM32.cpp b/src/IceAssemblerARM32.cpp
index 06ba9c466e55a85a98b74024c3b66229b3117ce8..7f9e50946063bb651cdcfdc54e44a22c5d55aa2b 100644
--- a/src/IceAssemblerARM32.cpp
+++ b/src/IceAssemblerARM32.cpp
@@ -21,6 +21,7 @@
//===----------------------------------------------------------------------===//
#include "IceAssemblerARM32.h"
+#include "IceCfgNode.h"
#include "IceUtils.h"
namespace {
@@ -204,6 +205,17 @@ DecodedResult decodeAddress(const Operand *Opnd, uint32_t &Value) {
namespace Ice {
+void ARM32::AssemblerARM32::bindCfgNodeLabel(const CfgNode *Node) {
+ if (BuildDefs::dump() && !Ctx->getFlags().getDisableHybridAssembly()) {
+ // Generate label name so that branches can find it.
+ emitTextInst(Node->getAsmName() + ":", 0);
Jim Stichnoth 2015/10/23 13:54:52 Can you use "constexpr SizeT InstSize = 0;" for th
Karl 2015/10/23 16:20:07 Done.
+ }
+ SizeT NodeNumber = Node->getIndex();
+ assert(!getPreliminary());
+ Label *L = getOrCreateCfgNodeLabel(NodeNumber);
+ this->bind(L);
+}
+
Label *ARM32::AssemblerARM32::getOrCreateLabel(SizeT Number,
LabelVector &Labels) {
Label *L = nullptr;
@@ -236,12 +248,13 @@ void ARM32::AssemblerARM32::bind(Label *label) {
label->bindTo(bound);
}
-void ARM32::AssemblerARM32::emitTextInst(const std::string &Text) {
- static constexpr uint32_t Placeholder = 0;
+void ARM32::AssemblerARM32::emitTextInst(const std::string &Text,
+ SizeT InstSize) {
AssemblerBuffer::EnsureCapacity ensured(&Buffer);
- AssemblerFixup *F = createTextFixup(Text, sizeof(Placeholder));
+ AssemblerFixup *F = createTextFixup(Text, InstSize);
emitFixup(F);
- emitInst(Placeholder);
+ for (SizeT I = 0; I < InstSize; ++I)
+ Buffer.emit<char>(0);
}
void ARM32::AssemblerARM32::emitType01(CondARM32::Cond Cond, uint32_t Type,
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceAssemblerMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698