Chromium Code Reviews| Index: runtime/vm/assembler_arm.h |
| =================================================================== |
| --- runtime/vm/assembler_arm.h (revision 18162) |
| +++ runtime/vm/assembler_arm.h (working copy) |
| @@ -262,7 +262,11 @@ |
| class Assembler : public ValueObject { |
| public: |
| - Assembler() : buffer_(), prologue_offset_(-1), comments_() { } |
| + Assembler() |
| + : buffer_(), |
| + objects_(GrowableObjectArray::ZoneHandle(GrowableObjectArray::New())), |
|
Ivan Posva
2013/02/06 23:33:50
object_pool_
regis
2013/02/07 00:53:24
Done. Also changed from ZoneHandle to Handle.
|
| + prologue_offset_(-1), |
| + comments_() { } |
| ~Assembler() { } |
| void PopRegister(Register r) { Pop(r); } |
| @@ -273,11 +277,16 @@ |
| int CodeSize() const { return buffer_.Size(); } |
| int prologue_offset() const { return prologue_offset_; } |
| const ZoneGrowableArray<int>& GetPointerOffsets() const { |
| + ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code. |
| return buffer_.pointer_offsets(); |
| } |
| + const GrowableObjectArray& GetObjects() const { |
| + return objects_; |
| + } |
| void FinalizeInstructions(const MemoryRegion& region) { |
| buffer_.FinalizeInstructions(region); |
| + ASSERT(objects_.Length() == 0); // TODO(regis): Otherwise, more work. |
| } |
| // Debugging and bringup support. |
| @@ -286,9 +295,7 @@ |
| void Untested(const char* message); |
| void Unreachable(const char* message); |
| - static void InitializeMemoryWithBreakpoints(uword data, int length) { |
| - UNIMPLEMENTED(); |
| - } |
| + static void InitializeMemoryWithBreakpoints(uword data, int length); |
| void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
| @@ -525,10 +532,13 @@ |
| void Emit(int32_t value); |
| private: |
| - AssemblerBuffer buffer_; |
| - ZoneGrowableArray<int>* pointer_offsets_; |
| - int prologue_offset_; |
| + AssemblerBuffer buffer_; // Contains position independent code. |
| + const GrowableObjectArray& objects_; // Contains objects and jump targets. |
| + int32_t prologue_offset_; |
| + int32_t AddObject(const Object& obj); |
| + int32_t AddExternalLabel(const ExternalLabel* label); |
| + |
| class CodeComment : public ZoneAllocated { |
| public: |
| CodeComment(intptr_t pc_offset, const String& comment) |