| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "compilation-cache.h" | 30 #include "compilation-cache.h" |
| 31 | 31 |
| 32 namespace v8 { | 32 namespace v8 { |
| 33 namespace internal { | 33 namespace internal { |
| 34 | 34 |
| 35 enum { | 35 enum { |
| 36 // The number of script generations tell how many GCs a script can | 36 // The number of script generations tell how many GCs a script can |
| 37 // survive in the compilation cache, before it will be flushed if it | 37 // survive in the compilation cache, before it will be flushed if it |
| 38 // hasn't been used. | 38 // hasn't been used. |
| 39 NUMBER_OF_SCRIPT_GENERATIONS = 8, | 39 NUMBER_OF_SCRIPT_GENERATIONS = 5, |
| 40 | 40 |
| 41 // The compilation cache consists of tables - one for each entry | 41 // The compilation cache consists of tables - one for each entry |
| 42 // kind plus extras for the script generations. | 42 // kind plus extras for the script generations. |
| 43 NUMBER_OF_TABLE_ENTRIES = | 43 NUMBER_OF_TABLE_ENTRIES = |
| 44 CompilationCache::LAST_ENTRY + NUMBER_OF_SCRIPT_GENERATIONS | 44 CompilationCache::LAST_ENTRY + NUMBER_OF_SCRIPT_GENERATIONS |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 | 47 |
| 48 // Current enable state of the compilation cache. | 48 // Current enable state of the compilation cache. |
| 49 static bool enabled = true; | 49 static bool enabled = true; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 } | 308 } |
| 309 | 309 |
| 310 | 310 |
| 311 void CompilationCache::Disable() { | 311 void CompilationCache::Disable() { |
| 312 enabled = false; | 312 enabled = false; |
| 313 Clear(); | 313 Clear(); |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 } } // namespace v8::internal | 317 } } // namespace v8::internal |
| OLD | NEW |