OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILATION_CACHE_H_ | 5 #ifndef V8_COMPILATION_CACHE_H_ |
6 #define V8_COMPILATION_CACHE_H_ | 6 #define V8_COMPILATION_CACHE_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // More specifically these are the CompileString, DebugEvaluate and | 102 // More specifically these are the CompileString, DebugEvaluate and |
103 // DebugEvaluateGlobal runtime functions. | 103 // DebugEvaluateGlobal runtime functions. |
104 // 4. The start position of the calling scope. | 104 // 4. The start position of the calling scope. |
105 class CompilationCacheEval: public CompilationSubCache { | 105 class CompilationCacheEval: public CompilationSubCache { |
106 public: | 106 public: |
107 CompilationCacheEval(Isolate* isolate, int generations) | 107 CompilationCacheEval(Isolate* isolate, int generations) |
108 : CompilationSubCache(isolate, generations) { } | 108 : CompilationSubCache(isolate, generations) { } |
109 | 109 |
110 MaybeHandle<SharedFunctionInfo> Lookup(Handle<String> source, | 110 MaybeHandle<SharedFunctionInfo> Lookup(Handle<String> source, |
111 Handle<SharedFunctionInfo> outer_info, | 111 Handle<SharedFunctionInfo> outer_info, |
112 StrictMode strict_mode, | 112 LanguageMode language_mode, |
113 int scope_position); | 113 int scope_position); |
114 | 114 |
115 void Put(Handle<String> source, Handle<SharedFunctionInfo> outer_info, | 115 void Put(Handle<String> source, Handle<SharedFunctionInfo> outer_info, |
116 Handle<SharedFunctionInfo> function_info, int scope_position); | 116 Handle<SharedFunctionInfo> function_info, int scope_position); |
117 | 117 |
118 private: | 118 private: |
119 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheEval); | 119 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheEval); |
120 }; | 120 }; |
121 | 121 |
122 | 122 |
(...skipping 25 matching lines...) Expand all Loading... |
148 MaybeHandle<SharedFunctionInfo> LookupScript( | 148 MaybeHandle<SharedFunctionInfo> LookupScript( |
149 Handle<String> source, Handle<Object> name, int line_offset, | 149 Handle<String> source, Handle<Object> name, int line_offset, |
150 int column_offset, bool is_embedder_debug_script, | 150 int column_offset, bool is_embedder_debug_script, |
151 bool is_shared_cross_origin, Handle<Context> context); | 151 bool is_shared_cross_origin, Handle<Context> context); |
152 | 152 |
153 // Finds the shared function info for a source string for eval in a | 153 // Finds the shared function info for a source string for eval in a |
154 // given context. Returns an empty handle if the cache doesn't | 154 // given context. Returns an empty handle if the cache doesn't |
155 // contain a script for the given source string. | 155 // contain a script for the given source string. |
156 MaybeHandle<SharedFunctionInfo> LookupEval( | 156 MaybeHandle<SharedFunctionInfo> LookupEval( |
157 Handle<String> source, Handle<SharedFunctionInfo> outer_info, | 157 Handle<String> source, Handle<SharedFunctionInfo> outer_info, |
158 Handle<Context> context, StrictMode strict_mode, int scope_position); | 158 Handle<Context> context, LanguageMode language_mode, int scope_position); |
159 | 159 |
160 // Returns the regexp data associated with the given regexp if it | 160 // Returns the regexp data associated with the given regexp if it |
161 // is in cache, otherwise an empty handle. | 161 // is in cache, otherwise an empty handle. |
162 MaybeHandle<FixedArray> LookupRegExp( | 162 MaybeHandle<FixedArray> LookupRegExp( |
163 Handle<String> source, JSRegExp::Flags flags); | 163 Handle<String> source, JSRegExp::Flags flags); |
164 | 164 |
165 // Associate the (source, kind) pair to the shared function | 165 // Associate the (source, kind) pair to the shared function |
166 // info. This may overwrite an existing mapping. | 166 // info. This may overwrite an existing mapping. |
167 void PutScript(Handle<String> source, | 167 void PutScript(Handle<String> source, |
168 Handle<Context> context, | 168 Handle<Context> context, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 friend class Isolate; | 227 friend class Isolate; |
228 | 228 |
229 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 229 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
230 }; | 230 }; |
231 | 231 |
232 | 232 |
233 } } // namespace v8::internal | 233 } } // namespace v8::internal |
234 | 234 |
235 #endif // V8_COMPILATION_CACHE_H_ | 235 #endif // V8_COMPILATION_CACHE_H_ |
OLD | NEW |