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_X87_MACRO_ASSEMBLER_X87_H_ | 5 #ifndef V8_X87_MACRO_ASSEMBLER_X87_H_ |
6 #define V8_X87_MACRO_ASSEMBLER_X87_H_ | 6 #define V8_X87_MACRO_ASSEMBLER_X87_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/frames.h" | 10 #include "src/frames.h" |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 | 972 |
973 | 973 |
974 // The code patcher is used to patch (typically) small parts of code e.g. for | 974 // The code patcher is used to patch (typically) small parts of code e.g. for |
975 // debugging and other types of instrumentation. When using the code patcher | 975 // debugging and other types of instrumentation. When using the code patcher |
976 // the exact number of bytes specified must be emitted. Is not legal to emit | 976 // the exact number of bytes specified must be emitted. Is not legal to emit |
977 // relocation information. If any of these constraints are violated it causes | 977 // relocation information. If any of these constraints are violated it causes |
978 // an assertion. | 978 // an assertion. |
979 class CodePatcher { | 979 class CodePatcher { |
980 public: | 980 public: |
981 CodePatcher(byte* address, int size); | 981 CodePatcher(byte* address, int size); |
982 virtual ~CodePatcher(); | 982 ~CodePatcher(); |
983 | 983 |
984 // Macro assembler to emit code. | 984 // Macro assembler to emit code. |
985 MacroAssembler* masm() { return &masm_; } | 985 MacroAssembler* masm() { return &masm_; } |
986 | 986 |
987 private: | 987 private: |
988 byte* address_; // The address of the code being patched. | 988 byte* address_; // The address of the code being patched. |
989 int size_; // Number of bytes of the expected patch size. | 989 int size_; // Number of bytes of the expected patch size. |
990 MacroAssembler masm_; // Macro assembler used to generate the code. | 990 MacroAssembler masm_; // Macro assembler used to generate the code. |
991 }; | 991 }; |
992 | 992 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 } \ | 1045 } \ |
1046 masm-> | 1046 masm-> |
1047 #else | 1047 #else |
1048 #define ACCESS_MASM(masm) masm-> | 1048 #define ACCESS_MASM(masm) masm-> |
1049 #endif | 1049 #endif |
1050 | 1050 |
1051 | 1051 |
1052 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
1053 | 1053 |
1054 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ | 1054 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ |
OLD | NEW |