| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // More specifically these are the CompileString, DebugEvaluate and | 136 // More specifically these are the CompileString, DebugEvaluate and |
| 137 // DebugEvaluateGlobal runtime functions. | 137 // DebugEvaluateGlobal runtime functions. |
| 138 // 4. The start position of the calling scope. | 138 // 4. The start position of the calling scope. |
| 139 class CompilationCacheEval: public CompilationSubCache { | 139 class CompilationCacheEval: public CompilationSubCache { |
| 140 public: | 140 public: |
| 141 CompilationCacheEval(Isolate* isolate, int generations) | 141 CompilationCacheEval(Isolate* isolate, int generations) |
| 142 : CompilationSubCache(isolate, generations) { } | 142 : CompilationSubCache(isolate, generations) { } |
| 143 | 143 |
| 144 Handle<SharedFunctionInfo> Lookup(Handle<String> source, | 144 Handle<SharedFunctionInfo> Lookup(Handle<String> source, |
| 145 Handle<Context> context, | 145 Handle<Context> context, |
| 146 StrictModeFlag strict_mode, | 146 LanguageMode language_mode, |
| 147 int scope_position); | 147 int scope_position); |
| 148 | 148 |
| 149 void Put(Handle<String> source, | 149 void Put(Handle<String> source, |
| 150 Handle<Context> context, | 150 Handle<Context> context, |
| 151 Handle<SharedFunctionInfo> function_info, | 151 Handle<SharedFunctionInfo> function_info, |
| 152 int scope_position); | 152 int scope_position); |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 MUST_USE_RESULT MaybeObject* TryTablePut( | 155 MUST_USE_RESULT MaybeObject* TryTablePut( |
| 156 Handle<String> source, | 156 Handle<String> source, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 Handle<Object> name, | 207 Handle<Object> name, |
| 208 int line_offset, | 208 int line_offset, |
| 209 int column_offset); | 209 int column_offset); |
| 210 | 210 |
| 211 // Finds the shared function info for a source string for eval in a | 211 // Finds the shared function info for a source string for eval in a |
| 212 // given context. Returns an empty handle if the cache doesn't | 212 // given context. Returns an empty handle if the cache doesn't |
| 213 // contain a script for the given source string. | 213 // contain a script for the given source string. |
| 214 Handle<SharedFunctionInfo> LookupEval(Handle<String> source, | 214 Handle<SharedFunctionInfo> LookupEval(Handle<String> source, |
| 215 Handle<Context> context, | 215 Handle<Context> context, |
| 216 bool is_global, | 216 bool is_global, |
| 217 StrictModeFlag strict_mode, | 217 LanguageMode language_mode, |
| 218 int scope_position); | 218 int scope_position); |
| 219 | 219 |
| 220 // Returns the regexp data associated with the given regexp if it | 220 // Returns the regexp data associated with the given regexp if it |
| 221 // is in cache, otherwise an empty handle. | 221 // is in cache, otherwise an empty handle. |
| 222 Handle<FixedArray> LookupRegExp(Handle<String> source, | 222 Handle<FixedArray> LookupRegExp(Handle<String> source, |
| 223 JSRegExp::Flags flags); | 223 JSRegExp::Flags flags); |
| 224 | 224 |
| 225 // Associate the (source, kind) pair to the shared function | 225 // Associate the (source, kind) pair to the shared function |
| 226 // info. This may overwrite an existing mapping. | 226 // info. This may overwrite an existing mapping. |
| 227 void PutScript(Handle<String> source, | 227 void PutScript(Handle<String> source, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 friend class Isolate; | 288 friend class Isolate; |
| 289 | 289 |
| 290 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 290 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
| 291 }; | 291 }; |
| 292 | 292 |
| 293 | 293 |
| 294 } } // namespace v8::internal | 294 } } // namespace v8::internal |
| 295 | 295 |
| 296 #endif // V8_COMPILATION_CACHE_H_ | 296 #endif // V8_COMPILATION_CACHE_H_ |
| OLD | NEW |