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

Side by Side Diff: src/arm/assembler-arm.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/api.cc ('k') | src/arm/constants-arm.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 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are 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 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 1989
1990 int sd, d; 1990 int sd, d;
1991 first.split_code(&sd, &d); 1991 first.split_code(&sd, &d);
1992 int count = last.code() - first.code() + 1; 1992 int count = last.code() - first.code() + 1;
1993 emit(cond | B27 | B26 | am | d*B22 | base.code()*B16 | sd*B12 | 1993 emit(cond | B27 | B26 | am | d*B22 | base.code()*B16 | sd*B12 |
1994 0xA*B8 | count); 1994 0xA*B8 | count);
1995 } 1995 }
1996 1996
1997 static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) { 1997 static void DoubleAsTwoUInt32(double d, uint32_t* lo, uint32_t* hi) {
1998 uint64_t i; 1998 uint64_t i;
1999 memcpy(&i, &d, 8); 1999 OS::MemCopy(&i, &d, 8);
2000 2000
2001 *lo = i & 0xffffffff; 2001 *lo = i & 0xffffffff;
2002 *hi = i >> 32; 2002 *hi = i >> 32;
2003 } 2003 }
2004 2004
2005 // Only works for little endian floating point formats. 2005 // Only works for little endian floating point formats.
2006 // We don't support VFP on the mixed endian floating point platform. 2006 // We don't support VFP on the mixed endian floating point platform.
2007 static bool FitsVMOVDoubleImmediate(double d, uint32_t *encoding) { 2007 static bool FitsVMOVDoubleImmediate(double d, uint32_t *encoding) {
2008 ASSERT(CpuFeatures::IsSupported(VFP3)); 2008 ASSERT(CpuFeatures::IsSupported(VFP3));
2009 2009
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 2693
2694 // Set up new buffer. 2694 // Set up new buffer.
2695 desc.buffer = NewArray<byte>(desc.buffer_size); 2695 desc.buffer = NewArray<byte>(desc.buffer_size);
2696 2696
2697 desc.instr_size = pc_offset(); 2697 desc.instr_size = pc_offset();
2698 desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos(); 2698 desc.reloc_size = (buffer_ + buffer_size_) - reloc_info_writer.pos();
2699 2699
2700 // Copy the data. 2700 // Copy the data.
2701 int pc_delta = desc.buffer - buffer_; 2701 int pc_delta = desc.buffer - buffer_;
2702 int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_); 2702 int rc_delta = (desc.buffer + desc.buffer_size) - (buffer_ + buffer_size_);
2703 memmove(desc.buffer, buffer_, desc.instr_size); 2703 OS::MemMove(desc.buffer, buffer_, desc.instr_size);
2704 memmove(reloc_info_writer.pos() + rc_delta, 2704 OS::MemMove(reloc_info_writer.pos() + rc_delta,
2705 reloc_info_writer.pos(), desc.reloc_size); 2705 reloc_info_writer.pos(), desc.reloc_size);
2706 2706
2707 // Switch buffers. 2707 // Switch buffers.
2708 DeleteArray(buffer_); 2708 DeleteArray(buffer_);
2709 buffer_ = desc.buffer; 2709 buffer_ = desc.buffer;
2710 buffer_size_ = desc.buffer_size; 2710 buffer_size_ = desc.buffer_size;
2711 pc_ += pc_delta; 2711 pc_ += pc_delta;
2712 reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta, 2712 reloc_info_writer.Reposition(reloc_info_writer.pos() + rc_delta,
2713 reloc_info_writer.last_pc() + pc_delta); 2713 reloc_info_writer.last_pc() + pc_delta);
2714 2714
2715 // None of our relocation types are pc relative pointing outside the code 2715 // None of our relocation types are pc relative pointing outside the code
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
2944 ASSERT((IsVldrDPcImmediateOffset(instr) && 2944 ASSERT((IsVldrDPcImmediateOffset(instr) &&
2945 GetVldrDRegisterImmediateOffset(instr) == 0)); 2945 GetVldrDRegisterImmediateOffset(instr) == 0));
2946 2946
2947 int delta = pc_ - rinfo.pc() - kPcLoadDelta; 2947 int delta = pc_ - rinfo.pc() - kPcLoadDelta;
2948 ASSERT(is_uint10(delta)); 2948 ASSERT(is_uint10(delta));
2949 2949
2950 instr_at_put(rinfo.pc(), SetVldrDRegisterImmediateOffset(instr, delta)); 2950 instr_at_put(rinfo.pc(), SetVldrDRegisterImmediateOffset(instr, delta));
2951 2951
2952 const double double_data = rinfo.data64(); 2952 const double double_data = rinfo.data64();
2953 uint64_t uint_data = 0; 2953 uint64_t uint_data = 0;
2954 memcpy(&uint_data, &double_data, sizeof(double_data)); 2954 OS::MemCopy(&uint_data, &double_data, sizeof(double_data));
2955 emit(uint_data & 0xFFFFFFFF); 2955 emit(uint_data & 0xFFFFFFFF);
2956 emit(uint_data >> 32); 2956 emit(uint_data >> 32);
2957 } 2957 }
2958 2958
2959 // Emit 32-bit constant pool entries. 2959 // Emit 32-bit constant pool entries.
2960 for (int i = 0; i < num_pending_reloc_info_; i++) { 2960 for (int i = 0; i < num_pending_reloc_info_; i++) {
2961 RelocInfo& rinfo = pending_reloc_info_[i]; 2961 RelocInfo& rinfo = pending_reloc_info_[i];
2962 ASSERT(rinfo.rmode() != RelocInfo::COMMENT && 2962 ASSERT(rinfo.rmode() != RelocInfo::COMMENT &&
2963 rinfo.rmode() != RelocInfo::POSITION && 2963 rinfo.rmode() != RelocInfo::POSITION &&
2964 rinfo.rmode() != RelocInfo::STATEMENT_POSITION && 2964 rinfo.rmode() != RelocInfo::STATEMENT_POSITION &&
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
3004 3004
3005 // Since a constant pool was just emitted, move the check offset forward by 3005 // Since a constant pool was just emitted, move the check offset forward by
3006 // the standard interval. 3006 // the standard interval.
3007 next_buffer_check_ = pc_offset() + kCheckPoolInterval; 3007 next_buffer_check_ = pc_offset() + kCheckPoolInterval;
3008 } 3008 }
3009 3009
3010 3010
3011 } } // namespace v8::internal 3011 } } // namespace v8::internal
3012 3012
3013 #endif // V8_TARGET_ARCH_ARM 3013 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm/constants-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698