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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // for a detailed comment on the layout (globals.h). | 476 // for a detailed comment on the layout (globals.h). |
477 // | 477 // |
478 // If the provided buffer is NULL, the assembler allocates and grows its own | 478 // If the provided buffer is NULL, the assembler allocates and grows its own |
479 // buffer, and buffer_size determines the initial buffer size. The buffer is | 479 // buffer, and buffer_size determines the initial buffer size. The buffer is |
480 // owned by the assembler and deallocated upon destruction of the assembler. | 480 // owned by the assembler and deallocated upon destruction of the assembler. |
481 // | 481 // |
482 // If the provided buffer is not NULL, the assembler uses the provided buffer | 482 // If the provided buffer is not NULL, the assembler uses the provided buffer |
483 // for code generation and assumes its size to be buffer_size. If the buffer | 483 // for code generation and assumes its size to be buffer_size. If the buffer |
484 // is too small, a fatal error occurs. No deallocation of the buffer is done | 484 // is too small, a fatal error occurs. No deallocation of the buffer is done |
485 // upon destruction of the assembler. | 485 // upon destruction of the assembler. |
486 // TODO(vitalyr): the assembler does not need an isolate. | 486 Assembler(Isolate* isolate, void* buffer, int buffer_size) |
487 Assembler(Isolate* isolate, void* buffer, int buffer_size); | 487 : Assembler(IsolateData(isolate), buffer, buffer_size) {} |
| 488 Assembler(IsolateData isolate_data, void* buffer, int buffer_size); |
488 virtual ~Assembler() { } | 489 virtual ~Assembler() { } |
489 | 490 |
490 // GetCode emits any pending (non-emitted) code and fills the descriptor | 491 // GetCode emits any pending (non-emitted) code and fills the descriptor |
491 // desc. GetCode() is idempotent; it returns the same result if no other | 492 // desc. GetCode() is idempotent; it returns the same result if no other |
492 // Assembler functions are invoked in between GetCode() calls. | 493 // Assembler functions are invoked in between GetCode() calls. |
493 void GetCode(CodeDesc* desc); | 494 void GetCode(CodeDesc* desc); |
494 | 495 |
495 // Read/Modify the code target in the branch/call instruction at pc. | 496 // Read/Modify the code target in the branch/call instruction at pc. |
| 497 // The isolate argument is unused (and may be nullptr) when skipping flushing. |
496 inline static Address target_address_at(Address pc, Address constant_pool); | 498 inline static Address target_address_at(Address pc, Address constant_pool); |
497 inline static void set_target_address_at( | 499 inline static void set_target_address_at( |
498 Isolate* isolate, Address pc, Address constant_pool, Address target, | 500 Isolate* isolate, Address pc, Address constant_pool, Address target, |
499 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 501 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
500 static inline Address target_address_at(Address pc, Code* code); | 502 static inline Address target_address_at(Address pc, Code* code); |
501 static inline void set_target_address_at( | 503 static inline void set_target_address_at( |
502 Isolate* isolate, Address pc, Code* code, Address target, | 504 Isolate* isolate, Address pc, Code* code, Address target, |
503 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 505 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
504 | 506 |
505 // Return the code target address at a call site from the return address | 507 // Return the code target address at a call site from the return address |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 Assembler* assembler_; | 1098 Assembler* assembler_; |
1097 #ifdef DEBUG | 1099 #ifdef DEBUG |
1098 int space_before_; | 1100 int space_before_; |
1099 #endif | 1101 #endif |
1100 }; | 1102 }; |
1101 | 1103 |
1102 } // namespace internal | 1104 } // namespace internal |
1103 } // namespace v8 | 1105 } // namespace v8 |
1104 | 1106 |
1105 #endif // V8_X87_ASSEMBLER_X87_H_ | 1107 #endif // V8_X87_ASSEMBLER_X87_H_ |
OLD | NEW |