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

Unified Diff: src/assembler.cpp

Issue 693393002: Subzero: Support multiple fixups in one instruction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add the original test source in a comment Created 6 years, 1 month 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.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cpp
diff --git a/src/assembler.cpp b/src/assembler.cpp
index 6f2ec8118c92545f98bdbdefc21853828eb820d6..6099d71528e57f2de840c178a5b3e757bc4b0fd2 100644
--- a/src/assembler.cpp
+++ b/src/assembler.cpp
@@ -74,10 +74,16 @@ AssemblerBuffer::AssemblerBuffer(Assembler &assembler) : assembler_(assembler) {
AssemblerBuffer::~AssemblerBuffer() {}
-AssemblerFixup *AssemblerBuffer::GetLatestFixup() const {
- if (fixups_.empty())
- return NULL;
- return fixups_.back();
+// Returns the latest fixup at or after the given position, or NULL if
+// there is none. Assumes fixups were added in increasing order.
+AssemblerFixup *AssemblerBuffer::GetLatestFixup(intptr_t position) const {
+ AssemblerFixup *latest_fixup = NULL;
+ for (auto I = fixups_.rbegin(), E = fixups_.rend(); I != E; ++I) {
+ if ((*I)->position() < position)
+ return latest_fixup;
+ latest_fixup = *I;
+ }
+ return latest_fixup;
}
void AssemblerBuffer::ProcessFixups(const MemoryRegion &region) {
« no previous file with comments | « src/assembler.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698