Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 | 460 |
| 461 | 461 |
| 462 void MacroAssembler::PopSafepointRegisters() { | 462 void MacroAssembler::PopSafepointRegisters() { |
| 463 const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters; | 463 const int num_unsaved = kNumSafepointRegisters - kNumSafepointSavedRegisters; |
| 464 ldm(ia_w, sp, kSafepointSavedRegisters); | 464 ldm(ia_w, sp, kSafepointSavedRegisters); |
| 465 add(sp, sp, Operand(num_unsaved * kPointerSize)); | 465 add(sp, sp, Operand(num_unsaved * kPointerSize)); |
| 466 } | 466 } |
| 467 | 467 |
| 468 | 468 |
| 469 void MacroAssembler::PushSafepointRegistersAndDoubles() { | 469 void MacroAssembler::PushSafepointRegistersAndDoubles() { |
| 470 PushSafepointRegisters(); | |
| 471 sub(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters * | 470 sub(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters * |
| 472 kDoubleSize)); | 471 kDoubleSize)); |
| 473 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) { | 472 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) { |
| 474 vstr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); | 473 vstr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); |
| 475 } | 474 } |
| 475 PushSafepointRegisters(); | |
|
Mads Ager (chromium)
2011/01/27 08:27:56
What is the motivation for changing this? Please u
Alexandre
2011/01/28 13:57:59
Reversed.
We usually want to patch general purpos
| |
| 476 } | 476 } |
| 477 | 477 |
| 478 | 478 |
| 479 void MacroAssembler::PopSafepointRegistersAndDoubles() { | 479 void MacroAssembler::PopSafepointRegistersAndDoubles() { |
| 480 PopSafepointRegisters(); | |
|
Mads Ager (chromium)
2011/01/27 08:27:56
Undo please. :)
Alexandre
2011/01/28 13:57:59
Done.
| |
| 480 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) { | 481 for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; i++) { |
| 481 vldr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); | 482 vldr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); |
| 482 } | 483 } |
| 483 add(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters * | 484 add(sp, sp, Operand(DwVfpRegister::kNumAllocatableRegisters * |
| 484 kDoubleSize)); | 485 kDoubleSize)); |
| 485 PopSafepointRegisters(); | |
| 486 } | 486 } |
| 487 | 487 |
| 488 void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register reg) { | |
| 489 str(reg, SafepointRegistersAndDoublesSlot(reg)); | |
| 490 } | |
| 491 | |
| 492 | |
| 488 void MacroAssembler::StoreToSafepointRegisterSlot(Register reg) { | 493 void MacroAssembler::StoreToSafepointRegisterSlot(Register reg) { |
| 489 str(reg, SafepointRegisterSlot(reg)); | 494 str(reg, SafepointRegisterSlot(reg)); |
| 490 } | 495 } |
| 491 | 496 |
| 492 | 497 |
| 498 void MacroAssembler::LoadFromSafepointRegisterSlot(Register reg) { | |
| 499 ldr(reg, SafepointRegisterSlot(reg)); | |
| 500 } | |
| 501 | |
| 502 | |
| 493 int MacroAssembler::SafepointRegisterStackIndex(int reg_code) { | 503 int MacroAssembler::SafepointRegisterStackIndex(int reg_code) { |
| 494 // The registers are pushed starting with the highest encoding, | 504 // The registers are pushed starting with the highest encoding, |
| 495 // which means that lowest encodings are closest to the stack pointer. | 505 // which means that lowest encodings are closest to the stack pointer. |
| 496 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters); | 506 ASSERT(reg_code >= 0 && reg_code < kNumSafepointRegisters); |
| 497 return reg_code; | 507 return reg_code; |
| 498 } | 508 } |
| 499 | 509 |
| 500 | 510 |
| 501 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { | 511 MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { |
| 502 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); | 512 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); |
| 503 } | 513 } |
| 504 | 514 |
| 505 | 515 |
| 516 MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { | |
| 517 // General purpose registers are pushed last on the stack. | |
| 518 return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kInstrSize); | |
|
Mads Ager (chromium)
2011/01/27 08:27:56
kInstrSize -> kPointerSize. This is an index into
Alexandre
2011/01/28 13:57:59
Done.
| |
| 519 } | |
| 520 | |
| 521 | |
| 506 void MacroAssembler::Ldrd(Register dst1, Register dst2, | 522 void MacroAssembler::Ldrd(Register dst1, Register dst2, |
| 507 const MemOperand& src, Condition cond) { | 523 const MemOperand& src, Condition cond) { |
| 508 ASSERT(src.rm().is(no_reg)); | 524 ASSERT(src.rm().is(no_reg)); |
| 509 ASSERT(!dst1.is(lr)); // r14. | 525 ASSERT(!dst1.is(lr)); // r14. |
| 510 ASSERT_EQ(0, dst1.code() % 2); | 526 ASSERT_EQ(0, dst1.code() % 2); |
| 511 ASSERT_EQ(dst1.code() + 1, dst2.code()); | 527 ASSERT_EQ(dst1.code() + 1, dst2.code()); |
| 512 | 528 |
| 513 // Generate two ldr instructions if ldrd is not available. | 529 // Generate two ldr instructions if ldrd is not available. |
| 514 if (CpuFeatures::IsSupported(ARMv7)) { | 530 if (CpuFeatures::IsSupported(ARMv7)) { |
| 515 CpuFeatures::Scope scope(ARMv7); | 531 CpuFeatures::Scope scope(ARMv7); |
| (...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2256 | 2272 |
| 2257 void CodePatcher::Emit(Address addr) { | 2273 void CodePatcher::Emit(Address addr) { |
| 2258 masm()->emit(reinterpret_cast<Instr>(addr)); | 2274 masm()->emit(reinterpret_cast<Instr>(addr)); |
| 2259 } | 2275 } |
| 2260 #endif // ENABLE_DEBUGGER_SUPPORT | 2276 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2261 | 2277 |
| 2262 | 2278 |
| 2263 } } // namespace v8::internal | 2279 } } // namespace v8::internal |
| 2264 | 2280 |
| 2265 #endif // V8_TARGET_ARCH_ARM | 2281 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |