OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // ---------------------------------------------------------------------------- | 39 // ---------------------------------------------------------------------------- |
40 // Static helper functions | 40 // Static helper functions |
41 | 41 |
42 // Generate a MemOperand for loading a field from an object. | 42 // Generate a MemOperand for loading a field from an object. |
43 static inline MemOperand FieldMemOperand(Register object, int offset) { | 43 static inline MemOperand FieldMemOperand(Register object, int offset) { |
44 return MemOperand(object, offset - kHeapObjectTag); | 44 return MemOperand(object, offset - kHeapObjectTag); |
45 } | 45 } |
46 | 46 |
47 | 47 |
| 48 static inline Operand SmiUntagOperand(Register object) { |
| 49 return Operand(object, ASR, kSmiTagSize); |
| 50 } |
| 51 |
| 52 |
| 53 |
48 // Give alias names to registers | 54 // Give alias names to registers |
49 const Register cp = { 8 }; // JavaScript context pointer | 55 const Register cp = { 8 }; // JavaScript context pointer |
50 const Register roots = { 10 }; // Roots array pointer. | 56 const Register roots = { 10 }; // Roots array pointer. |
51 | 57 |
52 enum InvokeJSFlags { | 58 enum InvokeJSFlags { |
53 CALL_JS, | 59 CALL_JS, |
54 JUMP_JS | 60 JUMP_JS |
55 }; | 61 }; |
56 | 62 |
57 | 63 |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 // an assertion to fail. | 885 // an assertion to fail. |
880 class CodePatcher { | 886 class CodePatcher { |
881 public: | 887 public: |
882 CodePatcher(byte* address, int instructions); | 888 CodePatcher(byte* address, int instructions); |
883 virtual ~CodePatcher(); | 889 virtual ~CodePatcher(); |
884 | 890 |
885 // Macro assembler to emit code. | 891 // Macro assembler to emit code. |
886 MacroAssembler* masm() { return &masm_; } | 892 MacroAssembler* masm() { return &masm_; } |
887 | 893 |
888 // Emit an instruction directly. | 894 // Emit an instruction directly. |
889 void Emit(Instr x); | 895 void Emit(Instr instr); |
890 | 896 |
891 // Emit an address directly. | 897 // Emit an address directly. |
892 void Emit(Address addr); | 898 void Emit(Address addr); |
893 | 899 |
| 900 // Emit the condition part of an instruction leaving the rest of the current |
| 901 // instruction unchanged. |
| 902 void EmitCondition(Condition cond); |
| 903 |
894 private: | 904 private: |
895 byte* address_; // The address of the code being patched. | 905 byte* address_; // The address of the code being patched. |
896 int instructions_; // Number of instructions of the expected patch size. | 906 int instructions_; // Number of instructions of the expected patch size. |
897 int size_; // Number of bytes of the expected patch size. | 907 int size_; // Number of bytes of the expected patch size. |
898 MacroAssembler masm_; // Macro assembler used to generate the code. | 908 MacroAssembler masm_; // Macro assembler used to generate the code. |
899 }; | 909 }; |
900 #endif // ENABLE_DEBUGGER_SUPPORT | 910 #endif // ENABLE_DEBUGGER_SUPPORT |
901 | 911 |
902 | 912 |
903 // Helper class for generating code or data associated with the code | 913 // Helper class for generating code or data associated with the code |
(...skipping 26 matching lines...) Expand all Loading... |
930 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) | 940 #define __FILE_LINE__ __FILE__ ":" CODE_COVERAGE_TOSTRING(__LINE__) |
931 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> | 941 #define ACCESS_MASM(masm) masm->stop(__FILE_LINE__); masm-> |
932 #else | 942 #else |
933 #define ACCESS_MASM(masm) masm-> | 943 #define ACCESS_MASM(masm) masm-> |
934 #endif | 944 #endif |
935 | 945 |
936 | 946 |
937 } } // namespace v8::internal | 947 } } // namespace v8::internal |
938 | 948 |
939 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ | 949 #endif // V8_ARM_MACRO_ASSEMBLER_ARM_H_ |
OLD | NEW |