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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 uint64_t jump_address(Label* L); | 436 uint64_t jump_address(Label* L); |
437 uint64_t jump_offset(Label* L); | 437 uint64_t jump_offset(Label* L); |
438 | 438 |
439 // Puts a labels target address at the given position. | 439 // Puts a labels target address at the given position. |
440 // The high 8 bits are set to zero. | 440 // The high 8 bits are set to zero. |
441 void label_at_put(Label* L, int at_offset); | 441 void label_at_put(Label* L, int at_offset); |
442 | 442 |
443 // Read/Modify the code target address in the branch/call instruction at pc. | 443 // Read/Modify the code target address in the branch/call instruction at pc. |
444 static Address target_address_at(Address pc); | 444 static Address target_address_at(Address pc); |
445 static void set_target_address_at(Address pc, | 445 static void set_target_address_at( |
446 Address target, | 446 Isolate* isolate, Address pc, Address target, |
447 ICacheFlushMode icache_flush_mode = | 447 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED); |
448 FLUSH_ICACHE_IF_NEEDED); | |
449 // On MIPS there is no Constant Pool so we skip that parameter. | 448 // On MIPS there is no Constant Pool so we skip that parameter. |
450 INLINE(static Address target_address_at(Address pc, Address constant_pool)) { | 449 INLINE(static Address target_address_at(Address pc, Address constant_pool)) { |
451 return target_address_at(pc); | 450 return target_address_at(pc); |
452 } | 451 } |
453 INLINE(static void set_target_address_at( | 452 INLINE(static void set_target_address_at( |
454 Address pc, Address constant_pool, Address target, | 453 Isolate* isolate, Address pc, Address constant_pool, Address target, |
455 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { | 454 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { |
456 set_target_address_at(pc, target, icache_flush_mode); | 455 set_target_address_at(isolate, pc, target, icache_flush_mode); |
457 } | 456 } |
458 INLINE(static Address target_address_at(Address pc, Code* code)) { | 457 INLINE(static Address target_address_at(Address pc, Code* code)) { |
459 Address constant_pool = code ? code->constant_pool() : NULL; | 458 Address constant_pool = code ? code->constant_pool() : NULL; |
460 return target_address_at(pc, constant_pool); | 459 return target_address_at(pc, constant_pool); |
461 } | 460 } |
462 INLINE(static void set_target_address_at(Address pc, | 461 INLINE(static void set_target_address_at( |
463 Code* code, | 462 Isolate* isolate, Address pc, Code* code, Address target, |
464 Address target, | 463 ICacheFlushMode icache_flush_mode = FLUSH_ICACHE_IF_NEEDED)) { |
465 ICacheFlushMode icache_flush_mode = | |
466 FLUSH_ICACHE_IF_NEEDED)) { | |
467 Address constant_pool = code ? code->constant_pool() : NULL; | 464 Address constant_pool = code ? code->constant_pool() : NULL; |
468 set_target_address_at(pc, constant_pool, target, icache_flush_mode); | 465 set_target_address_at(isolate, pc, constant_pool, target, |
| 466 icache_flush_mode); |
469 } | 467 } |
470 | 468 |
471 // Return the code target address at a call site from the return address | 469 // Return the code target address at a call site from the return address |
472 // of that call in the instruction stream. | 470 // of that call in the instruction stream. |
473 inline static Address target_address_from_return_address(Address pc); | 471 inline static Address target_address_from_return_address(Address pc); |
474 | 472 |
475 static void JumpLabelToJumpRegister(Address pc); | 473 static void JumpLabelToJumpRegister(Address pc); |
476 | 474 |
477 static void QuietNaN(HeapObject* nan); | 475 static void QuietNaN(HeapObject* nan); |
478 | 476 |
479 // This sets the branch destination (which gets loaded at the call address). | 477 // This sets the branch destination (which gets loaded at the call address). |
480 // This is for calls and branches within generated code. The serializer | 478 // This is for calls and branches within generated code. The serializer |
481 // has already deserialized the lui/ori instructions etc. | 479 // has already deserialized the lui/ori instructions etc. |
482 inline static void deserialization_set_special_target_at( | 480 inline static void deserialization_set_special_target_at( |
483 Address instruction_payload, Code* code, Address target) { | 481 Isolate* isolate, Address instruction_payload, Code* code, |
| 482 Address target) { |
484 set_target_address_at( | 483 set_target_address_at( |
485 instruction_payload - kInstructionsFor64BitConstant * kInstrSize, | 484 isolate, |
486 code, | 485 instruction_payload - kInstructionsFor64BitConstant * kInstrSize, code, |
487 target); | 486 target); |
488 } | 487 } |
489 | 488 |
490 // This sets the internal reference at the pc. | 489 // This sets the internal reference at the pc. |
491 inline static void deserialization_set_target_internal_reference_at( | 490 inline static void deserialization_set_target_internal_reference_at( |
492 Address pc, Address target, | 491 Isolate* isolate, Address pc, Address target, |
493 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); | 492 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); |
494 | 493 |
495 // Size of an instruction. | 494 // Size of an instruction. |
496 static const int kInstrSize = sizeof(Instr); | 495 static const int kInstrSize = sizeof(Instr); |
497 | 496 |
498 // Difference between address of current opcode and target address offset. | 497 // Difference between address of current opcode and target address offset. |
499 static const int kBranchPCOffset = 4; | 498 static const int kBranchPCOffset = 4; |
500 | 499 |
501 // Here we are patching the address in the LUI/ORI instruction pair. | 500 // Here we are patching the address in the LUI/ORI instruction pair. |
502 // These values are used in the serialization process and must be zero for | 501 // These values are used in the serialization process and must be zero for |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1447 public: | 1446 public: |
1448 explicit EnsureSpace(Assembler* assembler) { | 1447 explicit EnsureSpace(Assembler* assembler) { |
1449 assembler->CheckBuffer(); | 1448 assembler->CheckBuffer(); |
1450 } | 1449 } |
1451 }; | 1450 }; |
1452 | 1451 |
1453 } // namespace internal | 1452 } // namespace internal |
1454 } // namespace v8 | 1453 } // namespace v8 |
1455 | 1454 |
1456 #endif // V8_ARM_ASSEMBLER_MIPS_H_ | 1455 #endif // V8_ARM_ASSEMBLER_MIPS_H_ |
OLD | NEW |