OLD | NEW |
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 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 } else { | 2158 } else { |
2159 JITCodeEntry* entry = static_cast<JITCodeEntry*>(e->value); | 2159 JITCodeEntry* entry = static_cast<JITCodeEntry*>(e->value); |
2160 UnregisterCodeEntry(entry); | 2160 UnregisterCodeEntry(entry); |
2161 DestroyCodeEntry(entry); | 2161 DestroyCodeEntry(entry); |
2162 } | 2162 } |
2163 e->value = NULL; | 2163 e->value = NULL; |
2164 GetEntries()->Remove(code, HashForCodeObject(code)); | 2164 GetEntries()->Remove(code, HashForCodeObject(code)); |
2165 } | 2165 } |
2166 | 2166 |
2167 | 2167 |
| 2168 void GDBJITInterface::RemoveCodeRange(Address start, Address end) { |
| 2169 HashMap* entries = GetEntries(); |
| 2170 Zone zone(Isolate::Current()); |
| 2171 ZoneList<Code*> dead_codes(1, &zone); |
| 2172 |
| 2173 for (HashMap::Entry* e = entries->Start(); e != NULL; e = entries->Next(e)) { |
| 2174 Code* code = reinterpret_cast<Code*>(e->key); |
| 2175 if (code->address() >= start && code->address() < end) { |
| 2176 dead_codes.Add(code, &zone); |
| 2177 } |
| 2178 } |
| 2179 |
| 2180 for (int i = 0; i < dead_codes.length(); i++) { |
| 2181 RemoveCode(dead_codes.at(i)); |
| 2182 } |
| 2183 } |
| 2184 |
| 2185 |
2168 void GDBJITInterface::RegisterDetailedLineInfo(Code* code, | 2186 void GDBJITInterface::RegisterDetailedLineInfo(Code* code, |
2169 GDBJITLineInfo* line_info) { | 2187 GDBJITLineInfo* line_info) { |
2170 ScopedLock lock(mutex.Pointer()); | 2188 ScopedLock lock(mutex.Pointer()); |
2171 ASSERT(!IsLineInfoTagged(line_info)); | 2189 ASSERT(!IsLineInfoTagged(line_info)); |
2172 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); | 2190 HashMap::Entry* e = GetEntries()->Lookup(code, HashForCodeObject(code), true); |
2173 ASSERT(e->value == NULL); | 2191 ASSERT(e->value == NULL); |
2174 e->value = TagLineInfo(line_info); | 2192 e->value = TagLineInfo(line_info); |
2175 } | 2193 } |
2176 | 2194 |
2177 | 2195 |
2178 } } // namespace v8::internal | 2196 } } // namespace v8::internal |
2179 #endif | 2197 #endif |
OLD | NEW |