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

Unified Diff: src/assembler_ia32.cpp

Issue 837553009: Make fixups reference any constant (allow const float/double pool literals). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: go back to one arenaallocator type alias Created 5 years, 11 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/assembler_ia32.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler_ia32.cpp
diff --git a/src/assembler_ia32.cpp b/src/assembler_ia32.cpp
index 30b84e8546dabd4880571ee8ef11198539604635..8feb7fef3aef198302055a96b4706a522eed7e40 100644
--- a/src/assembler_ia32.cpp
+++ b/src/assembler_ia32.cpp
@@ -31,31 +31,21 @@ class DirectCallRelocation : public AssemblerFixup {
public:
static DirectCallRelocation *create(Assembler *Asm, FixupKind Kind,
- const ConstantRelocatable *Sym) {
+ const Constant *Sym) {
return new (Asm->Allocate<DirectCallRelocation>())
DirectCallRelocation(Kind, Sym);
}
private:
- DirectCallRelocation(FixupKind Kind, const ConstantRelocatable *Sym)
+ DirectCallRelocation(FixupKind Kind, const Constant *Sym)
: AssemblerFixup(Kind, Sym) {}
};
-Address Address::ofConstPool(GlobalContext *Ctx, Assembler *Asm,
- const Constant *Imm) {
- // We should make this much lighter-weight. E.g., just record the const pool
- // entry ID.
- std::string Buffer;
- llvm::raw_string_ostream StrBuf(Buffer);
- Type Ty = Imm->getType();
- assert(llvm::isa<ConstantFloat>(Imm) || llvm::isa<ConstantDouble>(Imm));
- StrBuf << ".L$" << Ty << "$" << Imm->getPoolEntryID();
+Address Address::ofConstPool(Assembler *Asm, const Constant *Imm) {
+ AssemblerFixup *Fixup =
+ x86::DisplacementRelocation::create(Asm, FK_Abs_4, Imm);
const RelocOffsetT Offset = 0;
- const bool SuppressMangling = true;
- Constant *Sym = Ctx->getConstantSym(Offset, StrBuf.str(), SuppressMangling);
- AssemblerFixup *Fixup = x86::DisplacementRelocation::create(
- Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym));
- return x86::Address::Absolute(Fixup);
+ return x86::Address::Absolute(Offset, Fixup);
}
AssemblerX86::~AssemblerX86() {
« no previous file with comments | « src/assembler_ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698