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

Side by Side Diff: src/mips/assembler-mips.cc

Issue 13932006: Replace OS::MemCopy with OS::MemMove (just as fast but more flexible). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 8 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 | « src/log-utils.cc ('k') | src/mips/lithium-codegen-mips.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 GenInstrRegister(COP1, CTC1, rt, fs); 1672 GenInstrRegister(COP1, CTC1, rt, fs);
1673 } 1673 }
1674 1674
1675 1675
1676 void Assembler::cfc1(Register rt, FPUControlRegister fs) { 1676 void Assembler::cfc1(Register rt, FPUControlRegister fs) {
1677 GenInstrRegister(COP1, CFC1, rt, fs); 1677 GenInstrRegister(COP1, CFC1, rt, fs);
1678 } 1678 }
1679 1679
1680 void Assembler::DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { 1680 void Assembler::DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) {
1681 uint64_t i; 1681 uint64_t i;
1682 memcpy(&i, &d, 8); 1682 OS::MemCopy(&i, &d, 8);
1683 1683
1684 *lo = i & 0xffffffff; 1684 *lo = i & 0xffffffff;
1685 *hi = i >> 32; 1685 *hi = i >> 32;
1686 } 1686 }
1687 1687
1688 // Arithmetic. 1688 // Arithmetic.
1689 1689
1690 void Assembler::add_d(FPURegister fd, FPURegister fs, FPURegister ft) { 1690 void Assembler::add_d(FPURegister fd, FPURegister fs, FPURegister ft) {
1691 GenInstrRegister(COP1, D, ft, fs, fd, ADD_D); 1691 GenInstrRegister(COP1, D, ft, fs, fd, ADD_D);
1692 } 1692 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1990 1990
1991 // Set up new buffer. 1991 // Set up new buffer.
1992 desc.buffer = NewArray<byte>(desc.buffer_size); 1992 desc.buffer = NewArray<byte>(desc.buffer_size);
1993 1993
1994 desc.instr_size = pc_offset(); 1994 desc.instr_size = pc_offset();
1995 desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); 1995 desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
1996 1996
1997 // Copy the data. 1997 // Copy the data.
1998 int pc_delta = desc.buffer - buffer_; 1998 int pc_delta = desc.buffer - buffer_;
1999 int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_); 1999 int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
2000 memmove(desc.buffer, buffer_, desc.instr_size); 2000 OS::MemMove(desc.buffer, buffer_, desc.instr_size);
2001 memmove(reloc_info_writer.pos() + rc_delta, 2001 OS::MemMove(reloc_info_writer.pos() + rc_delta,
2002 reloc_info_writer.pos(), desc.reloc_size); 2002 reloc_info_writer.pos(), desc.reloc_size);
2003 2003
2004 // Switch buffers. 2004 // Switch buffers.
2005 DeleteArray(buffer_); 2005 DeleteArray(buffer_);
2006 buffer_ = desc.buffer; 2006 buffer_ = desc.buffer;
2007 buffer_size_ = desc.buffer_size; 2007 buffer_size_ = desc.buffer_size;
2008 pc_ += pc_delta; 2008 pc_ += pc_delta;
2009 reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta, 2009 reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
2010 reloc_info_writer.last_pc() + pc_delta); 2010 reloc_info_writer.last_pc() + pc_delta);
2011 2011
2012 // Relocate runtime entries. 2012 // Relocate runtime entries.
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 } 2298 }
2299 2299
2300 if (patched) { 2300 if (patched) {
2301 CPU::FlushICache(pc+2, sizeof(Address)); 2301 CPU::FlushICache(pc+2, sizeof(Address));
2302 } 2302 }
2303 } 2303 }
2304 2304
2305 } } // namespace v8::internal 2305 } } // namespace v8::internal
2306 2306
2307 #endif // V8_TARGET_ARCH_MIPS 2307 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/log-utils.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698