OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 DCHECK(is_done()); | 476 DCHECK(is_done()); |
477 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 477 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
478 // For lazy deoptimization we need space to patch a call after every call. | 478 // For lazy deoptimization we need space to patch a call after every call. |
479 // Ensure there is always space for such patching, even if the code ends | 479 // Ensure there is always space for such patching, even if the code ends |
480 // in a call. | 480 // in a call. |
481 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); | 481 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); |
482 while (masm()->pc_offset() < target_offset) { | 482 while (masm()->pc_offset() < target_offset) { |
483 masm()->nop(); | 483 masm()->nop(); |
484 } | 484 } |
485 } | 485 } |
486 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); | 486 safepoints_.Emit(masm(), GetStackSlotCount()); |
487 return !is_aborted(); | 487 return !is_aborted(); |
488 } | 488 } |
489 | 489 |
490 | 490 |
491 Register LCodeGen::ToRegister(int code) const { | 491 Register LCodeGen::ToRegister(int code) const { |
492 return Register::from_code(code); | 492 return Register::from_code(code); |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 XMMRegister LCodeGen::ToDoubleRegister(int code) const { | 496 XMMRegister LCodeGen::ToDoubleRegister(int code) const { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 DCHECK(index < 0); | 564 DCHECK(index < 0); |
565 return -(index + 1) * kPointerSize + kPCOnStackSize; | 565 return -(index + 1) * kPointerSize + kPCOnStackSize; |
566 } | 566 } |
567 | 567 |
568 | 568 |
569 Operand LCodeGen::ToOperand(LOperand* op) const { | 569 Operand LCodeGen::ToOperand(LOperand* op) const { |
570 if (op->IsRegister()) return Operand(ToRegister(op)); | 570 if (op->IsRegister()) return Operand(ToRegister(op)); |
571 if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op)); | 571 if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op)); |
572 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 572 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
573 if (NeedsEagerFrame()) { | 573 if (NeedsEagerFrame()) { |
574 return Operand(ebp, FrameSlotToFPOffset(op->index())); | 574 return Operand(ebp, StackSlotOffset(op->index())); |
575 } else { | 575 } else { |
576 // Retrieve parameter without eager stack-frame relative to the | 576 // Retrieve parameter without eager stack-frame relative to the |
577 // stack-pointer. | 577 // stack-pointer. |
578 return Operand(esp, ArgumentsOffsetWithoutFrame(op->index())); | 578 return Operand(esp, ArgumentsOffsetWithoutFrame(op->index())); |
579 } | 579 } |
580 } | 580 } |
581 | 581 |
582 | 582 |
583 Operand LCodeGen::HighOperand(LOperand* op) { | 583 Operand LCodeGen::HighOperand(LOperand* op) { |
584 DCHECK(op->IsDoubleStackSlot()); | 584 DCHECK(op->IsDoubleStackSlot()); |
585 if (NeedsEagerFrame()) { | 585 if (NeedsEagerFrame()) { |
586 return Operand(ebp, FrameSlotToFPOffset(op->index()) + kPointerSize); | 586 return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize); |
587 } else { | 587 } else { |
588 // Retrieve parameter without eager stack-frame relative to the | 588 // Retrieve parameter without eager stack-frame relative to the |
589 // stack-pointer. | 589 // stack-pointer. |
590 return Operand( | 590 return Operand( |
591 esp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); | 591 esp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); |
592 } | 592 } |
593 } | 593 } |
594 | 594 |
595 | 595 |
596 void LCodeGen::WriteTranslation(LEnvironment* environment, | 596 void LCodeGen::WriteTranslation(LEnvironment* environment, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 environment->HasTaggedValueAt(env_offset + i), | 645 environment->HasTaggedValueAt(env_offset + i), |
646 environment->HasUint32ValueAt(env_offset + i), | 646 environment->HasUint32ValueAt(env_offset + i), |
647 object_index_pointer, | 647 object_index_pointer, |
648 dematerialized_index_pointer); | 648 dematerialized_index_pointer); |
649 } | 649 } |
650 return; | 650 return; |
651 } | 651 } |
652 | 652 |
653 if (op->IsStackSlot()) { | 653 if (op->IsStackSlot()) { |
654 int index = op->index(); | 654 int index = op->index(); |
| 655 if (index >= 0) { |
| 656 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 657 } |
655 if (is_tagged) { | 658 if (is_tagged) { |
656 translation->StoreStackSlot(index); | 659 translation->StoreStackSlot(index); |
657 } else if (is_uint32) { | 660 } else if (is_uint32) { |
658 translation->StoreUint32StackSlot(index); | 661 translation->StoreUint32StackSlot(index); |
659 } else { | 662 } else { |
660 translation->StoreInt32StackSlot(index); | 663 translation->StoreInt32StackSlot(index); |
661 } | 664 } |
662 } else if (op->IsDoubleStackSlot()) { | 665 } else if (op->IsDoubleStackSlot()) { |
663 int index = op->index(); | 666 int index = op->index(); |
| 667 if (index >= 0) { |
| 668 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 669 } |
664 translation->StoreDoubleStackSlot(index); | 670 translation->StoreDoubleStackSlot(index); |
665 } else if (op->IsRegister()) { | 671 } else if (op->IsRegister()) { |
666 Register reg = ToRegister(op); | 672 Register reg = ToRegister(op); |
667 if (is_tagged) { | 673 if (is_tagged) { |
668 translation->StoreRegister(reg); | 674 translation->StoreRegister(reg); |
669 } else if (is_uint32) { | 675 } else if (is_uint32) { |
670 translation->StoreUint32Register(reg); | 676 translation->StoreUint32Register(reg); |
671 } else { | 677 } else { |
672 translation->StoreInt32Register(reg); | 678 translation->StoreInt32Register(reg); |
673 } | 679 } |
(...skipping 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5416 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5422 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5417 } | 5423 } |
5418 | 5424 |
5419 | 5425 |
5420 #undef __ | 5426 #undef __ |
5421 | 5427 |
5422 } // namespace internal | 5428 } // namespace internal |
5423 } // namespace v8 | 5429 } // namespace v8 |
5424 | 5430 |
5425 #endif // V8_TARGET_ARCH_IA32 | 5431 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |