OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 331 |
332 // Allocation support helpers. | 332 // Allocation support helpers. |
333 void LoadAllocationTopHelper(Register result, | 333 void LoadAllocationTopHelper(Register result, |
334 Register result_end, | 334 Register result_end, |
335 Register scratch, | 335 Register scratch, |
336 AllocationFlags flags); | 336 AllocationFlags flags); |
337 void UpdateAllocationTopHelper(Register result_end, Register scratch); | 337 void UpdateAllocationTopHelper(Register result_end, Register scratch); |
338 }; | 338 }; |
339 | 339 |
340 | 340 |
341 #ifdef ENABLE_DEBUGGER_SUPPORT | |
342 // The code patcher is used to patch (typically) small parts of code e.g. for | 341 // The code patcher is used to patch (typically) small parts of code e.g. for |
343 // debugging and other types of instrumentation. When using the code patcher | 342 // debugging and other types of instrumentation. When using the code patcher |
344 // the exact number of bytes specified must be emitted. Is not legal to emit | 343 // the exact number of bytes specified must be emitted. Is not legal to emit |
345 // relocation information. If any of these constraints are violated it causes | 344 // relocation information. If any of these constraints are violated it causes |
346 // an assertion. | 345 // an assertion. |
347 class CodePatcher { | 346 class CodePatcher { |
348 public: | 347 public: |
349 CodePatcher(byte* address, int size); | 348 CodePatcher(byte* address, int size); |
350 virtual ~CodePatcher(); | 349 virtual ~CodePatcher(); |
351 | 350 |
352 // Macro assembler to emit code. | 351 // Macro assembler to emit code. |
353 MacroAssembler* masm() { return &masm_; } | 352 MacroAssembler* masm() { return &masm_; } |
354 | 353 |
355 private: | 354 private: |
356 byte* address_; // The address of the code being patched. | 355 byte* address_; // The address of the code being patched. |
357 int size_; // Number of bytes of the expected patch size. | 356 int size_; // Number of bytes of the expected patch size. |
358 MacroAssembler masm_; // Macro assembler used to generate the code. | 357 MacroAssembler masm_; // Macro assembler used to generate the code. |
359 }; | 358 }; |
360 #endif // ENABLE_DEBUGGER_SUPPORT | |
361 | 359 |
362 | 360 |
363 // ----------------------------------------------------------------------------- | 361 // ----------------------------------------------------------------------------- |
364 // Static helper functions. | 362 // Static helper functions. |
365 | 363 |
366 // Generate an Operand for loading a field from an object. | 364 // Generate an Operand for loading a field from an object. |
367 static inline Operand FieldOperand(Register object, int offset) { | 365 static inline Operand FieldOperand(Register object, int offset) { |
368 return Operand(object, offset - kHeapObjectTag); | 366 return Operand(object, offset - kHeapObjectTag); |
369 } | 367 } |
370 | 368 |
(...skipping 25 matching lines...) Expand all Loading... |
396 } \ | 394 } \ |
397 masm-> | 395 masm-> |
398 #else | 396 #else |
399 #define ACCESS_MASM(masm) masm-> | 397 #define ACCESS_MASM(masm) masm-> |
400 #endif | 398 #endif |
401 | 399 |
402 | 400 |
403 } } // namespace v8::internal | 401 } } // namespace v8::internal |
404 | 402 |
405 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 403 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |