OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ | 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_ |
6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ | 6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/base/flags.h" | 10 #include "src/base/flags.h" |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1646 }; | 1646 }; |
1647 | 1647 |
1648 | 1648 |
1649 // The code patcher is used to patch (typically) small parts of code e.g. for | 1649 // The code patcher is used to patch (typically) small parts of code e.g. for |
1650 // debugging and other types of instrumentation. When using the code patcher | 1650 // debugging and other types of instrumentation. When using the code patcher |
1651 // the exact number of bytes specified must be emitted. Is not legal to emit | 1651 // the exact number of bytes specified must be emitted. Is not legal to emit |
1652 // relocation information. If any of these constraints are violated it causes | 1652 // relocation information. If any of these constraints are violated it causes |
1653 // an assertion. | 1653 // an assertion. |
1654 class CodePatcher { | 1654 class CodePatcher { |
1655 public: | 1655 public: |
1656 CodePatcher(byte* address, int size); | 1656 CodePatcher(Isolate* isolate, byte* address, int size); |
1657 ~CodePatcher(); | 1657 ~CodePatcher(); |
1658 | 1658 |
1659 // Macro assembler to emit code. | 1659 // Macro assembler to emit code. |
1660 MacroAssembler* masm() { return &masm_; } | 1660 MacroAssembler* masm() { return &masm_; } |
1661 | 1661 |
1662 private: | 1662 private: |
1663 byte* address_; // The address of the code being patched. | 1663 byte* address_; // The address of the code being patched. |
1664 int size_; // Number of bytes of the expected patch size. | 1664 int size_; // Number of bytes of the expected patch size. |
1665 MacroAssembler masm_; // Macro assembler used to generate the code. | 1665 MacroAssembler masm_; // Macro assembler used to generate the code. |
1666 }; | 1666 }; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 } \ | 1732 } \ |
1733 masm-> | 1733 masm-> |
1734 #else | 1734 #else |
1735 #define ACCESS_MASM(masm) masm-> | 1735 #define ACCESS_MASM(masm) masm-> |
1736 #endif | 1736 #endif |
1737 | 1737 |
1738 } // namespace internal | 1738 } // namespace internal |
1739 } // namespace v8 | 1739 } // namespace v8 |
1740 | 1740 |
1741 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 1741 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |