OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 // for a detailed comment on the layout (globals.h). | 478 // for a detailed comment on the layout (globals.h). |
479 // | 479 // |
480 // If the provided buffer is NULL, the assembler allocates and grows its own | 480 // If the provided buffer is NULL, the assembler allocates and grows its own |
481 // buffer, and buffer_size determines the initial buffer size. The buffer is | 481 // buffer, and buffer_size determines the initial buffer size. The buffer is |
482 // owned by the assembler and deallocated upon destruction of the assembler. | 482 // owned by the assembler and deallocated upon destruction of the assembler. |
483 // | 483 // |
484 // If the provided buffer is not NULL, the assembler uses the provided buffer | 484 // If the provided buffer is not NULL, the assembler uses the provided buffer |
485 // for code generation and assumes its size to be buffer_size. If the buffer | 485 // for code generation and assumes its size to be buffer_size. If the buffer |
486 // is too small, a fatal error occurs. No deallocation of the buffer is done | 486 // is too small, a fatal error occurs. No deallocation of the buffer is done |
487 // upon destruction of the assembler. | 487 // upon destruction of the assembler. |
488 Assembler(Isolate* isolate, void* buffer, int buffer_size); | 488 Assembler(Isolate* isolate, void* buffer, int buffer_size) |
| 489 : Assembler(IsolateData(isolate), buffer, buffer_size) {} |
| 490 Assembler(IsolateData isolate_data, void* buffer, int buffer_size); |
489 virtual ~Assembler() { } | 491 virtual ~Assembler() { } |
490 | 492 |
491 // GetCode emits any pending (non-emitted) code and fills the descriptor | 493 // GetCode emits any pending (non-emitted) code and fills the descriptor |
492 // desc. GetCode() is idempotent; it returns the same result if no other | 494 // desc. GetCode() is idempotent; it returns the same result if no other |
493 // Assembler functions are invoked in between GetCode() calls. | 495 // Assembler functions are invoked in between GetCode() calls. |
494 void GetCode(CodeDesc* desc); | 496 void GetCode(CodeDesc* desc); |
495 | 497 |
496 // Read/Modify the code target in the relative branch/call instruction at pc. | 498 // Read/Modify the code target in the relative branch/call instruction at pc. |
497 // On the x64 architecture, we use relative jumps with a 32-bit displacement | 499 // On the x64 architecture, we use relative jumps with a 32-bit displacement |
498 // to jump to other Code objects in the Code space in the heap. | 500 // to jump to other Code objects in the Code space in the heap. |
499 // Jumps to C functions are done indirectly through a 64-bit register holding | 501 // Jumps to C functions are done indirectly through a 64-bit register holding |
500 // the absolute address of the target. | 502 // the absolute address of the target. |
501 // These functions convert between absolute Addresses of Code objects and | 503 // These functions convert between absolute Addresses of Code objects and |
502 // the relative displacements stored in the code. | 504 // the relative displacements stored in the code. |
| 505 // The isolate argument is unused (and may be nullptr) when skipping flushing. |
503 static inline Address target_address_at(Address pc, Address constant_pool); | 506 static inline Address target_address_at(Address pc, Address constant_pool); |
504 static inline void set_target_address_at( | 507 static inline void set_target_address_at( |
505 Isolate* isolate, Address pc, Address constant_pool, Address target, | 508 Isolate* isolate, Address pc, Address constant_pool, Address target, |
506 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 509 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
507 static inline Address target_address_at(Address pc, Code* code); | 510 static inline Address target_address_at(Address pc, Code* code); |
508 static inline void set_target_address_at( | 511 static inline void set_target_address_at( |
509 Isolate* isolate, Address pc, Code* code, Address target, | 512 Isolate* isolate, Address pc, Code* code, Address target, |
510 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 513 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
511 | 514 |
512 // Return the code target address at a call site from the return address | 515 // Return the code target address at a call site from the return address |
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2516 Assembler* assembler_; | 2519 Assembler* assembler_; |
2517 #ifdef DEBUG | 2520 #ifdef DEBUG |
2518 int space_before_; | 2521 int space_before_; |
2519 #endif | 2522 #endif |
2520 }; | 2523 }; |
2521 | 2524 |
2522 } // namespace internal | 2525 } // namespace internal |
2523 } // namespace v8 | 2526 } // namespace v8 |
2524 | 2527 |
2525 #endif // V8_X64_ASSEMBLER_X64_H_ | 2528 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |