| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_IA32_H_ | 5 #ifndef VM_ASSEMBLER_IA32_H_ |
| 6 #define VM_ASSEMBLER_IA32_H_ | 6 #define VM_ASSEMBLER_IA32_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
| 9 #error Do not include assembler_ia32.h directly; use assembler.h instead. | 9 #error Do not include assembler_ia32.h directly; use assembler.h instead. |
| 10 #endif | 10 #endif |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 static bool sse2_supported_; | 268 static bool sse2_supported_; |
| 269 static bool sse4_1_supported_; | 269 static bool sse4_1_supported_; |
| 270 #ifdef DEBUG | 270 #ifdef DEBUG |
| 271 static bool initialized_; | 271 static bool initialized_; |
| 272 #endif | 272 #endif |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 | 275 |
| 276 class Assembler : public ValueObject { | 276 class Assembler : public ValueObject { |
| 277 public: | 277 public: |
| 278 Assembler() : buffer_(), prolog_offset_(-1), comments_() { } | 278 Assembler() : buffer_(), prologue_offset_(-1), comments_() { } |
| 279 ~Assembler() { } | 279 ~Assembler() { } |
| 280 | 280 |
| 281 static const bool kNearJump = true; | 281 static const bool kNearJump = true; |
| 282 static const bool kFarJump = false; | 282 static const bool kFarJump = false; |
| 283 | 283 |
| 284 /* | 284 /* |
| 285 * Emit Machine Instructions. | 285 * Emit Machine Instructions. |
| 286 */ | 286 */ |
| 287 void call(Register reg); | 287 void call(Register reg); |
| 288 void call(const Address& address); | 288 void call(const Address& address); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 | 596 |
| 597 void SmiUntag(Register reg) { | 597 void SmiUntag(Register reg) { |
| 598 sarl(reg, Immediate(kSmiTagSize)); | 598 sarl(reg, Immediate(kSmiTagSize)); |
| 599 } | 599 } |
| 600 | 600 |
| 601 int PreferredLoopAlignment() { return 16; } | 601 int PreferredLoopAlignment() { return 16; } |
| 602 void Align(int alignment, int offset); | 602 void Align(int alignment, int offset); |
| 603 void Bind(Label* label); | 603 void Bind(Label* label); |
| 604 | 604 |
| 605 int CodeSize() const { return buffer_.Size(); } | 605 int CodeSize() const { return buffer_.Size(); } |
| 606 int prolog_offset() const { return prolog_offset_; } | 606 int prologue_offset() const { return prologue_offset_; } |
| 607 const ZoneGrowableArray<int>& GetPointerOffsets() const { | 607 const ZoneGrowableArray<int>& GetPointerOffsets() const { |
| 608 return buffer_.pointer_offsets(); | 608 return buffer_.pointer_offsets(); |
| 609 } | 609 } |
| 610 | 610 |
| 611 void FinalizeInstructions(const MemoryRegion& region) { | 611 void FinalizeInstructions(const MemoryRegion& region) { |
| 612 buffer_.FinalizeInstructions(region); | 612 buffer_.FinalizeInstructions(region); |
| 613 } | 613 } |
| 614 | 614 |
| 615 // Debugging and bringup support. | 615 // Debugging and bringup support. |
| 616 void Stop(const char* message); | 616 void Stop(const char* message); |
| 617 void Unimplemented(const char* message); | 617 void Unimplemented(const char* message); |
| 618 void Untested(const char* message); | 618 void Untested(const char* message); |
| 619 void Unreachable(const char* message); | 619 void Unreachable(const char* message); |
| 620 | 620 |
| 621 static void InitializeMemoryWithBreakpoints(uword data, int length); | 621 static void InitializeMemoryWithBreakpoints(uword data, int length); |
| 622 | 622 |
| 623 void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); | 623 void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3); |
| 624 const Code::Comments& GetCodeComments() const; | 624 const Code::Comments& GetCodeComments() const; |
| 625 | 625 |
| 626 static const char* RegisterName(Register reg); | 626 static const char* RegisterName(Register reg); |
| 627 static const char* XmmRegisterName(XmmRegister reg); | 627 static const char* XmmRegisterName(XmmRegister reg); |
| 628 | 628 |
| 629 private: | 629 private: |
| 630 AssemblerBuffer buffer_; | 630 AssemblerBuffer buffer_; |
| 631 int prolog_offset_; | 631 int prologue_offset_; |
| 632 | 632 |
| 633 class CodeComment : public ZoneAllocated { | 633 class CodeComment : public ZoneAllocated { |
| 634 public: | 634 public: |
| 635 CodeComment(intptr_t pc_offset, const String& comment) | 635 CodeComment(intptr_t pc_offset, const String& comment) |
| 636 : pc_offset_(pc_offset), comment_(comment) { } | 636 : pc_offset_(pc_offset), comment_(comment) { } |
| 637 | 637 |
| 638 intptr_t pc_offset() const { return pc_offset_; } | 638 intptr_t pc_offset() const { return pc_offset_; } |
| 639 const String& comment() const { return comment_; } | 639 const String& comment() const { return comment_; } |
| 640 | 640 |
| 641 private: | 641 private: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 697 } |
| 698 | 698 |
| 699 | 699 |
| 700 inline void Assembler::EmitOperandSizeOverride() { | 700 inline void Assembler::EmitOperandSizeOverride() { |
| 701 EmitUint8(0x66); | 701 EmitUint8(0x66); |
| 702 } | 702 } |
| 703 | 703 |
| 704 } // namespace dart | 704 } // namespace dart |
| 705 | 705 |
| 706 #endif // VM_ASSEMBLER_IA32_H_ | 706 #endif // VM_ASSEMBLER_IA32_H_ |
| OLD | NEW |