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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/assembler.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/assembler.cpp - Assembler base class -------------------===// 1 //===- subzero/src/assembler.cpp - Assembler base class -------------------===//
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 // 5 //
6 // Modified by the Subzero authors. 6 // Modified by the Subzero authors.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // The Subzero Code Generator 10 // The Subzero Code Generator
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 fixups_processed_ = false; 67 fixups_processed_ = false;
68 #endif // !NDEBUG 68 #endif // !NDEBUG
69 69
70 // Verify internal state. 70 // Verify internal state.
71 assert(Capacity() == kInitialBufferCapacity); 71 assert(Capacity() == kInitialBufferCapacity);
72 assert(Size() == 0); 72 assert(Size() == 0);
73 } 73 }
74 74
75 AssemblerBuffer::~AssemblerBuffer() {} 75 AssemblerBuffer::~AssemblerBuffer() {}
76 76
77 AssemblerFixup *AssemblerBuffer::GetLatestFixup() const { 77 // Returns the latest fixup at or after the given position, or NULL if
78 if (fixups_.empty()) 78 // there is none. Assumes fixups were added in increasing order.
79 return NULL; 79 AssemblerFixup *AssemblerBuffer::GetLatestFixup(intptr_t position) const {
80 return fixups_.back(); 80 AssemblerFixup *latest_fixup = NULL;
81 for (auto I = fixups_.rbegin(), E = fixups_.rend(); I != E; ++I) {
82 if ((*I)->position() < position)
83 return latest_fixup;
84 latest_fixup = *I;
85 }
86 return latest_fixup;
81 } 87 }
82 88
83 void AssemblerBuffer::ProcessFixups(const MemoryRegion &region) { 89 void AssemblerBuffer::ProcessFixups(const MemoryRegion &region) {
84 for (SizeT I = 0; I < fixups_.size(); ++I) { 90 for (SizeT I = 0; I < fixups_.size(); ++I) {
85 AssemblerFixup *fixup = fixups_[I]; 91 AssemblerFixup *fixup = fixups_[I];
86 fixup->Process(region, fixup->position()); 92 fixup->Process(region, fixup->position());
87 } 93 }
88 } 94 }
89 95
90 void AssemblerBuffer::FinalizeInstructions(const MemoryRegion &instructions) { 96 void AssemblerBuffer::FinalizeInstructions(const MemoryRegion &instructions) {
(...skipping 30 matching lines...) Expand all
121 // Update the cursor and recompute the limit. 127 // Update the cursor and recompute the limit.
122 cursor_ += delta; 128 cursor_ += delta;
123 limit_ = ComputeLimit(new_contents, new_capacity); 129 limit_ = ComputeLimit(new_contents, new_capacity);
124 130
125 // Verify internal state. 131 // Verify internal state.
126 assert(Capacity() == new_capacity); 132 assert(Capacity() == new_capacity);
127 assert(Size() == old_size); 133 assert(Size() == old_size);
128 } 134 }
129 135
130 } // end of namespace Ice 136 } // end of namespace Ice
OLDNEW
« 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