OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheScript); | 129 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheScript); |
130 }; | 130 }; |
131 | 131 |
132 | 132 |
133 // Sub-cache for eval scripts. Two caches for eval are used. One for eval calls | 133 // Sub-cache for eval scripts. Two caches for eval are used. One for eval calls |
134 // in native contexts and one for eval calls in other contexts. The cache | 134 // in native contexts and one for eval calls in other contexts. The cache |
135 // considers the following pieces of information when checking for matching | 135 // considers the following pieces of information when checking for matching |
136 // entries: | 136 // entries: |
137 // 1. The source string. | 137 // 1. The source string. |
138 // 2. The shared function info of the calling function. | 138 // 2. The shared function info of the calling function. |
139 // 3. Whether the source should be compiled as strict code or as non-strict | 139 // 3. Whether the source should be compiled as strict code or as sloppy code. |
140 // code. | |
141 // Note: Currently there are clients of CompileEval that always compile | 140 // Note: Currently there are clients of CompileEval that always compile |
142 // non-strict code even if the calling function is a strict mode function. | 141 // sloppy code even if the calling function is a strict mode function. |
143 // More specifically these are the CompileString, DebugEvaluate and | 142 // More specifically these are the CompileString, DebugEvaluate and |
144 // DebugEvaluateGlobal runtime functions. | 143 // DebugEvaluateGlobal runtime functions. |
145 // 4. The start position of the calling scope. | 144 // 4. The start position of the calling scope. |
146 class CompilationCacheEval: public CompilationSubCache { | 145 class CompilationCacheEval: public CompilationSubCache { |
147 public: | 146 public: |
148 CompilationCacheEval(Isolate* isolate, int generations) | 147 CompilationCacheEval(Isolate* isolate, int generations) |
149 : CompilationSubCache(isolate, generations) { } | 148 : CompilationSubCache(isolate, generations) { } |
150 | 149 |
151 Handle<SharedFunctionInfo> Lookup(Handle<String> source, | 150 Handle<SharedFunctionInfo> Lookup(Handle<String> source, |
152 Handle<Context> context, | 151 Handle<Context> context, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 294 |
296 friend class Isolate; | 295 friend class Isolate; |
297 | 296 |
298 DISALLOW_COPY_AND_ASSIGN(CompilationCache); | 297 DISALLOW_COPY_AND_ASSIGN(CompilationCache); |
299 }; | 298 }; |
300 | 299 |
301 | 300 |
302 } } // namespace v8::internal | 301 } } // namespace v8::internal |
303 | 302 |
304 #endif // V8_COMPILATION_CACHE_H_ | 303 #endif // V8_COMPILATION_CACHE_H_ |
OLD | NEW |