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

Unified Diff: courgette/assembly_program.h

Issue 6588104: Merge 76320 - Implementation of an STL compatible allocator for Courgette on ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/648/src/
Patch Set: Created 9 years, 10 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 | « courgette/adjustment_method_2.cc ('k') | courgette/courgette.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: courgette/assembly_program.h
===================================================================
--- courgette/assembly_program.h (revision 76470)
+++ courgette/assembly_program.h (working copy)
@@ -12,12 +12,16 @@
#include "base/basictypes.h"
#include "courgette/image_info.h"
+#include "courgette/memory_allocator.h"
namespace courgette {
class EncodedProgram;
class Instruction;
+typedef std::vector<Instruction*, MemoryAllocator<Instruction*> >
+ InstructionVector;
+
// A Label is a symbolic reference to an address. Unlike a conventional
// assembly language, we always know the address. The address will later be
// stored in a table and the Label will be replaced with the index into the
@@ -89,7 +93,7 @@
EncodedProgram* Encode() const;
// Accessor for instruction list.
- const std::vector<Instruction*>& instructions() const {
+ const InstructionVector& instructions() const {
return instructions_;
}
@@ -101,7 +105,6 @@
// otherwise returns NULL.
Label* InstructionRel32Label(const Instruction* instruction) const;
-
private:
void Emit(Instruction* instruction) { instructions_.push_back(instruction); }
@@ -118,7 +121,7 @@
uint64 image_base_; // Desired or mandated base address of image.
- std::vector<Instruction*> instructions_; // All the instructions in program.
+ InstructionVector instructions_; // All the instructions in program.
// These are lookup maps to find the label associated with a given address.
// We have separate label spaces for addresses referenced by rel32 labels and
« no previous file with comments | « courgette/adjustment_method_2.cc ('k') | courgette/courgette.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698