| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 // Macro assembler to emit code. | 308 // Macro assembler to emit code. |
| 309 MacroAssembler* masm() { return &masm_; } | 309 MacroAssembler* masm() { return &masm_; } |
| 310 | 310 |
| 311 private: | 311 private: |
| 312 byte* address_; // The address of the code being patched. | 312 byte* address_; // The address of the code being patched. |
| 313 int size_; // Number of bytes of the expected patch size. | 313 int size_; // Number of bytes of the expected patch size. |
| 314 MacroAssembler masm_; // Macro assembler used to generate the code. | 314 MacroAssembler masm_; // Macro assembler used to generate the code. |
| 315 }; | 315 }; |
| 316 | 316 |
| 317 |
| 317 // ----------------------------------------------------------------------------- | 318 // ----------------------------------------------------------------------------- |
| 318 // Static helper functions. | 319 // Static helper functions. |
| 319 | 320 |
| 320 // Generate an Operand for loading a field from an object. | 321 // Generate an Operand for loading a field from an object. |
| 321 static inline Operand FieldOperand(Register object, int offset) { | 322 static inline Operand FieldOperand(Register object, int offset) { |
| 322 return Operand(object, offset - kHeapObjectTag); | 323 return Operand(object, offset - kHeapObjectTag); |
| 323 } | 324 } |
| 324 | 325 |
| 325 | 326 |
| 326 // Generate an Operand for loading an indexed field from an object. | 327 // Generate an Operand for loading an indexed field from an object. |
| 327 static inline Operand FieldOperand(Register object, | 328 static inline Operand FieldOperand(Register object, |
| 328 Register index, | 329 Register index, |
| 329 ScaleFactor scale, | 330 ScaleFactor scale, |
| 330 int offset) { | 331 int offset) { |
| 331 return Operand(object, index, scale, offset - kHeapObjectTag); | 332 return Operand(object, index, scale, offset - kHeapObjectTag); |
| 332 } | 333 } |
| 333 | 334 |
| 334 } } // namespace v8::internal | 335 } } // namespace v8::internal |
| 335 | 336 |
| 336 #endif // V8_MACRO_ASSEMBLER_IA32_H_ | 337 #endif // V8_MACRO_ASSEMBLER_IA32_H_ |
| OLD | NEW |