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

Side by Side Diff: runtime/vm/assembler_x64.h

Issue 12260026: Add support for object pool (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_ASSEMBLER_X64_H_ 5 #ifndef VM_ASSEMBLER_X64_H_
6 #define VM_ASSEMBLER_X64_H_ 6 #define VM_ASSEMBLER_X64_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_x64.h directly; use assembler.h instead. 9 #error Do not include assembler_x64.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 305
306 static bool sse4_1_supported_; 306 static bool sse4_1_supported_;
307 #ifdef DEBUG 307 #ifdef DEBUG
308 static bool initialized_; 308 static bool initialized_;
309 #endif 309 #endif
310 }; 310 };
311 311
312 312
313 class Assembler : public ValueObject { 313 class Assembler : public ValueObject {
314 public: 314 public:
315 Assembler() : buffer_(), prologue_offset_(-1), comments_() { } 315 Assembler()
316 : buffer_(),
317 object_pool_(GrowableObjectArray::Handle()),
318 prologue_offset_(-1),
319 comments_() { }
316 ~Assembler() { } 320 ~Assembler() { }
317 321
318 static const bool kNearJump = true; 322 static const bool kNearJump = true;
319 static const bool kFarJump = false; 323 static const bool kFarJump = false;
320 324
321 /* 325 /*
322 * Emit Machine Instructions. 326 * Emit Machine Instructions.
323 */ 327 */
324 void call(Register reg); 328 void call(Register reg);
325 void call(const Address& address); 329 void call(const Address& address);
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 void Bind(Label* label); 689 void Bind(Label* label);
686 690
687 void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); 691 void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
688 const Code::Comments& GetCodeComments() const; 692 const Code::Comments& GetCodeComments() const;
689 693
690 int CodeSize() const { return buffer_.Size(); } 694 int CodeSize() const { return buffer_.Size(); }
691 int prologue_offset() const { return prologue_offset_; } 695 int prologue_offset() const { return prologue_offset_; }
692 const ZoneGrowableArray<int>& GetPointerOffsets() const { 696 const ZoneGrowableArray<int>& GetPointerOffsets() const {
693 return buffer_.pointer_offsets(); 697 return buffer_.pointer_offsets();
694 } 698 }
699 const GrowableObjectArray& object_pool() const { return object_pool_; }
695 700
696 void FinalizeInstructions(const MemoryRegion& region) { 701 void FinalizeInstructions(const MemoryRegion& region) {
697 buffer_.FinalizeInstructions(region); 702 buffer_.FinalizeInstructions(region);
698 } 703 }
699 704
700 // Debugging and bringup support. 705 // Debugging and bringup support.
701 void Stop(const char* message); 706 void Stop(const char* message);
702 void Unimplemented(const char* message); 707 void Unimplemented(const char* message);
703 void Untested(const char* message); 708 void Untested(const char* message);
704 void Unreachable(const char* message); 709 void Unreachable(const char* message);
705 710
706 static void InitializeMemoryWithBreakpoints(uword data, int length); 711 static void InitializeMemoryWithBreakpoints(uword data, int length);
707 712
708 static const char* RegisterName(Register reg); 713 static const char* RegisterName(Register reg);
709 714
710 static const char* FpuRegisterName(FpuRegister reg); 715 static const char* FpuRegisterName(FpuRegister reg);
711 716
712 private: 717 private:
713 AssemblerBuffer buffer_; 718 AssemblerBuffer buffer_;
719 GrowableObjectArray& object_pool_; // Object pool is not used on x64.
714 int prologue_offset_; 720 int prologue_offset_;
715 721
716 class CodeComment : public ZoneAllocated { 722 class CodeComment : public ZoneAllocated {
717 public: 723 public:
718 CodeComment(intptr_t pc_offset, const String& comment) 724 CodeComment(intptr_t pc_offset, const String& comment)
719 : pc_offset_(pc_offset), comment_(comment) { } 725 : pc_offset_(pc_offset), comment_(comment) { }
720 726
721 intptr_t pc_offset() const { return pc_offset_; } 727 intptr_t pc_offset() const { return pc_offset_; }
722 const String& comment() const { return comment_; } 728 const String& comment() const { return comment_; }
723 729
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 846 }
841 847
842 848
843 inline void Assembler::EmitOperandSizeOverride() { 849 inline void Assembler::EmitOperandSizeOverride() {
844 EmitUint8(0x66); 850 EmitUint8(0x66);
845 } 851 }
846 852
847 } // namespace dart 853 } // namespace dart
848 854
849 #endif // VM_ASSEMBLER_X64_H_ 855 #endif // VM_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698