| 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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // for a detailed comment on the layout (globals.h). | 377 // for a detailed comment on the layout (globals.h). |
| 378 // | 378 // |
| 379 // If the provided buffer is NULL, the assembler allocates and grows its own | 379 // If the provided buffer is NULL, the assembler allocates and grows its own |
| 380 // buffer, and buffer_size determines the initial buffer size. The buffer is | 380 // buffer, and buffer_size determines the initial buffer size. The buffer is |
| 381 // owned by the assembler and deallocated upon destruction of the assembler. | 381 // owned by the assembler and deallocated upon destruction of the assembler. |
| 382 // | 382 // |
| 383 // If the provided buffer is not NULL, the assembler uses the provided buffer | 383 // If the provided buffer is not NULL, the assembler uses the provided buffer |
| 384 // for code generation and assumes its size to be buffer_size. If the buffer | 384 // for code generation and assumes its size to be buffer_size. If the buffer |
| 385 // is too small, a fatal error occurs. No deallocation of the buffer is done | 385 // is too small, a fatal error occurs. No deallocation of the buffer is done |
| 386 // upon destruction of the assembler. | 386 // upon destruction of the assembler. |
| 387 Assembler(Isolate* isolate, void* buffer, int buffer_size); | 387 Assembler(Isolate* isolate, void* buffer, int buffer_size) |
| 388 : Assembler(IsolateData(isolate), buffer, buffer_size) {} |
| 389 Assembler(IsolateData isolate_data, void* buffer, int buffer_size); |
| 388 virtual ~Assembler() { } | 390 virtual ~Assembler() { } |
| 389 | 391 |
| 390 // GetCode emits any pending (non-emitted) code and fills the descriptor | 392 // GetCode emits any pending (non-emitted) code and fills the descriptor |
| 391 // desc. GetCode() is idempotent; it returns the same result if no other | 393 // desc. GetCode() is idempotent; it returns the same result if no other |
| 392 // Assembler functions are invoked in between GetCode() calls. | 394 // Assembler functions are invoked in between GetCode() calls. |
| 393 void GetCode(CodeDesc* desc); | 395 void GetCode(CodeDesc* desc); |
| 394 | 396 |
| 395 // Label operations & relative jumps (PPUM Appendix D). | 397 // Label operations & relative jumps (PPUM Appendix D). |
| 396 // | 398 // |
| 397 // Takes a branch opcode (cc) and a label (L) and generates | 399 // Takes a branch opcode (cc) and a label (L) and generates |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 inline int32_t shifted_branch_offset26(Label* L) { | 450 inline int32_t shifted_branch_offset26(Label* L) { |
| 449 return branch_offset26(L) >> 2; | 451 return branch_offset26(L) >> 2; |
| 450 } | 452 } |
| 451 uint32_t jump_address(Label* L); | 453 uint32_t jump_address(Label* L); |
| 452 | 454 |
| 453 // Puts a labels target address at the given position. | 455 // Puts a labels target address at the given position. |
| 454 // The high 8 bits are set to zero. | 456 // The high 8 bits are set to zero. |
| 455 void label_at_put(Label* L, int at_offset); | 457 void label_at_put(Label* L, int at_offset); |
| 456 | 458 |
| 457 // Read/Modify the code target address in the branch/call instruction at pc. | 459 // Read/Modify the code target address in the branch/call instruction at pc. |
| 460 // The isolate argument is unused (and may be nullptr) when skipping flushing. |
| 458 static Address target_address_at(Address pc); | 461 static Address target_address_at(Address pc); |
| 459 static void set_target_address_at( | 462 static void set_target_address_at( |
| 460 Isolate* isolate, Address pc, Address target, | 463 Isolate* isolate, Address pc, Address target, |
| 461 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 464 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
| 462 // On MIPS there is no Constant Pool so we skip that parameter. | 465 // On MIPS there is no Constant Pool so we skip that parameter. |
| 463 INLINE(static Address target_address_at(Address pc, Address constant_pool)) { | 466 INLINE(static Address target_address_at(Address pc, Address constant_pool)) { |
| 464 return target_address_at(pc); | 467 return target_address_at(pc); |
| 465 } | 468 } |
| 466 INLINE(static void set_target_address_at( | 469 INLINE(static void set_target_address_at( |
| 467 Isolate* isolate, Address pc, Address constant_pool, Address target, | 470 Isolate* isolate, Address pc, Address constant_pool, Address target, |
| (...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 public: | 1474 public: |
| 1472 explicit EnsureSpace(Assembler* assembler) { | 1475 explicit EnsureSpace(Assembler* assembler) { |
| 1473 assembler->CheckBuffer(); | 1476 assembler->CheckBuffer(); |
| 1474 } | 1477 } |
| 1475 }; | 1478 }; |
| 1476 | 1479 |
| 1477 } // namespace internal | 1480 } // namespace internal |
| 1478 } // namespace v8 | 1481 } // namespace v8 |
| 1479 | 1482 |
| 1480 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1483 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |