| 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 787 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 |