OLD | NEW |
---|---|
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 // want it. | 425 // want it. |
426 if (!fresh.reg().is(backing_element.reg())) { | 426 if (!fresh.reg().is(backing_element.reg())) { |
427 __ movq(fresh.reg(), backing_element.reg()); | 427 __ movq(fresh.reg(), backing_element.reg()); |
428 } | 428 } |
429 } else { | 429 } else { |
430 ASSERT(backing_element.is_memory()); | 430 ASSERT(backing_element.is_memory()); |
431 __ movq(fresh.reg(), Operand(rbp, fp_relative(element.index()))); | 431 __ movq(fresh.reg(), Operand(rbp, fp_relative(element.index()))); |
432 } | 432 } |
433 } | 433 } |
434 } | 434 } |
435 // No need to set the copied flag---there are no copies. | 435 // No need to set the copied flag---there are no copies. |
Erik Corry
2009/06/24 11:46:35
The comment here doesn't match the comment in the
| |
436 elements_[i].set_static_type(StaticType::unknown()); | |
437 } else { | 436 } else { |
438 // Clear the copy flag of non-constant, non-copy elements. | 437 // Clear the copy flag of non-constant, non-copy elements. |
439 // They cannot be copied because copies are not allowed. | 438 // They cannot be copied because copies are not allowed. |
440 // The copy flag is not relied on before the end of this loop, | 439 // The copy flag is not relied on before the end of this loop, |
441 // including when registers are spilled. | 440 // including when registers are spilled. |
442 elements_[i].clear_copied(); | 441 elements_[i].clear_copied(); |
443 } | 442 } |
444 } | 443 } |
445 } | 444 } |
446 | 445 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
644 FrameElement element = elements_.RemoveLast(); | 643 FrameElement element = elements_.RemoveLast(); |
645 int index = element_count(); | 644 int index = element_count(); |
646 ASSERT(element.is_valid()); | 645 ASSERT(element.is_valid()); |
647 | 646 |
648 bool pop_needed = (stack_pointer_ == index); | 647 bool pop_needed = (stack_pointer_ == index); |
649 if (pop_needed) { | 648 if (pop_needed) { |
650 stack_pointer_--; | 649 stack_pointer_--; |
651 if (element.is_memory()) { | 650 if (element.is_memory()) { |
652 Result temp = cgen()->allocator()->Allocate(); | 651 Result temp = cgen()->allocator()->Allocate(); |
653 ASSERT(temp.is_valid()); | 652 ASSERT(temp.is_valid()); |
654 temp.set_static_type(element.static_type()); | |
655 __ pop(temp.reg()); | 653 __ pop(temp.reg()); |
656 return temp; | 654 return temp; |
657 } | 655 } |
658 | 656 |
659 __ addq(rsp, Immediate(kPointerSize)); | 657 __ addq(rsp, Immediate(kPointerSize)); |
660 } | 658 } |
661 ASSERT(!element.is_memory()); | 659 ASSERT(!element.is_memory()); |
662 | 660 |
663 // The top element is a register, constant, or a copy. Unuse | 661 // The top element is a register, constant, or a copy. Unuse |
664 // registers and follow copies to their backing store. | 662 // registers and follow copies to their backing store. |
(...skipping 11 matching lines...) Expand all Loading... | |
676 // Memory elements could only be the backing store of a copy. | 674 // Memory elements could only be the backing store of a copy. |
677 // Allocate the original to a register. | 675 // Allocate the original to a register. |
678 ASSERT(index <= stack_pointer_); | 676 ASSERT(index <= stack_pointer_); |
679 Result temp = cgen()->allocator()->Allocate(); | 677 Result temp = cgen()->allocator()->Allocate(); |
680 ASSERT(temp.is_valid()); | 678 ASSERT(temp.is_valid()); |
681 Use(temp.reg(), index); | 679 Use(temp.reg(), index); |
682 FrameElement new_element = | 680 FrameElement new_element = |
683 FrameElement::RegisterElement(temp.reg(), FrameElement::SYNCED); | 681 FrameElement::RegisterElement(temp.reg(), FrameElement::SYNCED); |
684 // Preserve the copy flag on the element. | 682 // Preserve the copy flag on the element. |
685 if (element.is_copied()) new_element.set_copied(); | 683 if (element.is_copied()) new_element.set_copied(); |
686 new_element.set_static_type(element.static_type()); | |
687 elements_[index] = new_element; | 684 elements_[index] = new_element; |
688 __ movq(temp.reg(), Operand(rbp, fp_relative(index))); | 685 __ movq(temp.reg(), Operand(rbp, fp_relative(index))); |
689 return Result(temp.reg(), element.static_type()); | 686 return Result(temp.reg()); |
690 } else if (element.is_register()) { | 687 } else if (element.is_register()) { |
691 return Result(element.reg(), element.static_type()); | 688 return Result(element.reg()); |
692 } else { | 689 } else { |
693 ASSERT(element.is_constant()); | 690 ASSERT(element.is_constant()); |
694 return Result(element.handle()); | 691 return Result(element.handle()); |
695 } | 692 } |
696 } | 693 } |
697 | 694 |
698 | 695 |
699 Result VirtualFrame::RawCallStub(CodeStub* stub) { | 696 Result VirtualFrame::RawCallStub(CodeStub* stub) { |
700 ASSERT(cgen()->HasValidEntryRegisters()); | 697 ASSERT(cgen()->HasValidEntryRegisters()); |
701 __ CallStub(stub); | 698 __ CallStub(stub); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
957 | 954 |
958 name.Unuse(); | 955 name.Unuse(); |
959 value.Unuse(); | 956 value.Unuse(); |
960 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); | 957 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); |
961 } | 958 } |
962 | 959 |
963 | 960 |
964 #undef __ | 961 #undef __ |
965 | 962 |
966 } } // namespace v8::internal | 963 } } // namespace v8::internal |
OLD | NEW |