Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 5745005: Provide baseline GC version. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap-inl.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7668 matching lines...) Expand 10 before | Expand all | Expand 10 after
7679 // Bring addresses into index1 and index2. 7679 // Bring addresses into index1 and index2.
7680 __ lea(index1.reg(), FixedArrayElementOperand(tmp1.reg(), index1.reg())); 7680 __ lea(index1.reg(), FixedArrayElementOperand(tmp1.reg(), index1.reg()));
7681 __ lea(index2.reg(), FixedArrayElementOperand(tmp1.reg(), index2.reg())); 7681 __ lea(index2.reg(), FixedArrayElementOperand(tmp1.reg(), index2.reg()));
7682 7682
7683 // Swap elements. 7683 // Swap elements.
7684 __ mov(object.reg(), Operand(index1.reg(), 0)); 7684 __ mov(object.reg(), Operand(index1.reg(), 0));
7685 __ mov(tmp2.reg(), Operand(index2.reg(), 0)); 7685 __ mov(tmp2.reg(), Operand(index2.reg(), 0));
7686 __ mov(Operand(index2.reg(), 0), object.reg()); 7686 __ mov(Operand(index2.reg(), 0), object.reg());
7687 __ mov(Operand(index1.reg(), 0), tmp2.reg()); 7687 __ mov(Operand(index1.reg(), 0), tmp2.reg());
7688 7688
7689 #ifndef BASELINE_GC
7689 Label done; 7690 Label done;
7690 __ InNewSpace(tmp1.reg(), tmp2.reg(), equal, &done); 7691 __ InNewSpace(tmp1.reg(), tmp2.reg(), equal, &done);
7691 // Possible optimization: do a check that both values are Smis 7692 // Possible optimization: do a check that both values are Smis
7692 // (or them and test against Smi mask.) 7693 // (or them and test against Smi mask.)
7693 7694
7694 __ mov(tmp2.reg(), tmp1.reg()); 7695 __ mov(tmp2.reg(), tmp1.reg());
7695 __ RecordWriteHelper(tmp2.reg(), index1.reg(), object.reg()); 7696 __ RecordWriteHelper(tmp2.reg(), index1.reg(), object.reg());
7696 __ RecordWriteHelper(tmp1.reg(), index2.reg(), object.reg()); 7697 __ RecordWriteHelper(tmp1.reg(), index2.reg(), object.reg());
7697 __ bind(&done); 7698 __ bind(&done);
7699 #endif
7698 7700
7699 deferred->BindExit(); 7701 deferred->BindExit();
7700 frame_->Push(Factory::undefined_value()); 7702 frame_->Push(Factory::undefined_value());
7701 } 7703 }
7702 7704
7703 7705
7704 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) { 7706 void CodeGenerator::GenerateCallFunction(ZoneList<Expression*>* args) {
7705 Comment cmnt(masm_, "[ GenerateCallFunction"); 7707 Comment cmnt(masm_, "[ GenerateCallFunction");
7706 7708
7707 ASSERT(args->length() >= 2); 7709 ASSERT(args->length() >= 2);
(...skipping 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after
9625 // If the receiver and the value share a register allocate a new 9627 // If the receiver and the value share a register allocate a new
9626 // register for the receiver. 9628 // register for the receiver.
9627 if (receiver.reg().is(value.reg())) { 9629 if (receiver.reg().is(value.reg())) {
9628 receiver = allocator()->Allocate(); 9630 receiver = allocator()->Allocate();
9629 ASSERT(receiver.is_valid()); 9631 ASSERT(receiver.is_valid());
9630 __ mov(receiver.reg(), Operand(value.reg())); 9632 __ mov(receiver.reg(), Operand(value.reg()));
9631 } 9633 }
9632 9634
9633 // Update the write barrier. To save instructions in the inlined 9635 // Update the write barrier. To save instructions in the inlined
9634 // version we do not filter smis. 9636 // version we do not filter smis.
9637 #ifndef BASELINE_GC
9635 Label skip_write_barrier; 9638 Label skip_write_barrier;
9636 __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier); 9639 __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier);
9637 int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site); 9640 int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site);
9638 __ lea(scratch.reg(), Operand(receiver.reg(), offset)); 9641 __ lea(scratch.reg(), Operand(receiver.reg(), offset));
9639 __ RecordWriteHelper(receiver.reg(), scratch.reg(), value.reg()); 9642 __ RecordWriteHelper(receiver.reg(), scratch.reg(), value.reg());
9640 if (FLAG_debug_code) { 9643 if (FLAG_debug_code) {
9641 __ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue))); 9644 __ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue)));
9642 __ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue))); 9645 __ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue)));
9643 __ mov(scratch.reg(), Immediate(BitCast<int32_t>(kZapValue))); 9646 __ mov(scratch.reg(), Immediate(BitCast<int32_t>(kZapValue)));
9644 } 9647 }
9645 __ bind(&skip_write_barrier); 9648 __ bind(&skip_write_barrier);
9649 #endif
9646 value.Unuse(); 9650 value.Unuse();
9647 scratch.Unuse(); 9651 scratch.Unuse();
9648 receiver.Unuse(); 9652 receiver.Unuse();
9649 done.Jump(&result); 9653 done.Jump(&result);
9650 9654
9651 slow.Bind(&value, &receiver); 9655 slow.Bind(&value, &receiver);
9652 frame()->Push(&receiver); 9656 frame()->Push(&receiver);
9653 frame()->Push(&value); 9657 frame()->Push(&value);
9654 result = frame()->CallStoreIC(name, is_contextual); 9658 result = frame()->CallStoreIC(name, is_contextual);
9655 // Encode the offset to the map check instruction and the offset 9659 // Encode the offset to the map check instruction and the offset
9656 // to the write barrier store address computation in a test eax 9660 // to the write barrier store address computation in a test eax
9657 // instruction. 9661 // instruction.
9658 int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(&patch_site); 9662 int delta_to_patch_site = masm_->SizeOfCodeGeneratedSince(&patch_site);
9663 #ifndef BASELINE_GC
9659 __ test(eax, 9664 __ test(eax,
9660 Immediate((delta_to_record_write << 16) | delta_to_patch_site)); 9665 Immediate((delta_to_record_write << 16) | delta_to_patch_site));
9666 #else
9667 __ test(eax,
9668 Immediate(delta_to_patch_site));
Vitaly Repeshko 2010/12/13 13:38:01 This can cause short encoding for the test instruc
9669 #endif
9661 done.Bind(&result); 9670 done.Bind(&result);
9662 } 9671 }
9663 9672
9664 ASSERT_EQ(expected_height, frame()->height()); 9673 ASSERT_EQ(expected_height, frame()->height());
9665 return result; 9674 return result;
9666 } 9675 }
9667 9676
9668 9677
9669 Result CodeGenerator::EmitKeyedLoad() { 9678 Result CodeGenerator::EmitKeyedLoad() {
9670 #ifdef DEBUG 9679 #ifdef DEBUG
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
10217 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10226 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10218 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10227 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10219 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10228 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10220 } 10229 }
10221 10230
10222 #undef __ 10231 #undef __
10223 10232
10224 } } // namespace v8::internal 10233 } } // namespace v8::internal
10225 10234
10226 #endif // V8_TARGET_ARCH_IA32 10235 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698