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/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 Writer w(&mach_o); | 1923 Writer w(&mach_o); |
1924 | 1924 |
1925 mach_o.AddSection(new(&zone) MachOTextSection(kCodeAlignment, | 1925 mach_o.AddSection(new(&zone) MachOTextSection(kCodeAlignment, |
1926 desc->CodeStart(), | 1926 desc->CodeStart(), |
1927 desc->CodeSize())); | 1927 desc->CodeSize())); |
1928 | 1928 |
1929 CreateDWARFSections(desc, &zone, &mach_o); | 1929 CreateDWARFSections(desc, &zone, &mach_o); |
1930 | 1930 |
1931 mach_o.Write(&w, desc->CodeStart(), desc->CodeSize()); | 1931 mach_o.Write(&w, desc->CodeStart(), desc->CodeSize()); |
1932 #else | 1932 #else |
1933 Zone zone(isolate); | 1933 Zone zone; |
1934 ELF elf(&zone); | 1934 ELF elf(&zone); |
1935 Writer w(&elf); | 1935 Writer w(&elf); |
1936 | 1936 |
1937 int text_section_index = elf.AddSection( | 1937 int text_section_index = elf.AddSection( |
1938 new(&zone) FullHeaderELFSection( | 1938 new(&zone) FullHeaderELFSection( |
1939 ".text", | 1939 ".text", |
1940 ELFSection::TYPE_NOBITS, | 1940 ELFSection::TYPE_NOBITS, |
1941 kCodeAlignment, | 1941 kCodeAlignment, |
1942 desc->CodeStart(), | 1942 desc->CodeStart(), |
1943 0, | 1943 0, |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 UnregisterCodeEntry(entry); | 2120 UnregisterCodeEntry(entry); |
2121 DestroyCodeEntry(entry); | 2121 DestroyCodeEntry(entry); |
2122 } | 2122 } |
2123 e->value = NULL; | 2123 e->value = NULL; |
2124 GetEntries()->Remove(code, HashForCodeObject(code)); | 2124 GetEntries()->Remove(code, HashForCodeObject(code)); |
2125 } | 2125 } |
2126 | 2126 |
2127 | 2127 |
2128 void GDBJITInterface::RemoveCodeRange(Address start, Address end) { | 2128 void GDBJITInterface::RemoveCodeRange(Address start, Address end) { |
2129 HashMap* entries = GetEntries(); | 2129 HashMap* entries = GetEntries(); |
2130 Zone zone(Isolate::Current()); | 2130 Zone zone; |
2131 ZoneList<Code*> dead_codes(1, &zone); | 2131 ZoneList<Code*> dead_codes(1, &zone); |
2132 | 2132 |
2133 for (HashMap::Entry* e = entries->Start(); e != NULL; e = entries->Next(e)) { | 2133 for (HashMap::Entry* e = entries->Start(); e != NULL; e = entries->Next(e)) { |
2134 Code* code = reinterpret_cast<Code*>(e->key); | 2134 Code* code = reinterpret_cast<Code*>(e->key); |
2135 if (code->address() >= start && code->address() < end) { | 2135 if (code->address() >= start && code->address() < end) { |
2136 dead_codes.Add(code, &zone); | 2136 dead_codes.Add(code, &zone); |
2137 } | 2137 } |
2138 } | 2138 } |
2139 | 2139 |
2140 for (int i = 0; i < dead_codes.length(); i++) { | 2140 for (int i = 0; i < dead_codes.length(); i++) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 reinterpret_cast<Address>(event->code_start)); | 2195 reinterpret_cast<Address>(event->code_start)); |
2196 RegisterDetailedLineInfo(code, line_info); | 2196 RegisterDetailedLineInfo(code, line_info); |
2197 break; | 2197 break; |
2198 } | 2198 } |
2199 } | 2199 } |
2200 } | 2200 } |
2201 | 2201 |
2202 | 2202 |
2203 } } // namespace v8::internal | 2203 } } // namespace v8::internal |
2204 #endif | 2204 #endif |
OLD | NEW |