| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 | 119 |
| 120 // Sub-cache for eval scripts. | 120 // Sub-cache for eval scripts. |
| 121 class CompilationCacheEval: public CompilationSubCache { | 121 class CompilationCacheEval: public CompilationSubCache { |
| 122 public: | 122 public: |
| 123 explicit CompilationCacheEval(int generations) | 123 explicit CompilationCacheEval(int generations) |
| 124 : CompilationSubCache(generations) { } | 124 : CompilationSubCache(generations) { } |
| 125 | 125 |
| 126 Handle<SharedFunctionInfo> Lookup(Handle<String> source, | 126 Handle<SharedFunctionInfo> Lookup(Handle<String> source, |
| 127 Handle<Context> context); | 127 Handle<Context> context, |
| 128 StrictModeFlag strict_mode); |
| 128 | 129 |
| 129 void Put(Handle<String> source, | 130 void Put(Handle<String> source, |
| 130 Handle<Context> context, | 131 Handle<Context> context, |
| 131 Handle<SharedFunctionInfo> function_info); | 132 Handle<SharedFunctionInfo> function_info); |
| 132 | 133 |
| 133 private: | 134 private: |
| 134 MUST_USE_RESULT MaybeObject* TryTablePut( | 135 MUST_USE_RESULT MaybeObject* TryTablePut( |
| 135 Handle<String> source, | 136 Handle<String> source, |
| 136 Handle<Context> context, | 137 Handle<Context> context, |
| 137 Handle<SharedFunctionInfo> function_info); | 138 Handle<SharedFunctionInfo> function_info); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 Handle<SharedFunctionInfo> LookupScript(Handle<String> source, | 184 Handle<SharedFunctionInfo> LookupScript(Handle<String> source, |
| 184 Handle<Object> name, | 185 Handle<Object> name, |
| 185 int line_offset, | 186 int line_offset, |
| 186 int column_offset); | 187 int column_offset); |
| 187 | 188 |
| 188 // Finds the shared function info for a source string for eval in a | 189 // Finds the shared function info for a source string for eval in a |
| 189 // given context. Returns an empty handle if the cache doesn't | 190 // given context. Returns an empty handle if the cache doesn't |
| 190 // contain a script for the given source string. | 191 // contain a script for the given source string. |
| 191 Handle<SharedFunctionInfo> LookupEval(Handle<String> source, | 192 Handle<SharedFunctionInfo> LookupEval(Handle<String> source, |
| 192 Handle<Context> context, | 193 Handle<Context> context, |
| 193 bool is_global); | 194 bool is_global, |
| 195 StrictModeFlag strict_mode); |
| 194 | 196 |
| 195 // Returns the regexp data associated with the given regexp if it | 197 // Returns the regexp data associated with the given regexp if it |
| 196 // is in cache, otherwise an empty handle. | 198 // is in cache, otherwise an empty handle. |
| 197 Handle<FixedArray> LookupRegExp(Handle<String> source, | 199 Handle<FixedArray> LookupRegExp(Handle<String> source, |
| 198 JSRegExp::Flags flags); | 200 JSRegExp::Flags flags); |
| 199 | 201 |
| 200 // Associate the (source, kind) pair to the shared function | 202 // Associate the (source, kind) pair to the shared function |
| 201 // info. This may overwrite an existing mapping. | 203 // info. This may overwrite an existing mapping. |
| 202 void PutScript(Handle<String> source, | 204 void PutScript(Handle<String> source, |
| 203 Handle<SharedFunctionInfo> function_info); | 205 Handle<SharedFunctionInfo> function_info); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 268 |
| 267 friend class Isolate; | 269 friend class Isolate; |
| 268 | 270 |
| 269 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 271 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
| 270 }; | 272 }; |
| 271 | 273 |
| 272 | 274 |
| 273 } } // namespace v8::internal | 275 } } // namespace v8::internal |
| 274 | 276 |
| 275 #endif // V8_COMPILATION_CACHE_H_ | 277 #endif // V8_COMPILATION_CACHE_H_ |
| OLD | NEW |