summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-06-16 11:32:01 +0000
committer Vladimir Marko <vmarko@google.com> 2015-06-16 11:32:01 +0000
commitfbeb4aede0ddc5b1e6a5a3a40cc6266fe8518c98 (patch)
tree76ab28cf259def4dccec529df217fd760f27d2aa /compiler/utils/assembler.h
parentf38caa68cce551fb153dff37d01db518e58ed00f (diff)
Revert "ART: Implement literal pool for arm, fix branch fixup."
This reverts commit f38caa68cce551fb153dff37d01db518e58ed00f. Change-Id: Id88b82cc949d288cfcdb3c401b96f884b777fc40 Reason: broke the tests.
Diffstat (limited to 'compiler/utils/assembler.h')
-rw-r--r--compiler/utils/assembler.h25
1 files changed, 10 insertions, 15 deletions
diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h
index 0381af3956..672e1503be 100644
--- a/compiler/utils/assembler.h
+++ b/compiler/utils/assembler.h
@@ -199,18 +199,13 @@ class AssemblerBuffer {
*reinterpret_cast<T*>(contents_ + position) = value;
}
- void Resize(size_t new_size) {
- if (new_size > Capacity()) {
- ExtendCapacity(new_size);
- }
- cursor_ = contents_ + new_size;
- }
-
- void Move(size_t newposition, size_t oldposition, size_t size) {
- // Move a chunk of the buffer from oldposition to newposition.
- DCHECK_LE(oldposition + size, Size());
- DCHECK_LE(newposition + size, Size());
- memmove(contents_ + newposition, contents_ + oldposition, size);
+ void Move(size_t newposition, size_t oldposition) {
+ CHECK(HasEnsuredCapacity());
+ // Move the contents of the buffer from oldposition to
+ // newposition by nbytes.
+ size_t nbytes = Size() - oldposition;
+ memmove(contents_ + newposition, contents_ + oldposition, nbytes);
+ cursor_ += newposition - oldposition;
}
// Emit a fixup at the current location.
@@ -355,7 +350,7 @@ class AssemblerBuffer {
return data + capacity - kMinimumGap;
}
- void ExtendCapacity(size_t min_capacity = 0u);
+ void ExtendCapacity();
friend class AssemblerFixup;
};
@@ -381,8 +376,8 @@ class Assembler {
public:
static Assembler* Create(InstructionSet instruction_set);
- // Finalize the code; emit slow paths, fixup branches, add literal pool, etc.
- virtual void FinalizeCode() { buffer_.EmitSlowPaths(this); }
+ // Emit slow paths queued during assembly
+ virtual void EmitSlowPaths() { buffer_.EmitSlowPaths(this); }
// Size of generated code
virtual size_t CodeSize() const { return buffer_.Size(); }