| 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 | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are 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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 (instr2 & kImm16Mask)); | 470 (instr2 & kImm16Mask)); |
| 471 #endif | 471 #endif |
| 472 } | 472 } |
| 473 | 473 |
| 474 UNREACHABLE(); | 474 UNREACHABLE(); |
| 475 return NULL; | 475 return NULL; |
| 476 } | 476 } |
| 477 | 477 |
| 478 | 478 |
| 479 #if V8_TARGET_ARCH_PPC64 | 479 #if V8_TARGET_ARCH_PPC64 |
| 480 const int kLoadIntptrOpcode = LD; | 480 const uint32_t kLoadIntptrOpcode = LD; |
| 481 #else | 481 #else |
| 482 const int kLoadIntptrOpcode = LWZ; | 482 const uint32_t kLoadIntptrOpcode = LWZ; |
| 483 #endif | 483 #endif |
| 484 | 484 |
| 485 // Constant pool load sequence detection: | 485 // Constant pool load sequence detection: |
| 486 // 1) REGULAR access: | 486 // 1) REGULAR access: |
| 487 // load <dst>, kConstantPoolRegister + <offset> | 487 // load <dst>, kConstantPoolRegister + <offset> |
| 488 // | 488 // |
| 489 // 2) OVERFLOWED access: | 489 // 2) OVERFLOWED access: |
| 490 // addis <scratch>, kConstantPoolRegister, <offset_high> | 490 // addis <scratch>, kConstantPoolRegister, <offset_high> |
| 491 // load <dst>, <scratch> + <offset_low> | 491 // load <dst>, <scratch> + <offset_low> |
| 492 bool Assembler::IsConstantPoolLoadStart(Address pc, | 492 bool Assembler::IsConstantPoolLoadStart(Address pc, |
| 493 ConstantPoolEntry::Access* access) { | 493 ConstantPoolEntry::Access* access) { |
| 494 Instr instr = instr_at(pc); | 494 Instr instr = instr_at(pc); |
| 495 int opcode = instr & kOpcodeMask; | 495 uint32_t opcode = instr & kOpcodeMask; |
| 496 if (!GetRA(instr).is(kConstantPoolRegister)) return false; | 496 if (!GetRA(instr).is(kConstantPoolRegister)) return false; |
| 497 bool overflowed = (opcode == ADDIS); | 497 bool overflowed = (opcode == ADDIS); |
| 498 #ifdef DEBUG | 498 #ifdef DEBUG |
| 499 if (overflowed) { | 499 if (overflowed) { |
| 500 opcode = instr_at(pc + kInstrSize) & kOpcodeMask; | 500 opcode = instr_at(pc + kInstrSize) & kOpcodeMask; |
| 501 } | 501 } |
| 502 DCHECK(opcode == kLoadIntptrOpcode || opcode == LFD); | 502 DCHECK(opcode == kLoadIntptrOpcode || opcode == LFD); |
| 503 #endif | 503 #endif |
| 504 if (access) { | 504 if (access) { |
| 505 *access = (overflowed ? ConstantPoolEntry::OVERFLOWED | 505 *access = (overflowed ? ConstantPoolEntry::OVERFLOWED |
| 506 : ConstantPoolEntry::REGULAR); | 506 : ConstantPoolEntry::REGULAR); |
| 507 } | 507 } |
| 508 return true; | 508 return true; |
| 509 } | 509 } |
| 510 | 510 |
| 511 | 511 |
| 512 bool Assembler::IsConstantPoolLoadEnd(Address pc, | 512 bool Assembler::IsConstantPoolLoadEnd(Address pc, |
| 513 ConstantPoolEntry::Access* access) { | 513 ConstantPoolEntry::Access* access) { |
| 514 Instr instr = instr_at(pc); | 514 Instr instr = instr_at(pc); |
| 515 int opcode = instr & kOpcodeMask; | 515 uint32_t opcode = instr & kOpcodeMask; |
| 516 bool overflowed = false; | 516 bool overflowed = false; |
| 517 if (!(opcode == kLoadIntptrOpcode || opcode == LFD)) return false; | 517 if (!(opcode == kLoadIntptrOpcode || opcode == LFD)) return false; |
| 518 if (!GetRA(instr).is(kConstantPoolRegister)) { | 518 if (!GetRA(instr).is(kConstantPoolRegister)) { |
| 519 instr = instr_at(pc - kInstrSize); | 519 instr = instr_at(pc - kInstrSize); |
| 520 opcode = instr & kOpcodeMask; | 520 opcode = instr & kOpcodeMask; |
| 521 if ((opcode != ADDIS) || !GetRA(instr).is(kConstantPoolRegister)) { | 521 if ((opcode != ADDIS) || !GetRA(instr).is(kConstantPoolRegister)) { |
| 522 return false; | 522 return false; |
| 523 } | 523 } |
| 524 overflowed = true; | 524 overflowed = true; |
| 525 } | 525 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 } | 682 } |
| 683 #endif | 683 #endif |
| 684 return; | 684 return; |
| 685 } | 685 } |
| 686 UNREACHABLE(); | 686 UNREACHABLE(); |
| 687 } | 687 } |
| 688 } // namespace internal | 688 } // namespace internal |
| 689 } // namespace v8 | 689 } // namespace v8 |
| 690 | 690 |
| 691 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ | 691 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ |
| OLD | NEW |