| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 #elif USE_EABI_HARDFLOAT | 207 #elif USE_EABI_HARDFLOAT |
| 208 bool eabi_hardfloat = true; | 208 bool eabi_hardfloat = true; |
| 209 #else | 209 #else |
| 210 bool eabi_hardfloat = false; | 210 bool eabi_hardfloat = false; |
| 211 #endif | 211 #endif |
| 212 printf(" USE_EABI_HARDFLOAT=%d\n", eabi_hardfloat); | 212 printf(" USE_EABI_HARDFLOAT=%d\n", eabi_hardfloat); |
| 213 } | 213 } |
| 214 | 214 |
| 215 | 215 |
| 216 // ----------------------------------------------------------------------------- | 216 // ----------------------------------------------------------------------------- |
| 217 // Implementation of DwVfpRegister |
| 218 |
| 219 const char* DwVfpRegister::AllocationIndexToString(int index) { |
| 220 DCHECK(index >= 0 && index < NumAllocatableRegisters()); |
| 221 DCHECK(kScratchDoubleReg.code() - kDoubleRegZero.code() == |
| 222 kNumReservedRegisters - 1); |
| 223 if (index >= kDoubleRegZero.code()) index += kNumReservedRegisters; |
| 224 return VFPRegisters::Name(index, true); |
| 225 } |
| 226 |
| 227 |
| 228 // ----------------------------------------------------------------------------- |
| 217 // Implementation of RelocInfo | 229 // Implementation of RelocInfo |
| 218 | 230 |
| 219 // static | 231 // static |
| 220 const int RelocInfo::kApplyMask = 0; | 232 const int RelocInfo::kApplyMask = 0; |
| 221 | 233 |
| 222 | 234 |
| 223 bool RelocInfo::IsCodedSpecially() { | 235 bool RelocInfo::IsCodedSpecially() { |
| 224 // The deserializer needs to know whether a pointer is specially coded. Being | 236 // The deserializer needs to know whether a pointer is specially coded. Being |
| 225 // specially coded on ARM means that it is a movw/movt instruction, or is an | 237 // specially coded on ARM means that it is a movw/movt instruction, or is an |
| 226 // embedded constant pool entry. These only occur if | 238 // embedded constant pool entry. These only occur if |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 384 } |
| 373 } | 385 } |
| 374 | 386 |
| 375 | 387 |
| 376 // ----------------------------------------------------------------------------- | 388 // ----------------------------------------------------------------------------- |
| 377 // Specific instructions, constants, and masks. | 389 // Specific instructions, constants, and masks. |
| 378 | 390 |
| 379 // str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r)) | 391 // str(r, MemOperand(sp, 4, NegPreIndex), al) instruction (aka push(r)) |
| 380 // register r is not encoded. | 392 // register r is not encoded. |
| 381 const Instr kPushRegPattern = | 393 const Instr kPushRegPattern = |
| 382 al | B26 | 4 | NegPreIndex | Register::kCode_sp * B16; | 394 al | B26 | 4 | NegPreIndex | kRegister_sp_Code * B16; |
| 383 // ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r)) | 395 // ldr(r, MemOperand(sp, 4, PostIndex), al) instruction (aka pop(r)) |
| 384 // register r is not encoded. | 396 // register r is not encoded. |
| 385 const Instr kPopRegPattern = | 397 const Instr kPopRegPattern = |
| 386 al | B26 | L | 4 | PostIndex | Register::kCode_sp * B16; | 398 al | B26 | L | 4 | PostIndex | kRegister_sp_Code * B16; |
| 387 // ldr rd, [pc, #offset] | 399 // ldr rd, [pc, #offset] |
| 388 const Instr kLdrPCImmedMask = 15 * B24 | 7 * B20 | 15 * B16; | 400 const Instr kLdrPCImmedMask = 15 * B24 | 7 * B20 | 15 * B16; |
| 389 const Instr kLdrPCImmedPattern = 5 * B24 | L | Register::kCode_pc * B16; | 401 const Instr kLdrPCImmedPattern = 5 * B24 | L | kRegister_pc_Code * B16; |
| 390 // ldr rd, [pp, #offset] | 402 // ldr rd, [pp, #offset] |
| 391 const Instr kLdrPpImmedMask = 15 * B24 | 7 * B20 | 15 * B16; | 403 const Instr kLdrPpImmedMask = 15 * B24 | 7 * B20 | 15 * B16; |
| 392 const Instr kLdrPpImmedPattern = 5 * B24 | L | Register::kCode_r8 * B16; | 404 const Instr kLdrPpImmedPattern = 5 * B24 | L | kRegister_r8_Code * B16; |
| 393 // ldr rd, [pp, rn] | 405 // ldr rd, [pp, rn] |
| 394 const Instr kLdrPpRegMask = 15 * B24 | 7 * B20 | 15 * B16; | 406 const Instr kLdrPpRegMask = 15 * B24 | 7 * B20 | 15 * B16; |
| 395 const Instr kLdrPpRegPattern = 7 * B24 | L | Register::kCode_r8 * B16; | 407 const Instr kLdrPpRegPattern = 7 * B24 | L | kRegister_r8_Code * B16; |
| 396 // vldr dd, [pc, #offset] | 408 // vldr dd, [pc, #offset] |
| 397 const Instr kVldrDPCMask = 15 * B24 | 3 * B20 | 15 * B16 | 15 * B8; | 409 const Instr kVldrDPCMask = 15 * B24 | 3 * B20 | 15 * B16 | 15 * B8; |
| 398 const Instr kVldrDPCPattern = 13 * B24 | L | Register::kCode_pc * B16 | 11 * B8; | 410 const Instr kVldrDPCPattern = 13 * B24 | L | kRegister_pc_Code * B16 | 11 * B8; |
| 399 // vldr dd, [pp, #offset] | 411 // vldr dd, [pp, #offset] |
| 400 const Instr kVldrDPpMask = 15 * B24 | 3 * B20 | 15 * B16 | 15 * B8; | 412 const Instr kVldrDPpMask = 15 * B24 | 3 * B20 | 15 * B16 | 15 * B8; |
| 401 const Instr kVldrDPpPattern = 13 * B24 | L | Register::kCode_r8 * B16 | 11 * B8; | 413 const Instr kVldrDPpPattern = 13 * B24 | L | kRegister_r8_Code * B16 | 11 * B8; |
| 402 // blxcc rm | 414 // blxcc rm |
| 403 const Instr kBlxRegMask = | 415 const Instr kBlxRegMask = |
| 404 15 * B24 | 15 * B20 | 15 * B16 | 15 * B12 | 15 * B8 | 15 * B4; | 416 15 * B24 | 15 * B20 | 15 * B16 | 15 * B12 | 15 * B8 | 15 * B4; |
| 405 const Instr kBlxRegPattern = | 417 const Instr kBlxRegPattern = |
| 406 B24 | B21 | 15 * B16 | 15 * B12 | 15 * B8 | BLX; | 418 B24 | B21 | 15 * B16 | 15 * B12 | 15 * B8 | BLX; |
| 407 const Instr kBlxIp = al | kBlxRegPattern | ip.code(); | 419 const Instr kBlxIp = al | kBlxRegPattern | ip.code(); |
| 408 const Instr kMovMvnMask = 0x6d * B21 | 0xf * B16; | 420 const Instr kMovMvnMask = 0x6d * B21 | 0xf * B16; |
| 409 const Instr kMovMvnPattern = 0xd * B21; | 421 const Instr kMovMvnPattern = 0xd * B21; |
| 410 const Instr kMovMvnFlip = B22; | 422 const Instr kMovMvnFlip = B22; |
| 411 const Instr kMovLeaveCCMask = 0xdff * B16; | 423 const Instr kMovLeaveCCMask = 0xdff * B16; |
| 412 const Instr kMovLeaveCCPattern = 0x1a0 * B16; | 424 const Instr kMovLeaveCCPattern = 0x1a0 * B16; |
| 413 const Instr kMovwPattern = 0x30 * B20; | 425 const Instr kMovwPattern = 0x30 * B20; |
| 414 const Instr kMovtPattern = 0x34 * B20; | 426 const Instr kMovtPattern = 0x34 * B20; |
| 415 const Instr kMovwLeaveCCFlip = 0x5 * B21; | 427 const Instr kMovwLeaveCCFlip = 0x5 * B21; |
| 416 const Instr kMovImmedMask = 0x7f * B21; | 428 const Instr kMovImmedMask = 0x7f * B21; |
| 417 const Instr kMovImmedPattern = 0x1d * B21; | 429 const Instr kMovImmedPattern = 0x1d * B21; |
| 418 const Instr kOrrImmedMask = 0x7f * B21; | 430 const Instr kOrrImmedMask = 0x7f * B21; |
| 419 const Instr kOrrImmedPattern = 0x1c * B21; | 431 const Instr kOrrImmedPattern = 0x1c * B21; |
| 420 const Instr kCmpCmnMask = 0xdd * B20 | 0xf * B12; | 432 const Instr kCmpCmnMask = 0xdd * B20 | 0xf * B12; |
| 421 const Instr kCmpCmnPattern = 0x15 * B20; | 433 const Instr kCmpCmnPattern = 0x15 * B20; |
| 422 const Instr kCmpCmnFlip = B21; | 434 const Instr kCmpCmnFlip = B21; |
| 423 const Instr kAddSubFlip = 0x6 * B21; | 435 const Instr kAddSubFlip = 0x6 * B21; |
| 424 const Instr kAndBicFlip = 0xe * B21; | 436 const Instr kAndBicFlip = 0xe * B21; |
| 425 | 437 |
| 426 // A mask for the Rd register for push, pop, ldr, str instructions. | 438 // A mask for the Rd register for push, pop, ldr, str instructions. |
| 427 const Instr kLdrRegFpOffsetPattern = | 439 const Instr kLdrRegFpOffsetPattern = |
| 428 al | B26 | L | Offset | Register::kCode_fp * B16; | 440 al | B26 | L | Offset | kRegister_fp_Code * B16; |
| 429 const Instr kStrRegFpOffsetPattern = | 441 const Instr kStrRegFpOffsetPattern = |
| 430 al | B26 | Offset | Register::kCode_fp * B16; | 442 al | B26 | Offset | kRegister_fp_Code * B16; |
| 431 const Instr kLdrRegFpNegOffsetPattern = | 443 const Instr kLdrRegFpNegOffsetPattern = |
| 432 al | B26 | L | NegOffset | Register::kCode_fp * B16; | 444 al | B26 | L | NegOffset | kRegister_fp_Code * B16; |
| 433 const Instr kStrRegFpNegOffsetPattern = | 445 const Instr kStrRegFpNegOffsetPattern = |
| 434 al | B26 | NegOffset | Register::kCode_fp * B16; | 446 al | B26 | NegOffset | kRegister_fp_Code * B16; |
| 435 const Instr kLdrStrInstrTypeMask = 0xffff0000; | 447 const Instr kLdrStrInstrTypeMask = 0xffff0000; |
| 436 | 448 |
| 437 | 449 |
| 438 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) | 450 Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) |
| 439 : AssemblerBase(isolate, buffer, buffer_size), | 451 : AssemblerBase(isolate, buffer, buffer_size), |
| 440 recorded_ast_id_(TypeFeedbackId::None()), | 452 recorded_ast_id_(TypeFeedbackId::None()), |
| 441 pending_32_bit_constants_(&pending_32_bit_constants_buffer_[0]), | 453 pending_32_bit_constants_(&pending_32_bit_constants_buffer_[0]), |
| 442 pending_64_bit_constants_(&pending_64_bit_constants_buffer_[0]), | 454 pending_64_bit_constants_(&pending_64_bit_constants_buffer_[0]), |
| 443 constant_pool_builder_(kLdrMaxReachBits, kVldrMaxReachBits), | 455 constant_pool_builder_(kLdrMaxReachBits, kVldrMaxReachBits), |
| 444 positions_recorder_(this) { | 456 positions_recorder_(this) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 DCHECK(IsAddRegisterImmediate(instr)); | 612 DCHECK(IsAddRegisterImmediate(instr)); |
| 601 DCHECK(offset >= 0); | 613 DCHECK(offset >= 0); |
| 602 DCHECK(is_uint12(offset)); | 614 DCHECK(is_uint12(offset)); |
| 603 // Set the offset. | 615 // Set the offset. |
| 604 return (instr & ~kOff12Mask) | offset; | 616 return (instr & ~kOff12Mask) | offset; |
| 605 } | 617 } |
| 606 | 618 |
| 607 | 619 |
| 608 Register Assembler::GetRd(Instr instr) { | 620 Register Assembler::GetRd(Instr instr) { |
| 609 Register reg; | 621 Register reg; |
| 610 reg.reg_code = Instruction::RdValue(instr); | 622 reg.code_ = Instruction::RdValue(instr); |
| 611 return reg; | 623 return reg; |
| 612 } | 624 } |
| 613 | 625 |
| 614 | 626 |
| 615 Register Assembler::GetRn(Instr instr) { | 627 Register Assembler::GetRn(Instr instr) { |
| 616 Register reg; | 628 Register reg; |
| 617 reg.reg_code = Instruction::RnValue(instr); | 629 reg.code_ = Instruction::RnValue(instr); |
| 618 return reg; | 630 return reg; |
| 619 } | 631 } |
| 620 | 632 |
| 621 | 633 |
| 622 Register Assembler::GetRm(Instr instr) { | 634 Register Assembler::GetRm(Instr instr) { |
| 623 Register reg; | 635 Register reg; |
| 624 reg.reg_code = Instruction::RmValue(instr); | 636 reg.code_ = Instruction::RmValue(instr); |
| 625 return reg; | 637 return reg; |
| 626 } | 638 } |
| 627 | 639 |
| 628 | 640 |
| 629 Instr Assembler::GetConsantPoolLoadPattern() { | 641 Instr Assembler::GetConsantPoolLoadPattern() { |
| 630 if (FLAG_enable_embedded_constant_pool) { | 642 if (FLAG_enable_embedded_constant_pool) { |
| 631 return kLdrPpImmedPattern; | 643 return kLdrPpImmedPattern; |
| 632 } else { | 644 } else { |
| 633 return kLdrPCImmedPattern; | 645 return kLdrPCImmedPattern; |
| 634 } | 646 } |
| (...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4013 DCHECK(is_uint12(offset)); | 4025 DCHECK(is_uint12(offset)); |
| 4014 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); | 4026 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); |
| 4015 } | 4027 } |
| 4016 } | 4028 } |
| 4017 | 4029 |
| 4018 | 4030 |
| 4019 } // namespace internal | 4031 } // namespace internal |
| 4020 } // namespace v8 | 4032 } // namespace v8 |
| 4021 | 4033 |
| 4022 #endif // V8_TARGET_ARCH_ARM | 4034 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |