OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 void Add(Handle<Script> script); | 171 void Add(Handle<Script> script); |
172 | 172 |
173 // Return the scripts in the cache. | 173 // Return the scripts in the cache. |
174 Handle<FixedArray> GetScripts(); | 174 Handle<FixedArray> GetScripts(); |
175 | 175 |
176 // Generate debugger events for collected scripts. | 176 // Generate debugger events for collected scripts. |
177 void ProcessCollectedScripts(); | 177 void ProcessCollectedScripts(); |
178 | 178 |
179 private: | 179 private: |
180 // Calculate the hash value from the key (script id). | 180 // Calculate the hash value from the key (script id). |
181 static uint32_t Hash(int key) { return ComputeIntegerHash(key); } | 181 static uint32_t Hash(int key) { |
| 182 return ComputeIntegerHash(key, v8::internal::kZeroHashSeed); |
| 183 } |
182 | 184 |
183 // Scripts match if their keys (script id) match. | 185 // Scripts match if their keys (script id) match. |
184 static bool ScriptMatch(void* key1, void* key2) { return key1 == key2; } | 186 static bool ScriptMatch(void* key1, void* key2) { return key1 == key2; } |
185 | 187 |
186 // Clear the cache releasing all the weak handles. | 188 // Clear the cache releasing all the weak handles. |
187 void Clear(); | 189 void Clear(); |
188 | 190 |
189 // Weak handle callback for scripts in the cache. | 191 // Weak handle callback for scripts in the cache. |
190 static void HandleWeakScript(v8::Persistent<v8::Value> obj, void* data); | 192 static void HandleWeakScript(v8::Persistent<v8::Value> obj, void* data); |
191 | 193 |
(...skipping 23 matching lines...) Expand all Loading... |
215 | 217 |
216 // This class contains the debugger support. The main purpose is to handle | 218 // This class contains the debugger support. The main purpose is to handle |
217 // setting break points in the code. | 219 // setting break points in the code. |
218 // | 220 // |
219 // This class controls the debug info for all functions which currently have | 221 // This class controls the debug info for all functions which currently have |
220 // active breakpoints in them. This debug info is held in the heap root object | 222 // active breakpoints in them. This debug info is held in the heap root object |
221 // debug_info which is a FixedArray. Each entry in this list is of class | 223 // debug_info which is a FixedArray. Each entry in this list is of class |
222 // DebugInfo. | 224 // DebugInfo. |
223 class Debug { | 225 class Debug { |
224 public: | 226 public: |
225 void Setup(bool create_heap_objects); | 227 void SetUp(bool create_heap_objects); |
226 bool Load(); | 228 bool Load(); |
227 void Unload(); | 229 void Unload(); |
228 bool IsLoaded() { return !debug_context_.is_null(); } | 230 bool IsLoaded() { return !debug_context_.is_null(); } |
229 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } | 231 bool InDebugger() { return thread_local_.debugger_entry_ != NULL; } |
230 void PreemptionWhileInDebugger(); | 232 void PreemptionWhileInDebugger(); |
231 void Iterate(ObjectVisitor* v); | 233 void Iterate(ObjectVisitor* v); |
232 | 234 |
233 Object* Break(Arguments args); | 235 Object* Break(Arguments args); |
234 void SetBreakPoint(Handle<SharedFunctionInfo> shared, | 236 void SetBreakPoint(Handle<SharedFunctionInfo> shared, |
235 Handle<Object> break_point_object, | 237 Handle<Object> break_point_object, |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 | 981 |
980 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); | 982 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |
981 }; | 983 }; |
982 | 984 |
983 | 985 |
984 } } // namespace v8::internal | 986 } } // namespace v8::internal |
985 | 987 |
986 #endif // ENABLE_DEBUGGER_SUPPORT | 988 #endif // ENABLE_DEBUGGER_SUPPORT |
987 | 989 |
988 #endif // V8_DEBUG_H_ | 990 #endif // V8_DEBUG_H_ |
OLD | NEW |