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_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 friend class StandardFrame; | 922 friend class StandardFrame; |
923 }; | 923 }; |
924 | 924 |
925 // The code patcher is used to patch (typically) small parts of code e.g. for | 925 // The code patcher is used to patch (typically) small parts of code e.g. for |
926 // debugging and other types of instrumentation. When using the code patcher | 926 // debugging and other types of instrumentation. When using the code patcher |
927 // the exact number of bytes specified must be emitted. Is not legal to emit | 927 // the exact number of bytes specified must be emitted. Is not legal to emit |
928 // relocation information. If any of these constraints are violated it causes | 928 // relocation information. If any of these constraints are violated it causes |
929 // an assertion. | 929 // an assertion. |
930 class CodePatcher { | 930 class CodePatcher { |
931 public: | 931 public: |
932 CodePatcher(byte* address, int size); | 932 CodePatcher(Isolate* isolate, byte* address, int size); |
933 ~CodePatcher(); | 933 ~CodePatcher(); |
934 | 934 |
935 // Macro assembler to emit code. | 935 // Macro assembler to emit code. |
936 MacroAssembler* masm() { return &masm_; } | 936 MacroAssembler* masm() { return &masm_; } |
937 | 937 |
938 private: | 938 private: |
939 byte* address_; // The address of the code being patched. | 939 byte* address_; // The address of the code being patched. |
940 int size_; // Number of bytes of the expected patch size. | 940 int size_; // Number of bytes of the expected patch size. |
941 MacroAssembler masm_; // Macro assembler used to generate the code. | 941 MacroAssembler masm_; // Macro assembler used to generate the code. |
942 }; | 942 }; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 } \ | 991 } \ |
992 masm-> | 992 masm-> |
993 #else | 993 #else |
994 #define ACCESS_MASM(masm) masm-> | 994 #define ACCESS_MASM(masm) masm-> |
995 #endif | 995 #endif |
996 | 996 |
997 } // namespace internal | 997 } // namespace internal |
998 } // namespace v8 | 998 } // namespace v8 |
999 | 999 |
1000 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1000 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |