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

Unified Diff: src/assembler_ia32.h

Issue 673543002: First pass at emitIAS for branches and binding labels (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: check the local labels too Created 6 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/assembler.h ('k') | src/assembler_ia32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler_ia32.h
diff --git a/src/assembler_ia32.h b/src/assembler_ia32.h
index bb3f0ab63b2e439eecf7411720f0bc9fa9c44deb..b1079d1af80294593aee5f3b4646aa487a928e56 100644
--- a/src/assembler_ia32.h
+++ b/src/assembler_ia32.h
@@ -284,7 +284,9 @@ public:
#endif // !NDEBUG
}
- ~Label() {
+ ~Label() {}
+
+ void FinalCheck() const {
// Assert if label is being destroyed with unresolved branches pending.
assert(!IsLinked());
assert(!HasNear());
@@ -363,11 +365,16 @@ public:
assert(!use_far_branches);
(void)use_far_branches;
}
- ~AssemblerX86() {}
+ ~AssemblerX86() override;
static const bool kNearJump = true;
static const bool kFarJump = false;
+ Label *GetOrCreateCfgNodeLabel(SizeT NodeNumber);
+ void BindCfgNodeLabel(SizeT NodeNumber) override;
+ Label *GetOrCreateLocalLabel(SizeT Number);
+ void BindLocalLabel(SizeT Number);
+
// Operations to emit GPR instructions (and dispatch on operand type).
typedef void (AssemblerX86::*TypedEmitGPR)(Type, GPRRegister);
typedef void (AssemblerX86::*TypedEmitAddr)(Type, const Address &);
@@ -848,6 +855,14 @@ private:
void EmitGenericShift(int rm, Type Ty, const Operand &operand,
GPRRegister shifter);
+ typedef std::vector<Label *> LabelVector;
+ // A vector of pool-allocated x86 labels for CFG nodes.
+ LabelVector CfgNodeLabels;
+ // A vector of pool-allocated x86 labels for Local labels.
+ LabelVector LocalLabels;
+
+ Label *GetOrCreateLabel(SizeT Number, LabelVector &Labels);
+
AssemblerBuffer buffer_;
};
« no previous file with comments | « src/assembler.h ('k') | src/assembler_ia32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698