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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 // string. Returns an empty handle if the cache doesn't contain a | 42 // string. Returns an empty handle if the cache doesn't contain a |
43 // script for the given source string with the right origin. | 43 // script for the given source string with the right origin. |
44 static Handle<SharedFunctionInfo> LookupScript(Handle<String> source, | 44 static Handle<SharedFunctionInfo> LookupScript(Handle<String> source, |
45 Handle<Object> name, | 45 Handle<Object> name, |
46 int line_offset, | 46 int line_offset, |
47 int column_offset); | 47 int column_offset); |
48 | 48 |
49 // Finds the shared function info for a source string for eval in a | 49 // Finds the shared function info for a source string for eval in a |
50 // given context. Returns an empty handle if the cache doesn't | 50 // given context. Returns an empty handle if the cache doesn't |
51 // contain a script for the given source string. | 51 // contain a script for the given source string. |
52 static Handle<SharedFunctionInfo> LookupEval(Handle<String> source, | 52 static Handle<SharedFunctionInfo> LookupEval(Handle<String> source, |
Martin Maly
2011/02/02 23:56:22
compiled pieces of eval code are cached so we must
Lasse Reichstein
2011/02/03 12:36:01
Good catch. We wouldn't want that.
| |
53 Handle<Context> context, | 53 Handle<Context> context, |
54 bool is_global); | 54 bool is_global, |
55 bool is_strict); | |
55 | 56 |
56 // Returns the regexp data associated with the given regexp if it | 57 // Returns the regexp data associated with the given regexp if it |
57 // is in cache, otherwise an empty handle. | 58 // is in cache, otherwise an empty handle. |
58 static Handle<FixedArray> LookupRegExp(Handle<String> source, | 59 static Handle<FixedArray> LookupRegExp(Handle<String> source, |
59 JSRegExp::Flags flags); | 60 JSRegExp::Flags flags); |
60 | 61 |
61 // Associate the (source, kind) pair to the shared function | 62 // Associate the (source, kind) pair to the shared function |
62 // info. This may overwrite an existing mapping. | 63 // info. This may overwrite an existing mapping. |
63 static void PutScript(Handle<String> source, | 64 static void PutScript(Handle<String> source, |
64 Handle<SharedFunctionInfo> function_info); | 65 Handle<SharedFunctionInfo> function_info); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 // Enable/disable compilation cache. Used by debugger to disable compilation | 103 // Enable/disable compilation cache. Used by debugger to disable compilation |
103 // cache during debugging to make sure new scripts are always compiled. | 104 // cache during debugging to make sure new scripts are always compiled. |
104 static void Enable(); | 105 static void Enable(); |
105 static void Disable(); | 106 static void Disable(); |
106 }; | 107 }; |
107 | 108 |
108 | 109 |
109 } } // namespace v8::internal | 110 } } // namespace v8::internal |
110 | 111 |
111 #endif // V8_COMPILATION_CACHE_H_ | 112 #endif // V8_COMPILATION_CACHE_H_ |
OLD | NEW |