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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 8059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8070 // is called while such a hash is live in the cache, the hash gets replaced by | 8070 // is called while such a hash is live in the cache, the hash gets replaced by |
8071 // an actual cache entry. Age also removes stale live entries from the cache. | 8071 // an actual cache entry. Age also removes stale live entries from the cache. |
8072 // Such entries are identified by SharedFunctionInfos pointing to either the | 8072 // Such entries are identified by SharedFunctionInfos pointing to either the |
8073 // recompilation stub, or to "old" code. This avoids memory leaks due to | 8073 // recompilation stub, or to "old" code. This avoids memory leaks due to |
8074 // premature caching of scripts and eval strings that are never needed later. | 8074 // premature caching of scripts and eval strings that are never needed later. |
8075 class CompilationCacheTable: public HashTable<CompilationCacheTable, | 8075 class CompilationCacheTable: public HashTable<CompilationCacheTable, |
8076 CompilationCacheShape, | 8076 CompilationCacheShape, |
8077 HashTableKey*> { | 8077 HashTableKey*> { |
8078 public: | 8078 public: |
8079 // Find cached value for a string key, otherwise return null. | 8079 // Find cached value for a string key, otherwise return null. |
8080 Handle<Object> Lookup(Handle<String> src, Handle<Context> context); | 8080 Handle<Object> Lookup( |
8081 Handle<Object> LookupEval(Handle<String> src, | 8081 Handle<String> src, Handle<Context> context, LanguageMode language_mode); |
8082 Handle<SharedFunctionInfo> shared, | 8082 Handle<Object> LookupEval( |
8083 LanguageMode language_mode, int scope_position); | 8083 Handle<String> src, Handle<SharedFunctionInfo> shared, |
| 8084 LanguageMode language_mode, int scope_position); |
8084 Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags); | 8085 Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags); |
8085 static Handle<CompilationCacheTable> Put( | 8086 static Handle<CompilationCacheTable> Put( |
8086 Handle<CompilationCacheTable> cache, Handle<String> src, | 8087 Handle<CompilationCacheTable> cache, Handle<String> src, |
8087 Handle<Context> context, Handle<Object> value); | 8088 Handle<Context> context, LanguageMode language_mode, |
| 8089 Handle<Object> value); |
8088 static Handle<CompilationCacheTable> PutEval( | 8090 static Handle<CompilationCacheTable> PutEval( |
8089 Handle<CompilationCacheTable> cache, Handle<String> src, | 8091 Handle<CompilationCacheTable> cache, Handle<String> src, |
8090 Handle<SharedFunctionInfo> context, Handle<SharedFunctionInfo> value, | 8092 Handle<SharedFunctionInfo> context, Handle<SharedFunctionInfo> value, |
8091 int scope_position); | 8093 int scope_position); |
8092 static Handle<CompilationCacheTable> PutRegExp( | 8094 static Handle<CompilationCacheTable> PutRegExp( |
8093 Handle<CompilationCacheTable> cache, Handle<String> src, | 8095 Handle<CompilationCacheTable> cache, Handle<String> src, |
8094 JSRegExp::Flags flags, Handle<FixedArray> value); | 8096 JSRegExp::Flags flags, Handle<FixedArray> value); |
8095 void Remove(Object* value); | 8097 void Remove(Object* value); |
8096 void Age(); | 8098 void Age(); |
8097 static const int kHashGenerations = 10; | 8099 static const int kHashGenerations = 10; |
(...skipping 2874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10972 } else { | 10974 } else { |
10973 value &= ~(1 << bit_position); | 10975 value &= ~(1 << bit_position); |
10974 } | 10976 } |
10975 return value; | 10977 return value; |
10976 } | 10978 } |
10977 }; | 10979 }; |
10978 | 10980 |
10979 } } // namespace v8::internal | 10981 } } // namespace v8::internal |
10980 | 10982 |
10981 #endif // V8_OBJECTS_H_ | 10983 #endif // V8_OBJECTS_H_ |
OLD | NEW |