| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 return branch_offset26(L) >> 2; | 450 return branch_offset26(L) >> 2; |
| 451 } | 451 } |
| 452 uint32_t jump_address(Label* L); | 452 uint32_t jump_address(Label* L); |
| 453 | 453 |
| 454 // Puts a labels target address at the given position. | 454 // Puts a labels target address at the given position. |
| 455 // The high 8 bits are set to zero. | 455 // The high 8 bits are set to zero. |
| 456 void label_at_put(Label* L, int at_offset); | 456 void label_at_put(Label* L, int at_offset); |
| 457 | 457 |
| 458 // Read/Modify the code target address in the branch/call instruction at pc. | 458 // Read/Modify the code target address in the branch/call instruction at pc. |
| 459 static Address target_address_at(Address pc); | 459 static Address target_address_at(Address pc); |
| 460 static void set_target_address_at(Address pc, | 460 static void set_target_address_at( |
| 461 Address target, | 461 Isolate* isolate, Address pc, Address target, |
| 462 ICacheFlushMode icache_flush_mode = | 462 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
| 463 FLUSH_ICACHE_IF_NEEDED); | |
| 464 // On MIPS there is no Constant Pool so we skip that parameter. | 463 // On MIPS there is no Constant Pool so we skip that parameter. |
| 465 INLINE(static Address target_address_at(Address pc, Address constant_pool)) { | 464 INLINE(static Address target_address_at(Address pc, Address constant_pool)) { |
| 466 return target_address_at(pc); | 465 return target_address_at(pc); |
| 467 } | 466 } |
| 468 INLINE(static void set_target_address_at( | 467 INLINE(static void set_target_address_at( |
| 469 Address pc, Address constant_pool, Address target, | 468 Isolate* isolate, Address pc, Address constant_pool, Address target, |
| 470 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { | 469 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { |
| 471 set_target_address_at(pc, target, icache_flush_mode); | 470 set_target_address_at(isolate, pc, target, icache_flush_mode); |
| 472 } | 471 } |
| 473 INLINE(static Address target_address_at(Address pc, Code* code)) { | 472 INLINE(static Address target_address_at(Address pc, Code* code)) { |
| 474 Address constant_pool = code ? code->constant_pool() : NULL; | 473 Address constant_pool = code ? code->constant_pool() : NULL; |
| 475 return target_address_at(pc, constant_pool); | 474 return target_address_at(pc, constant_pool); |
| 476 } | 475 } |
| 477 INLINE(static void set_target_address_at(Address pc, | 476 INLINE(static void set_target_address_at( |
| 478 Code* code, | 477 Isolate* isolate, Address pc, Code* code, Address target, |
| 479 Address target, | 478 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { |
| 480 ICacheFlushMode icache_flush_mode = | |
| 481 FLUSH_ICACHE_IF_NEEDED)) { | |
| 482 Address constant_pool = code ? code->constant_pool() : NULL; | 479 Address constant_pool = code ? code->constant_pool() : NULL; |
| 483 set_target_address_at(pc, constant_pool, target, icache_flush_mode); | 480 set_target_address_at(isolate, pc, constant_pool, target, |
| 481 icache_flush_mode); |
| 484 } | 482 } |
| 485 | 483 |
| 486 // Return the code target address at a call site from the return address | 484 // Return the code target address at a call site from the return address |
| 487 // of that call in the instruction stream. | 485 // of that call in the instruction stream. |
| 488 inline static Address target_address_from_return_address(Address pc); | 486 inline static Address target_address_from_return_address(Address pc); |
| 489 | 487 |
| 490 static void QuietNaN(HeapObject* nan); | 488 static void QuietNaN(HeapObject* nan); |
| 491 | 489 |
| 492 // This sets the branch destination (which gets loaded at the call address). | 490 // This sets the branch destination (which gets loaded at the call address). |
| 493 // This is for calls and branches within generated code. The serializer | 491 // This is for calls and branches within generated code. The serializer |
| 494 // has already deserialized the lui/ori instructions etc. | 492 // has already deserialized the lui/ori instructions etc. |
| 495 inline static void deserialization_set_special_target_at( | 493 inline static void deserialization_set_special_target_at( |
| 496 Address instruction_payload, Code* code, Address target) { | 494 Isolate* isolate, Address instruction_payload, Code* code, |
| 495 Address target) { |
| 497 set_target_address_at( | 496 set_target_address_at( |
| 498 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, | 497 isolate, |
| 499 code, | 498 instruction_payload - kInstructionsFor32BitConstant * kInstrSize, code, |
| 500 target); | 499 target); |
| 501 } | 500 } |
| 502 | 501 |
| 503 // This sets the internal reference at the pc. | 502 // This sets the internal reference at the pc. |
| 504 inline static void deserialization_set_target_internal_reference_at( | 503 inline static void deserialization_set_target_internal_reference_at( |
| 505 Address pc, Address target, | 504 Isolate* isolate, Address pc, Address target, |
| 506 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); | 505 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); |
| 507 | 506 |
| 508 // Size of an instruction. | 507 // Size of an instruction. |
| 509 static const int kInstrSize = sizeof(Instr); | 508 static const int kInstrSize = sizeof(Instr); |
| 510 | 509 |
| 511 // Difference between address of current opcode and target address offset. | 510 // Difference between address of current opcode and target address offset. |
| 512 static const int kBranchPCOffset = 4; | 511 static const int kBranchPCOffset = 4; |
| 513 | 512 |
| 514 // Here we are patching the address in the LUI/ORI instruction pair. | 513 // Here we are patching the address in the LUI/ORI instruction pair. |
| 515 // These values are used in the serialization process and must be zero for | 514 // These values are used in the serialization process and must be zero for |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 public: | 1428 public: |
| 1430 explicit EnsureSpace(Assembler* assembler) { | 1429 explicit EnsureSpace(Assembler* assembler) { |
| 1431 assembler->CheckBuffer(); | 1430 assembler->CheckBuffer(); |
| 1432 } | 1431 } |
| 1433 }; | 1432 }; |
| 1434 | 1433 |
| 1435 } // namespace internal | 1434 } // namespace internal |
| 1436 } // namespace v8 | 1435 } // namespace v8 |
| 1437 | 1436 |
| 1438 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1437 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |