| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 | 125 |
| 126 // Sub-cache for eval scripts. | 126 // Sub-cache for eval scripts. |
| 127 class CompilationCacheEval: public CompilationSubCache { | 127 class CompilationCacheEval: public CompilationSubCache { |
| 128 public: | 128 public: |
| 129 CompilationCacheEval(Isolate* isolate, int generations) | 129 CompilationCacheEval(Isolate* isolate, int generations) |
| 130 : CompilationSubCache(isolate, generations) { } | 130 : CompilationSubCache(isolate, generations) { } |
| 131 | 131 |
| 132 Handle<SharedFunctionInfo> Lookup(Handle<String> source, | 132 Handle<SharedFunctionInfo> Lookup(Handle<String> source, |
| 133 Handle<Context> context, | 133 Handle<Context> context, |
| 134 StrictModeFlag strict_mode); | 134 LanguageMode language_mode); |
| 135 | 135 |
| 136 void Put(Handle<String> source, | 136 void Put(Handle<String> source, |
| 137 Handle<Context> context, | 137 Handle<Context> context, |
| 138 Handle<SharedFunctionInfo> function_info); | 138 Handle<SharedFunctionInfo> function_info); |
| 139 | 139 |
| 140 private: | 140 private: |
| 141 MUST_USE_RESULT MaybeObject* TryTablePut( | 141 MUST_USE_RESULT MaybeObject* TryTablePut( |
| 142 Handle<String> source, | 142 Handle<String> source, |
| 143 Handle<Context> context, | 143 Handle<Context> context, |
| 144 Handle<SharedFunctionInfo> function_info); | 144 Handle<SharedFunctionInfo> function_info); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 Handle<Object> name, | 191 Handle<Object> name, |
| 192 int line_offset, | 192 int line_offset, |
| 193 int column_offset); | 193 int column_offset); |
| 194 | 194 |
| 195 // Finds the shared function info for a source string for eval in a | 195 // Finds the shared function info for a source string for eval in a |
| 196 // given context. Returns an empty handle if the cache doesn't | 196 // given context. Returns an empty handle if the cache doesn't |
| 197 // contain a script for the given source string. | 197 // contain a script for the given source string. |
| 198 Handle<SharedFunctionInfo> LookupEval(Handle<String> source, | 198 Handle<SharedFunctionInfo> LookupEval(Handle<String> source, |
| 199 Handle<Context> context, | 199 Handle<Context> context, |
| 200 bool is_global, | 200 bool is_global, |
| 201 StrictModeFlag strict_mode); | 201 LanguageMode language_mode); |
| 202 | 202 |
| 203 // Returns the regexp data associated with the given regexp if it | 203 // Returns the regexp data associated with the given regexp if it |
| 204 // is in cache, otherwise an empty handle. | 204 // is in cache, otherwise an empty handle. |
| 205 Handle<FixedArray> LookupRegExp(Handle<String> source, | 205 Handle<FixedArray> LookupRegExp(Handle<String> source, |
| 206 JSRegExp::Flags flags); | 206 JSRegExp::Flags flags); |
| 207 | 207 |
| 208 // Associate the (source, kind) pair to the shared function | 208 // Associate the (source, kind) pair to the shared function |
| 209 // info. This may overwrite an existing mapping. | 209 // info. This may overwrite an existing mapping. |
| 210 void PutScript(Handle<String> source, | 210 void PutScript(Handle<String> source, |
| 211 Handle<SharedFunctionInfo> function_info); | 211 Handle<SharedFunctionInfo> function_info); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 269 |
| 270 friend class Isolate; | 270 friend class Isolate; |
| 271 | 271 |
| 272 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 272 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 | 275 |
| 276 } } // namespace v8::internal | 276 } } // namespace v8::internal |
| 277 | 277 |
| 278 #endif // V8_COMPILATION_CACHE_H_ | 278 #endif // V8_COMPILATION_CACHE_H_ |
| OLD | NEW |