| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 virtual ~Assembler() { } | 479 virtual ~Assembler() { } |
| 480 | 480 |
| 481 // GetCode emits any pending (non-emitted) code and fills the descriptor | 481 // GetCode emits any pending (non-emitted) code and fills the descriptor |
| 482 // desc. GetCode() is idempotent; it returns the same result if no other | 482 // desc. GetCode() is idempotent; it returns the same result if no other |
| 483 // Assembler functions are invoked in between GetCode() calls. | 483 // Assembler functions are invoked in between GetCode() calls. |
| 484 void GetCode(CodeDesc* desc); | 484 void GetCode(CodeDesc* desc); |
| 485 | 485 |
| 486 // Read/Modify the code target in the branch/call instruction at pc. | 486 // Read/Modify the code target in the branch/call instruction at pc. |
| 487 inline static Address target_address_at(Address pc, Address constant_pool); | 487 inline static Address target_address_at(Address pc, Address constant_pool); |
| 488 inline static void set_target_address_at( | 488 inline static void set_target_address_at( |
| 489 Address pc, Address constant_pool, Address target, | 489 Isolate* isolate, Address pc, Address constant_pool, Address target, |
| 490 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); | 490 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
| 491 static inline Address target_address_at(Address pc, Code* code) { | 491 static inline Address target_address_at(Address pc, Code* code) { |
| 492 Address constant_pool = code ? code->constant_pool() : NULL; | 492 Address constant_pool = code ? code->constant_pool() : NULL; |
| 493 return target_address_at(pc, constant_pool); | 493 return target_address_at(pc, constant_pool); |
| 494 } | 494 } |
| 495 static inline void set_target_address_at(Address pc, | 495 static inline void set_target_address_at( |
| 496 Code* code, | 496 Isolate* isolate, Address pc, Code* code, Address target, |
| 497 Address target, | 497 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED) { |
| 498 ICacheFlushMode icache_flush_mode = | |
| 499 FLUSH_ICACHE_IF_NEEDED) { | |
| 500 Address constant_pool = code ? code->constant_pool() : NULL; | 498 Address constant_pool = code ? code->constant_pool() : NULL; |
| 501 set_target_address_at(pc, constant_pool, target); | 499 set_target_address_at(isolate, pc, constant_pool, target); |
| 502 } | 500 } |
| 503 | 501 |
| 504 // Return the code target address at a call site from the return address | 502 // Return the code target address at a call site from the return address |
| 505 // of that call in the instruction stream. | 503 // of that call in the instruction stream. |
| 506 inline static Address target_address_from_return_address(Address pc); | 504 inline static Address target_address_from_return_address(Address pc); |
| 507 | 505 |
| 508 // This sets the branch destination (which is in the instruction on x86). | 506 // This sets the branch destination (which is in the instruction on x86). |
| 509 // This is for calls and branches within generated code. | 507 // This is for calls and branches within generated code. |
| 510 inline static void deserialization_set_special_target_at( | 508 inline static void deserialization_set_special_target_at( |
| 511 Address instruction_payload, Code* code, Address target) { | 509 Isolate* isolate, Address instruction_payload, Code* code, |
| 512 set_target_address_at(instruction_payload, code, target); | 510 Address target) { |
| 511 set_target_address_at(isolate, instruction_payload, code, target); |
| 513 } | 512 } |
| 514 | 513 |
| 515 // This sets the internal reference at the pc. | 514 // This sets the internal reference at the pc. |
| 516 inline static void deserialization_set_target_internal_reference_at( | 515 inline static void deserialization_set_target_internal_reference_at( |
| 517 Address pc, Address target, | 516 Isolate* isolate, Address pc, Address target, |
| 518 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); | 517 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); |
| 519 | 518 |
| 520 static const int kSpecialTargetSize = kPointerSize; | 519 static const int kSpecialTargetSize = kPointerSize; |
| 521 | 520 |
| 522 // Distance between the address of the code target in the call instruction | 521 // Distance between the address of the code target in the call instruction |
| 523 // and the return address | 522 // and the return address |
| 524 static const int kCallTargetAddressOffset = kPointerSize; | 523 static const int kCallTargetAddressOffset = kPointerSize; |
| 525 | 524 |
| 526 static const int kCallInstructionLength = 5; | 525 static const int kCallInstructionLength = 5; |
| 527 | 526 |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1567 Assembler* assembler_; | 1566 Assembler* assembler_; |
| 1568 #ifdef DEBUG | 1567 #ifdef DEBUG |
| 1569 int space_before_; | 1568 int space_before_; |
| 1570 #endif | 1569 #endif |
| 1571 }; | 1570 }; |
| 1572 | 1571 |
| 1573 } // namespace internal | 1572 } // namespace internal |
| 1574 } // namespace v8 | 1573 } // namespace v8 |
| 1575 | 1574 |
| 1576 #endif // V8_IA32_ASSEMBLER_IA32_H_ | 1575 #endif // V8_IA32_ASSEMBLER_IA32_H_ |
| OLD | NEW |