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

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

Issue 2842066: Merge revision 5127 to trunk to fix aliasing problem in inlined... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 5 months 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 | « no previous file | src/version.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 8899 matching lines...) Expand 10 before | Expand all | Expand 10 after
8910 8910
8911 // The initial (invalid) offset has to be large enough to force a 32-bit 8911 // The initial (invalid) offset has to be large enough to force a 32-bit
8912 // instruction encoding to allow patching with an arbitrary offset. Use 8912 // instruction encoding to allow patching with an arbitrary offset. Use
8913 // kMaxInt (minus kHeapObjectTag). 8913 // kMaxInt (minus kHeapObjectTag).
8914 int offset = kMaxInt; 8914 int offset = kMaxInt;
8915 __ mov(FieldOperand(receiver.reg(), offset), value.reg()); 8915 __ mov(FieldOperand(receiver.reg(), offset), value.reg());
8916 __ mov(result.reg(), Operand(value.reg())); 8916 __ mov(result.reg(), Operand(value.reg()));
8917 8917
8918 // Allocate scratch register for write barrier. 8918 // Allocate scratch register for write barrier.
8919 Result scratch = allocator()->Allocate(); 8919 Result scratch = allocator()->Allocate();
8920 ASSERT(scratch.is_valid() && 8920 ASSERT(scratch.is_valid());
8921 result.is_valid() &&
8922 receiver.is_valid() &&
8923 value.is_valid());
8924 8921
8925 // The write barrier clobbers all input registers, so spill the 8922 // The write barrier clobbers all input registers, so spill the
8926 // receiver and the value. 8923 // receiver and the value.
8927 frame_->Spill(receiver.reg()); 8924 frame_->Spill(receiver.reg());
8928 frame_->Spill(value.reg()); 8925 frame_->Spill(value.reg());
8929 8926
8927 // If the receiver and the value share a register allocate a new
8928 // register for the receiver.
8929 if (receiver.reg().is(value.reg())) {
8930 receiver = allocator()->Allocate();
8931 ASSERT(receiver.is_valid());
8932 __ mov(receiver.reg(), Operand(value.reg()));
8933 }
8934
8930 // Update the write barrier. To save instructions in the inlined 8935 // Update the write barrier. To save instructions in the inlined
8931 // version we do not filter smis. 8936 // version we do not filter smis.
8932 Label skip_write_barrier; 8937 Label skip_write_barrier;
8933 __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier); 8938 __ InNewSpace(receiver.reg(), value.reg(), equal, &skip_write_barrier);
8934 int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site); 8939 int delta_to_record_write = masm_->SizeOfCodeGeneratedSince(&patch_site);
8935 __ lea(scratch.reg(), Operand(receiver.reg(), offset)); 8940 __ lea(scratch.reg(), Operand(receiver.reg(), offset));
8936 __ RecordWriteHelper(receiver.reg(), scratch.reg(), value.reg()); 8941 __ RecordWriteHelper(receiver.reg(), scratch.reg(), value.reg());
8937 if (FLAG_debug_code) { 8942 if (FLAG_debug_code) {
8938 __ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue))); 8943 __ mov(receiver.reg(), Immediate(BitCast<int32_t>(kZapValue)));
8939 __ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue))); 8944 __ mov(value.reg(), Immediate(BitCast<int32_t>(kZapValue)));
(...skipping 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after
13897 masm.GetCode(&desc); 13902 masm.GetCode(&desc);
13898 // Call the function from C++. 13903 // Call the function from C++.
13899 return FUNCTION_CAST<MemCopyFunction>(buffer); 13904 return FUNCTION_CAST<MemCopyFunction>(buffer);
13900 } 13905 }
13901 13906
13902 #undef __ 13907 #undef __
13903 13908
13904 } } // namespace v8::internal 13909 } } // namespace v8::internal
13905 13910
13906 #endif // V8_TARGET_ARCH_IA32 13911 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698