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 7919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7930 return key->HashForObject(object); | 7930 return key->HashForObject(object); |
7931 } | 7931 } |
7932 | 7932 |
7933 static inline Handle<Object> AsHandle(Isolate* isolate, HashTableKey* key); | 7933 static inline Handle<Object> AsHandle(Isolate* isolate, HashTableKey* key); |
7934 | 7934 |
7935 static const int kPrefixSize = 0; | 7935 static const int kPrefixSize = 0; |
7936 static const int kEntrySize = 2; | 7936 static const int kEntrySize = 2; |
7937 }; | 7937 }; |
7938 | 7938 |
7939 | 7939 |
7940 class CompilationCacheTable: public HashTable<CompilationCacheTable, | 7940 class CompilationCacheTable: public HashTable<CompilationCacheTable, |
ulan
2014/10/30 09:25:49
Could you please add few words describing state ch
| |
7941 CompilationCacheShape, | 7941 CompilationCacheShape, |
7942 HashTableKey*> { | 7942 HashTableKey*> { |
7943 public: | 7943 public: |
7944 // Find cached value for a string key, otherwise return null. | 7944 // Find cached value for a string key, otherwise return null. |
7945 Handle<Object> Lookup(Handle<String> src, Handle<Context> context); | 7945 Handle<Object> Lookup(Handle<String> src, Handle<Context> context); |
7946 Handle<Object> LookupEval(Handle<String> src, | 7946 Handle<Object> LookupEval(Handle<String> src, |
7947 Handle<SharedFunctionInfo> shared, | 7947 Handle<SharedFunctionInfo> shared, |
7948 StrictMode strict_mode, int scope_position); | 7948 StrictMode strict_mode, int scope_position); |
7949 Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags); | 7949 Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags); |
7950 static Handle<CompilationCacheTable> Put( | 7950 static Handle<CompilationCacheTable> Put( |
7951 Handle<CompilationCacheTable> cache, Handle<String> src, | 7951 Handle<CompilationCacheTable> cache, Handle<String> src, |
7952 Handle<Context> context, Handle<Object> value); | 7952 Handle<Context> context, Handle<Object> value); |
7953 static Handle<CompilationCacheTable> PutEval( | 7953 static Handle<CompilationCacheTable> PutEval( |
7954 Handle<CompilationCacheTable> cache, Handle<String> src, | 7954 Handle<CompilationCacheTable> cache, Handle<String> src, |
7955 Handle<SharedFunctionInfo> context, Handle<SharedFunctionInfo> value, | 7955 Handle<SharedFunctionInfo> context, Handle<SharedFunctionInfo> value, |
7956 int scope_position); | 7956 int scope_position); |
7957 static Handle<CompilationCacheTable> PutRegExp( | 7957 static Handle<CompilationCacheTable> PutRegExp( |
7958 Handle<CompilationCacheTable> cache, Handle<String> src, | 7958 Handle<CompilationCacheTable> cache, Handle<String> src, |
7959 JSRegExp::Flags flags, Handle<FixedArray> value); | 7959 JSRegExp::Flags flags, Handle<FixedArray> value); |
7960 void Remove(Object* value); | 7960 void Remove(Object* value); |
7961 void Age(); | |
7961 | 7962 |
7962 DECLARE_CAST(CompilationCacheTable) | 7963 DECLARE_CAST(CompilationCacheTable) |
7963 | 7964 |
7964 private: | 7965 private: |
7966 static const int kHashGenerations = 10; | |
7965 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable); | 7967 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable); |
7966 }; | 7968 }; |
7967 | 7969 |
7968 | 7970 |
7969 class CodeCache: public Struct { | 7971 class CodeCache: public Struct { |
7970 public: | 7972 public: |
7971 DECL_ACCESSORS(default_cache, FixedArray) | 7973 DECL_ACCESSORS(default_cache, FixedArray) |
7972 DECL_ACCESSORS(normal_type_cache, Object) | 7974 DECL_ACCESSORS(normal_type_cache, Object) |
7973 | 7975 |
7974 // Add the code object to the cache. | 7976 // Add the code object to the cache. |
(...skipping 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10909 } else { | 10911 } else { |
10910 value &= ~(1 << bit_position); | 10912 value &= ~(1 << bit_position); |
10911 } | 10913 } |
10912 return value; | 10914 return value; |
10913 } | 10915 } |
10914 }; | 10916 }; |
10915 | 10917 |
10916 } } // namespace v8::internal | 10918 } } // namespace v8::internal |
10917 | 10919 |
10918 #endif // V8_OBJECTS_H_ | 10920 #endif // V8_OBJECTS_H_ |
OLD | NEW |