| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 CacheTagCode = 1, | 183 CacheTagCode = 1, |
| 184 CacheTagCodeCompressed = 2, | 184 CacheTagCodeCompressed = 2, |
| 185 | 185 |
| 186 CacheTagLast | 186 CacheTagLast |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 static const int kCacheTagKindSize = 2; | 189 static const int kCacheTagKindSize = 2; |
| 190 | 190 |
| 191 unsigned cacheTag(CacheTagKind kind) | 191 unsigned cacheTag(CacheTagKind kind) |
| 192 { | 192 { |
| 193 COMPILE_ASSERT((1 << kCacheTagKindSize) >= CacheTagLast, Cache_tag_Last_must
_be_large_enough); | 193 static_assert((1 << kCacheTagKindSize) >= CacheTagLast, "CacheTagLast must b
e large enough"); |
| 194 | 194 |
| 195 static unsigned v8CacheDataVersion = v8::ScriptCompiler::CachedDataVersionTa
g() << kCacheTagKindSize; | 195 static unsigned v8CacheDataVersion = v8::ScriptCompiler::CachedDataVersionTa
g() << kCacheTagKindSize; |
| 196 return v8CacheDataVersion | kind; | 196 return v8CacheDataVersion | kind; |
| 197 } | 197 } |
| 198 | 198 |
| 199 typedef Function<v8::Local<v8::Script>(v8::Isolate*, v8::Handle<v8::String>, v8:
:ScriptOrigin)> CompileFn; | 199 typedef Function<v8::Local<v8::Script>(v8::Isolate*, v8::Handle<v8::String>, v8:
:ScriptOrigin)> CompileFn; |
| 200 | 200 |
| 201 // A notation convenience: WTF::bind<...> needs to be given the right argument | 201 // A notation convenience: WTF::bind<...> needs to be given the right argument |
| 202 // types. We have an awful lot of bind calls below, all with the same types, so | 202 // types. We have an awful lot of bind calls below, all with the same types, so |
| 203 // this local bind lets WTF::bind to all the work, but 'knows' the right | 203 // this local bind lets WTF::bind to all the work, but 'knows' the right |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 { | 448 { |
| 449 return cacheTag(CacheTagParser); | 449 return cacheTag(CacheTagParser); |
| 450 } | 450 } |
| 451 | 451 |
| 452 unsigned V8ScriptRunner::tagForCodeCache() | 452 unsigned V8ScriptRunner::tagForCodeCache() |
| 453 { | 453 { |
| 454 return cacheTag(CacheTagCode); | 454 return cacheTag(CacheTagCode); |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace blink | 457 } // namespace blink |
| OLD | NEW |