| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 | 1965 |
| 1966 static HashMap* GetLineMap() { | 1966 static HashMap* GetLineMap() { |
| 1967 static HashMap* line_map = NULL; | 1967 static HashMap* line_map = NULL; |
| 1968 if (line_map == NULL) line_map = new HashMap(&HashMap::PointersMatch); | 1968 if (line_map == NULL) line_map = new HashMap(&HashMap::PointersMatch); |
| 1969 return line_map; | 1969 return line_map; |
| 1970 } | 1970 } |
| 1971 | 1971 |
| 1972 | 1972 |
| 1973 static void PutLineInfo(Address addr, LineInfo* info) { | 1973 static void PutLineInfo(Address addr, LineInfo* info) { |
| 1974 HashMap* line_map = GetLineMap(); | 1974 HashMap* line_map = GetLineMap(); |
| 1975 HashMap::Entry* e = line_map->Lookup(addr, HashCodeAddress(addr), true); | 1975 HashMap::Entry* e = line_map->LookupOrInsert(addr, HashCodeAddress(addr)); |
| 1976 if (e->value != NULL) delete static_cast<LineInfo*>(e->value); | 1976 if (e->value != NULL) delete static_cast<LineInfo*>(e->value); |
| 1977 e->value = info; | 1977 e->value = info; |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 | 1980 |
| 1981 static LineInfo* GetLineInfo(Address addr) { | 1981 static LineInfo* GetLineInfo(Address addr) { |
| 1982 void* value = GetLineMap()->Remove(addr, HashCodeAddress(addr)); | 1982 void* value = GetLineMap()->Remove(addr, HashCodeAddress(addr)); |
| 1983 return static_cast<LineInfo*>(value); | 1983 return static_cast<LineInfo*>(value); |
| 1984 } | 1984 } |
| 1985 | 1985 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2159 LineInfo* line_info = reinterpret_cast<LineInfo*>(event->user_data); | 2159 LineInfo* line_info = reinterpret_cast<LineInfo*>(event->user_data); |
| 2160 PutLineInfo(reinterpret_cast<Address>(event->code_start), line_info); | 2160 PutLineInfo(reinterpret_cast<Address>(event->code_start), line_info); |
| 2161 break; | 2161 break; |
| 2162 } | 2162 } |
| 2163 } | 2163 } |
| 2164 } | 2164 } |
| 2165 #endif | 2165 #endif |
| 2166 } // namespace GDBJITInterface | 2166 } // namespace GDBJITInterface |
| 2167 } // namespace internal | 2167 } // namespace internal |
| 2168 } // namespace v8 | 2168 } // namespace v8 |
| OLD | NEW |