| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifdef ENABLE_GDB_JIT_INTERFACE | 5 #ifdef ENABLE_GDB_JIT_INTERFACE |
| 6 #include "v8.h" | 6 #include "v8.h" |
| 7 #include "gdb-jit.h" | 7 #include "gdb-jit.h" |
| 8 | 8 |
| 9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
| 10 #include "compiler.h" | 10 #include "compiler.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>(); | 651 Writer::Slot<ELFHeader> header = w->CreateSlotHere<ELFHeader>(); |
| 652 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X87 | 652 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X87 |
| 653 const uint8_t ident[16] = | 653 const uint8_t ident[16] = |
| 654 { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 654 { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
| 655 #elif V8_TARGET_ARCH_X64 | 655 #elif V8_TARGET_ARCH_X64 |
| 656 const uint8_t ident[16] = | 656 const uint8_t ident[16] = |
| 657 { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 657 { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
| 658 #else | 658 #else |
| 659 #error Unsupported target architecture. | 659 #error Unsupported target architecture. |
| 660 #endif | 660 #endif |
| 661 MemCopy(header->ident, ident, 16); | 661 OS::MemCopy(header->ident, ident, 16); |
| 662 header->type = 1; | 662 header->type = 1; |
| 663 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87 | 663 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87 |
| 664 header->machine = 3; | 664 header->machine = 3; |
| 665 #elif V8_TARGET_ARCH_X64 | 665 #elif V8_TARGET_ARCH_X64 |
| 666 // Processor identification value for x64 is 62 as defined in | 666 // Processor identification value for x64 is 62 as defined in |
| 667 // System V ABI, AMD64 Supplement | 667 // System V ABI, AMD64 Supplement |
| 668 // http://www.x86-64.org/documentation/abi.pdf | 668 // http://www.x86-64.org/documentation/abi.pdf |
| 669 header->machine = 62; | 669 header->machine = 62; |
| 670 #elif V8_TARGET_ARCH_ARM | 670 #elif V8_TARGET_ARCH_ARM |
| 671 // Set to EM_ARM, defined as 40, in "ARM ELF File Format" at | 671 // Set to EM_ARM, defined as 40, in "ARM ELF File Format" at |
| (...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 } | 1826 } |
| 1827 | 1827 |
| 1828 | 1828 |
| 1829 static JITCodeEntry* CreateCodeEntry(Address symfile_addr, | 1829 static JITCodeEntry* CreateCodeEntry(Address symfile_addr, |
| 1830 uintptr_t symfile_size) { | 1830 uintptr_t symfile_size) { |
| 1831 JITCodeEntry* entry = static_cast<JITCodeEntry*>( | 1831 JITCodeEntry* entry = static_cast<JITCodeEntry*>( |
| 1832 malloc(sizeof(JITCodeEntry) + symfile_size)); | 1832 malloc(sizeof(JITCodeEntry) + symfile_size)); |
| 1833 | 1833 |
| 1834 entry->symfile_addr_ = reinterpret_cast<Address>(entry + 1); | 1834 entry->symfile_addr_ = reinterpret_cast<Address>(entry + 1); |
| 1835 entry->symfile_size_ = symfile_size; | 1835 entry->symfile_size_ = symfile_size; |
| 1836 MemCopy(entry->symfile_addr_, symfile_addr, symfile_size); | 1836 OS::MemCopy(entry->symfile_addr_, symfile_addr, symfile_size); |
| 1837 | 1837 |
| 1838 entry->prev_ = entry->next_ = NULL; | 1838 entry->prev_ = entry->next_ = NULL; |
| 1839 | 1839 |
| 1840 return entry; | 1840 return entry; |
| 1841 } | 1841 } |
| 1842 | 1842 |
| 1843 | 1843 |
| 1844 static void DestroyCodeEntry(JITCodeEntry* entry) { | 1844 static void DestroyCodeEntry(JITCodeEntry* entry) { |
| 1845 free(entry); | 1845 free(entry); |
| 1846 } | 1846 } |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2167 LockGuard<Mutex> lock_guard(mutex.Pointer()); | 2167 LockGuard<Mutex> lock_guard(mutex.Pointer()); |
| 2168 ASSERT(!IsLineInfoTagged(line_info)); | 2168 ASSERT(!IsLineInfoTagged(line_info)); |
| 2169 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); | 2169 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
| 2170 ASSERT(e->value == NULL); | 2170 ASSERT(e->value == NULL); |
| 2171 e->value = TagLineInfo(line_info); | 2171 e->value = TagLineInfo(line_info); |
| 2172 } | 2172 } |
| 2173 | 2173 |
| 2174 | 2174 |
| 2175 } } // namespace v8::internal | 2175 } } // namespace v8::internal |
| 2176 #endif | 2176 #endif |
| OLD | NEW |