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 "src/v8.h" | 6 #include "src/v8.h" |
7 | 7 |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 uint16_t pht_entry_num; | 642 uint16_t pht_entry_num; |
643 uint16_t sht_entry_size; | 643 uint16_t sht_entry_size; |
644 uint16_t sht_entry_num; | 644 uint16_t sht_entry_num; |
645 uint16_t sht_strtab_index; | 645 uint16_t sht_strtab_index; |
646 }; | 646 }; |
647 | 647 |
648 | 648 |
649 void WriteHeader(Writer* w) { | 649 void WriteHeader(Writer* w) { |
650 ASSERT(w->position() == 0); | 650 ASSERT(w->position() == 0); |
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 (V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT)) |
653 const uint8_t ident[16] = | 654 const uint8_t ident[16] = |
654 { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 655 { 0x7f, 'E', 'L', 'F', 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
655 #elif V8_TARGET_ARCH_X64 | 656 #elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT |
656 const uint8_t ident[16] = | 657 const uint8_t ident[16] = |
657 { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 658 { 0x7f, 'E', 'L', 'F', 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
658 #else | 659 #else |
659 #error Unsupported target architecture. | 660 #error Unsupported target architecture. |
660 #endif | 661 #endif |
661 memcpy(header->ident, ident, 16); | 662 memcpy(header->ident, ident, 16); |
662 header->type = 1; | 663 header->type = 1; |
663 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87 | 664 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X87 |
664 header->machine = 3; | 665 header->machine = 3; |
665 #elif V8_TARGET_ARCH_X64 | 666 #elif V8_TARGET_ARCH_X64 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 value(value), | 756 value(value), |
756 size(size), | 757 size(size), |
757 info((binding << 4) | type), | 758 info((binding << 4) | type), |
758 other(0), | 759 other(0), |
759 section(section) { | 760 section(section) { |
760 } | 761 } |
761 | 762 |
762 Binding binding() const { | 763 Binding binding() const { |
763 return static_cast<Binding>(info >> 4); | 764 return static_cast<Binding>(info >> 4); |
764 } | 765 } |
765 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X87 | 766 #if (V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X87 || \ |
| 767 (V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT)) |
766 struct SerializedLayout { | 768 struct SerializedLayout { |
767 SerializedLayout(uint32_t name, | 769 SerializedLayout(uint32_t name, |
768 uintptr_t value, | 770 uintptr_t value, |
769 uintptr_t size, | 771 uintptr_t size, |
770 Binding binding, | 772 Binding binding, |
771 Type type, | 773 Type type, |
772 uint16_t section) | 774 uint16_t section) |
773 : name(name), | 775 : name(name), |
774 value(value), | 776 value(value), |
775 size(size), | 777 size(size), |
776 info((binding << 4) | type), | 778 info((binding << 4) | type), |
777 other(0), | 779 other(0), |
778 section(section) { | 780 section(section) { |
779 } | 781 } |
780 | 782 |
781 uint32_t name; | 783 uint32_t name; |
782 uintptr_t value; | 784 uintptr_t value; |
783 uintptr_t size; | 785 uintptr_t size; |
784 uint8_t info; | 786 uint8_t info; |
785 uint8_t other; | 787 uint8_t other; |
786 uint16_t section; | 788 uint16_t section; |
787 }; | 789 }; |
788 #elif V8_TARGET_ARCH_X64 | 790 #elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT |
789 struct SerializedLayout { | 791 struct SerializedLayout { |
790 SerializedLayout(uint32_t name, | 792 SerializedLayout(uint32_t name, |
791 uintptr_t value, | 793 uintptr_t value, |
792 uintptr_t size, | 794 uintptr_t size, |
793 Binding binding, | 795 Binding binding, |
794 Type type, | 796 Type type, |
795 uint16_t section) | 797 uint16_t section) |
796 : name(name), | 798 : name(name), |
797 info((binding << 4) | type), | 799 info((binding << 4) | type), |
798 other(0), | 800 other(0), |
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2167 LockGuard<Mutex> lock_guard(mutex.Pointer()); | 2169 LockGuard<Mutex> lock_guard(mutex.Pointer()); |
2168 ASSERT(!IsLineInfoTagged(line_info)); | 2170 ASSERT(!IsLineInfoTagged(line_info)); |
2169 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); | 2171 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
2170 ASSERT(e->value == NULL); | 2172 ASSERT(e->value == NULL); |
2171 e->value = TagLineInfo(line_info); | 2173 e->value = TagLineInfo(line_info); |
2172 } | 2174 } |
2173 | 2175 |
2174 | 2176 |
2175 } } // namespace v8::internal | 2177 } } // namespace v8::internal |
2176 #endif | 2178 #endif |
OLD | NEW |