Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 7813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7824 __ mov(object.reg(), Operand(index1.reg(), 0)); | 7824 __ mov(object.reg(), Operand(index1.reg(), 0)); |
| 7825 __ mov(tmp2.reg(), Operand(index2.reg(), 0)); | 7825 __ mov(tmp2.reg(), Operand(index2.reg(), 0)); |
| 7826 __ mov(Operand(index2.reg(), 0), object.reg()); | 7826 __ mov(Operand(index2.reg(), 0), object.reg()); |
| 7827 __ mov(Operand(index1.reg(), 0), tmp2.reg()); | 7827 __ mov(Operand(index1.reg(), 0), tmp2.reg()); |
| 7828 | 7828 |
| 7829 Label done; | 7829 Label done; |
| 7830 __ InNewSpace(tmp1.reg(), tmp2.reg(), equal, &done); | 7830 __ InNewSpace(tmp1.reg(), tmp2.reg(), equal, &done); |
| 7831 // Possible optimization: do a check that both values are Smis | 7831 // Possible optimization: do a check that both values are Smis |
| 7832 // (or them and test against Smi mask.) | 7832 // (or them and test against Smi mask.) |
| 7833 | 7833 |
| 7834 // Since we are swapping two objects, the incremental marker is not disturbed, | |
| 7835 // so we don't call the stub that handles this. TODO(gc): Optimize by | |
| 7836 // checking the scan_on_scavenge flag, probably by calling the stub. | |
| 7834 __ mov(tmp2.reg(), tmp1.reg()); | 7837 __ mov(tmp2.reg(), tmp1.reg()); |
| 7835 __ RecordWriteHelper(tmp2.reg(), index1.reg(), object.reg(), kDontSaveFPRegs); | 7838 __ RememberedSetHelper(tmp2.reg(), |
| 7836 __ RecordWriteHelper(tmp1.reg(), index2.reg(), object.reg(), kDontSaveFPRegs); | 7839 index1.reg(), |
| 7840 object.reg(), | |
| 7841 kDontSaveFPRegs); | |
| 7842 __ RememberedSetHelper(tmp1.reg(), | |
| 7843 index2.reg(), | |
| 7844 object.reg(), | |
| 7845 kDontSaveFPRegs); | |
| 7837 __ bind(&done); | 7846 __ bind(&done); |
| 7838 | 7847 |
| 7839 deferred->BindExit(); | 7848 deferred->BindExit(); |
| 7840 frame_->Push(Factory::undefined_value()); | 7849 frame_->Push(Factory::undefined_value()); |
| 7841 } | 7850 } |
| 7842 | 7851 |
| 7843 | 7852 |
| 7844 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) { | 7853 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) { |
| 7845 Comment cmnt(masm_, "[ GenerateCallFunction"); | 7854 Comment cmnt(masm_, "[ GenerateCallFunction"); |
| 7846 | 7855 |
| (...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9779 ASSERT(receiver.is_valid()); | 9788 ASSERT(receiver.is_valid()); |
| 9780 __ mov(receiver.reg(), Operand(value.reg())); | 9789 __ mov(receiver.reg(), Operand(value.reg())); |
| 9781 } | 9790 } |
| 9782 | 9791 |
| 9783 // Update the write barrier. To save instructions in the inlined | 9792 // Update the write barrier. To save instructions in the inlined |
| 9784 // version we do not filter smis. | 9793 // version we do not filter smis. |
| 9785 Label skip_write_barrier; | 9794 Label skip_write_barrier; |
| 9786 __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier); | 9795 __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier); |
| 9787 int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site); | 9796 int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site); |
| 9788 __ lea(scratch.reg(), Operand(receiver.reg(), offset)); | 9797 __ lea(scratch.reg(), Operand(receiver.reg(), offset)); |
| 9789 __ RecordWriteHelper(receiver.reg(), | 9798 __ RememberedSetHelper(receiver.reg(), |
|
Vyacheslav Egorov (Chromium)
2011/04/06 11:46:40
this place should have an incremental write barrie
Erik Corry
2011/04/06 12:31:28
This whole file is on death row. Comment added.
| |
| 9790 scratch.reg(), | 9799 scratch.reg(), |
| 9791 value.reg(), | 9800 value.reg(), |
| 9792 kDontSaveFPRegs); | 9801 kDontSaveFPRegs); |
| 9793 if (FLAG_debug_code) { | 9802 if (FLAG_debug_code) { |
| 9794 __ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue))); | 9803 __ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue))); |
| 9795 __ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue))); | 9804 __ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue))); |
| 9796 __ mov(scratch.reg(), Immediate(BitCast<int32_t>(kZapValue))); | 9805 __ mov(scratch.reg(), Immediate(BitCast<int32_t>(kZapValue))); |
| 9797 } | 9806 } |
| 9798 __ bind(&skip_write_barrier); | 9807 __ bind(&skip_write_barrier); |
| 9799 value.Unuse(); | 9808 value.Unuse(); |
| 9800 scratch.Unuse(); | 9809 scratch.Unuse(); |
| 9801 receiver.Unuse(); | 9810 receiver.Unuse(); |
| 9802 done.Jump(&result); | 9811 done.Jump(&result); |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10377 memcpy(base, desc.buffer, desc.instr_size); | 10386 memcpy(base, desc.buffer, desc.instr_size); |
| 10378 CPU::FlushICache(base, desc.instr_size); | 10387 CPU::FlushICache(base, desc.instr_size); |
| 10379 return FUNCTION_CAST<MemCopyFunction>(reinterpret_cast<Address>(base)); | 10388 return FUNCTION_CAST<MemCopyFunction>(reinterpret_cast<Address>(base)); |
| 10380 } | 10389 } |
| 10381 | 10390 |
| 10382 #undef __ | 10391 #undef __ |
| 10383 | 10392 |
| 10384 } } // namespace v8::internal | 10393 } } // namespace v8::internal |
| 10385 | 10394 |
| 10386 #endif // V8_TARGET_ARCH_IA32 | 10395 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |