| 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 // TODO(vitalyr): the assembler does not need an isolate. | 488 Assembler(Isolate* isolate, void* buffer, int buffer_size) |
| 489 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); |
| 490 virtual ~Assembler() { } | 491 virtual ~Assembler() { } |
| 491 | 492 |
| 492 // GetCode emits any pending (non-emitted) code and fills the descriptor | 493 // GetCode emits any pending (non-emitted) code and fills the descriptor |
| 493 // 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 |
| 494 // Assembler functions are invoked in between GetCode() calls. | 495 // Assembler functions are invoked in between GetCode() calls. |
| 495 void GetCode(CodeDesc* desc); | 496 void GetCode(CodeDesc* desc); |
| 496 | 497 |
| 497 // Read/Modify the code target in the branch/call instruction at pc. | 498 // Read/Modify the code target in the branch/call instruction at pc. |
| 499 // The isolate argument is unused (and may be nullptr) when skipping flushing. |
| 498 inline static Address target_address_at(Address pc, Address constant_pool); | 500 inline static Address target_address_at(Address pc, Address constant_pool); |
| 499 inline static void set_target_address_at( | 501 inline static void set_target_address_at( |
| 500 Isolate* isolate, Address pc, Address constant_pool, Address target, | 502 Isolate* isolate, Address pc, Address constant_pool, Address target, |
| 501 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 503 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
| 502 static inline Address target_address_at(Address pc, Code* code); | 504 static inline Address target_address_at(Address pc, Code* code); |
| 503 static inline void set_target_address_at( | 505 static inline void set_target_address_at( |
| 504 Isolate* isolate, Address pc, Code* code, Address target, | 506 Isolate* isolate, Address pc, Code* code, Address target, |
| 505 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 507 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
| 506 | 508 |
| 507 // Return the code target address at a call site from the return address | 509 // Return the code target address at a call site from the return address |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1666 Assembler* assembler_; | 1668 Assembler* assembler_; |
| 1667 #ifdef DEBUG | 1669 #ifdef DEBUG |
| 1668 int space_before_; | 1670 int space_before_; |
| 1669 #endif | 1671 #endif |
| 1670 }; | 1672 }; |
| 1671 | 1673 |
| 1672 } // namespace internal | 1674 } // namespace internal |
| 1673 } // namespace v8 | 1675 } // namespace v8 |
| 1674 | 1676 |
| 1675 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1677 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |