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

Side by Side Diff: src/gdb-jit.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/flags.cc ('k') | src/global-handles.h » ('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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>(); 674 Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>();
675 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM) 675 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_ARM)
676 const uint8_t ident[16] = 676 const uint8_t ident[16] =
677 { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 677 { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
678 #elif defined(V8_TARGET_ARCH_X64) 678 #elif defined(V8_TARGET_ARCH_X64)
679 const uint8_t ident[16] = 679 const uint8_t ident[16] =
680 { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 680 { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0};
681 #else 681 #else
682 #error Unsupported target architecture. 682 #error Unsupported target architecture.
683 #endif 683 #endif
684 memcpy(header->ident, ident, 16); 684 OS::MemCopy(header->ident, ident, 16);
685 header->type = 1; 685 header->type = 1;
686 #if defined(V8_TARGET_ARCH_IA32) 686 #if defined(V8_TARGET_ARCH_IA32)
687 header->machine = 3; 687 header->machine = 3;
688 #elif defined(V8_TARGET_ARCH_X64) 688 #elif defined(V8_TARGET_ARCH_X64)
689 // Processor identification value for x64 is 62 as defined in 689 // Processor identification value for x64 is 62 as defined in
690 // System V ABI, AMD64 Supplement 690 // System V ABI, AMD64 Supplement
691 // http://www.x86-64.org/documentation/abi.pdf 691 // http://www.x86-64.org/documentation/abi.pdf
692 header->machine = 62; 692 header->machine = 62;
693 #elif defined(V8_TARGET_ARCH_ARM) 693 #elif defined(V8_TARGET_ARCH_ARM)
694 // Set to EM_ARM, defined as 40, in "ARM ELF File Format" at 694 // Set to EM_ARM, defined as 40, in "ARM ELF File Format" at
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 } 1848 }
1849 1849
1850 1850
1851 static JITCodeEntry* CreateCodeEntry(Address symfile_addr, 1851 static JITCodeEntry* CreateCodeEntry(Address symfile_addr,
1852 uintptr_t symfile_size) { 1852 uintptr_t symfile_size) {
1853 JITCodeEntry* entry = static_cast<JITCodeEntry*>( 1853 JITCodeEntry* entry = static_cast<JITCodeEntry*>(
1854 malloc(sizeof(JITCodeEntry) + symfile_size)); 1854 malloc(sizeof(JITCodeEntry) + symfile_size));
1855 1855
1856 entry->symfile_addr_ = reinterpret_cast<Address>(entry + 1); 1856 entry->symfile_addr_ = reinterpret_cast<Address>(entry + 1);
1857 entry->symfile_size_ = symfile_size; 1857 entry->symfile_size_ = symfile_size;
1858 memcpy(entry->symfile_addr_, symfile_addr, symfile_size); 1858 OS::MemCopy(entry->symfile_addr_, symfile_addr, symfile_size);
1859 1859
1860 entry->prev_ = entry->next_ = NULL; 1860 entry->prev_ = entry->next_ = NULL;
1861 1861
1862 return entry; 1862 return entry;
1863 } 1863 }
1864 1864
1865 1865
1866 static void DestroyCodeEntry(JITCodeEntry* entry) { 1866 static void DestroyCodeEntry(JITCodeEntry* entry) {
1867 free(entry); 1867 free(entry);
1868 } 1868 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 ScopedLock lock(mutex.Pointer()); 2170 ScopedLock lock(mutex.Pointer());
2171 ASSERT(!IsLineInfoTagged(line_info)); 2171 ASSERT(!IsLineInfoTagged(line_info));
2172 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); 2172 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true);
2173 ASSERT(e->value == NULL); 2173 ASSERT(e->value == NULL);
2174 e->value = TagLineInfo(line_info); 2174 e->value = TagLineInfo(line_info);
2175 } 2175 }
2176 2176
2177 2177
2178 } } // namespace v8::internal 2178 } } // namespace v8::internal
2179 #endif 2179 #endif
OLDNEW
« no previous file with comments | « src/flags.cc ('k') | src/global-handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698