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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 }; | 997 }; |
998 | 998 |
999 | 999 |
1000 // The code patcher is used to patch (typically) small parts of code e.g. for | 1000 // The code patcher is used to patch (typically) small parts of code e.g. for |
1001 // debugging and other types of instrumentation. When using the code patcher | 1001 // debugging and other types of instrumentation. When using the code patcher |
1002 // the exact number of bytes specified must be emitted. Is not legal to emit | 1002 // the exact number of bytes specified must be emitted. Is not legal to emit |
1003 // relocation information. If any of these constraints are violated it causes | 1003 // relocation information. If any of these constraints are violated it causes |
1004 // an assertion. | 1004 // an assertion. |
1005 class CodePatcher { | 1005 class CodePatcher { |
1006 public: | 1006 public: |
1007 CodePatcher(byte* address, int size); | 1007 CodePatcher(Isolate* isolate, byte* address, int size); |
1008 ~CodePatcher(); | 1008 ~CodePatcher(); |
1009 | 1009 |
1010 // Macro assembler to emit code. | 1010 // Macro assembler to emit code. |
1011 MacroAssembler* masm() { return &masm_; } | 1011 MacroAssembler* masm() { return &masm_; } |
1012 | 1012 |
1013 private: | 1013 private: |
1014 byte* address_; // The address of the code being patched. | 1014 byte* address_; // The address of the code being patched. |
1015 int size_; // Number of bytes of the expected patch size. | 1015 int size_; // Number of bytes of the expected patch size. |
1016 MacroAssembler masm_; // Macro assembler used to generate the code. | 1016 MacroAssembler masm_; // Macro assembler used to generate the code. |
1017 }; | 1017 }; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 masm-> | 1077 masm-> |
1078 #else | 1078 #else |
1079 #define ACCESS_MASM(masm) masm-> | 1079 #define ACCESS_MASM(masm) masm-> |
1080 #endif | 1080 #endif |
1081 | 1081 |
1082 | 1082 |
1083 } // namespace internal | 1083 } // namespace internal |
1084 } // namespace v8 | 1084 } // namespace v8 |
1085 | 1085 |
1086 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ | 1086 #endif // V8_X87_MACRO_ASSEMBLER_X87_H_ |
OLD | NEW |