| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 static const int kSmiConstantRegisterValue = 1; | 54 static const int kSmiConstantRegisterValue = 1; |
| 55 // Actual value of root register is offset from the root array's start | 55 // Actual value of root register is offset from the root array's start |
| 56 // to take advantage of negitive 8-bit displacement values. | 56 // to take advantage of negitive 8-bit displacement values. |
| 57 static const int kRootRegisterBias = 128; | 57 static const int kRootRegisterBias = 128; |
| 58 | 58 |
| 59 // Convenience for platform-independent signatures. | 59 // Convenience for platform-independent signatures. |
| 60 typedef Operand MemOperand; | 60 typedef Operand MemOperand; |
| 61 | 61 |
| 62 // Forward declaration. | 62 // Forward declaration. |
| 63 class JumpTarget; | 63 class JumpTarget; |
| 64 class CallWrapper; | |
| 65 | 64 |
| 66 struct SmiIndex { | 65 struct SmiIndex { |
| 67 SmiIndex(Register index_register, ScaleFactor scale) | 66 SmiIndex(Register index_register, ScaleFactor scale) |
| 68 : reg(index_register), | 67 : reg(index_register), |
| 69 scale(scale) {} | 68 scale(scale) {} |
| 70 Register reg; | 69 Register reg; |
| 71 ScaleFactor scale; | 70 ScaleFactor scale; |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 // MacroAssembler implements a collection of frequently used macros. | 73 // MacroAssembler implements a collection of frequently used macros. |
| (...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 // Macro assembler to emit code. | 1184 // Macro assembler to emit code. |
| 1186 MacroAssembler* masm() { return &masm_; } | 1185 MacroAssembler* masm() { return &masm_; } |
| 1187 | 1186 |
| 1188 private: | 1187 private: |
| 1189 byte* address_; // The address of the code being patched. | 1188 byte* address_; // The address of the code being patched. |
| 1190 int size_; // Number of bytes of the expected patch size. | 1189 int size_; // Number of bytes of the expected patch size. |
| 1191 MacroAssembler masm_; // Macro assembler used to generate the code. | 1190 MacroAssembler masm_; // Macro assembler used to generate the code. |
| 1192 }; | 1191 }; |
| 1193 | 1192 |
| 1194 | 1193 |
| 1195 // Helper class for generating code or data associated with the code | |
| 1196 // right before or after a call instruction. As an example this can be used to | |
| 1197 // generate safepoint data after calls for crankshaft. | |
| 1198 class CallWrapper { | |
| 1199 public: | |
| 1200 CallWrapper() { } | |
| 1201 virtual ~CallWrapper() { } | |
| 1202 // Called just before emitting a call. Argument is the size of the generated | |
| 1203 // call code. | |
| 1204 virtual void BeforeCall(int call_size) = 0; | |
| 1205 // Called just after emitting a call, i.e., at the return site for the call. | |
| 1206 virtual void AfterCall() = 0; | |
| 1207 }; | |
| 1208 | |
| 1209 | |
| 1210 // ----------------------------------------------------------------------------- | 1194 // ----------------------------------------------------------------------------- |
| 1211 // Static helper functions. | 1195 // Static helper functions. |
| 1212 | 1196 |
| 1213 // Generate an Operand for loading a field from an object. | 1197 // Generate an Operand for loading a field from an object. |
| 1214 static inline Operand FieldOperand(Register object, int offset) { | 1198 static inline Operand FieldOperand(Register object, int offset) { |
| 1215 return Operand(object, offset - kHeapObjectTag); | 1199 return Operand(object, offset - kHeapObjectTag); |
| 1216 } | 1200 } |
| 1217 | 1201 |
| 1218 | 1202 |
| 1219 // Generate an Operand for loading an indexed field from an object. | 1203 // Generate an Operand for loading an indexed field from an object. |
| (...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 Jump(adaptor, RelocInfo::CODE_TARGET); | 1993 Jump(adaptor, RelocInfo::CODE_TARGET); |
| 2010 } | 1994 } |
| 2011 bind(&invoke); | 1995 bind(&invoke); |
| 2012 } | 1996 } |
| 2013 } | 1997 } |
| 2014 | 1998 |
| 2015 | 1999 |
| 2016 } } // namespace v8::internal | 2000 } } // namespace v8::internal |
| 2017 | 2001 |
| 2018 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 2002 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |