| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 // Allocation support helpers. | 374 // Allocation support helpers. |
| 375 void LoadAllocationTopHelper(Register result, | 375 void LoadAllocationTopHelper(Register result, |
| 376 Register result_end, | 376 Register result_end, |
| 377 Register scratch, | 377 Register scratch, |
| 378 AllocationFlags flags); | 378 AllocationFlags flags); |
| 379 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 379 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
| 380 }; | 380 }; |
| 381 | 381 |
| 382 | 382 |
| 383 // The code patcher is used to patch (typically) small parts of code e.g. for | |
| 384 // debugging and other types of instrumentation. When using the code patcher | |
| 385 // the exact number of bytes specified must be emitted. Is not legal to emit | |
| 386 // relocation information. If any of these constraints are violated it causes | |
| 387 // an assertion. | |
| 388 class CodePatcher { | |
| 389 public: | |
| 390 CodePatcher(byte* address, int size); | |
| 391 virtual ~CodePatcher(); | |
| 392 | |
| 393 // Macro assembler to emit code. | |
| 394 MacroAssembler* masm() { return &masm_; } | |
| 395 | |
| 396 private: | |
| 397 byte* address_; // The address of the code being patched. | |
| 398 int size_; // Number of bytes of the expected patch size. | |
| 399 MacroAssembler masm_; // Macro assembler used to generate the code. | |
| 400 }; | |
| 401 | |
| 402 | |
| 403 // ----------------------------------------------------------------------------- | 383 // ----------------------------------------------------------------------------- |
| 404 // Static helper functions. | 384 // Static helper functions. |
| 405 | 385 |
| 406 // Generate an Operand for loading a field from an object. | 386 // Generate an Operand for loading a field from an object. |
| 407 static inline Operand FieldOperand(Register object, int offset) { | 387 static inline Operand FieldOperand(Register object, int offset) { |
| 408 return Operand(object, offset - kHeapObjectTag); | 388 return Operand(object, offset - kHeapObjectTag); |
| 409 } | 389 } |
| 410 | 390 |
| 411 | 391 |
| 412 // Generate an Operand for loading an indexed field from an object. | 392 // Generate an Operand for loading an indexed field from an object. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 436 } \ | 416 } \ |
| 437 masm-> | 417 masm-> |
| 438 #else | 418 #else |
| 439 #define ACCESS_MASM(masm) masm-> | 419 #define ACCESS_MASM(masm) masm-> |
| 440 #endif | 420 #endif |
| 441 | 421 |
| 442 | 422 |
| 443 } } // namespace v8::internal | 423 } } // namespace v8::internal |
| 444 | 424 |
| 445 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ | 425 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ |
| OLD | NEW |