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 6172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6183 CompilationInfo* info); | 6183 CompilationInfo* info); |
6184 | 6184 |
6185 static void AddDependentCode(Handle<Map> map, | 6185 static void AddDependentCode(Handle<Map> map, |
6186 DependentCode::DependencyGroup group, | 6186 DependentCode::DependencyGroup group, |
6187 Handle<Code> code); | 6187 Handle<Code> code); |
6188 static void AddDependentIC(Handle<Map> map, | 6188 static void AddDependentIC(Handle<Map> map, |
6189 Handle<Code> stub); | 6189 Handle<Code> stub); |
6190 | 6190 |
6191 bool IsMapInArrayPrototypeChain(); | 6191 bool IsMapInArrayPrototypeChain(); |
6192 | 6192 |
| 6193 static Handle<WeakCell> WeakCellForMap(Handle<Map> map); |
| 6194 |
6193 // Dispatched behavior. | 6195 // Dispatched behavior. |
6194 DECLARE_PRINTER(Map) | 6196 DECLARE_PRINTER(Map) |
6195 DECLARE_VERIFIER(Map) | 6197 DECLARE_VERIFIER(Map) |
6196 | 6198 |
6197 #ifdef VERIFY_HEAP | 6199 #ifdef VERIFY_HEAP |
6198 void DictionaryMapVerify(); | 6200 void DictionaryMapVerify(); |
6199 void VerifyOmittedMapChecks(); | 6201 void VerifyOmittedMapChecks(); |
6200 #endif | 6202 #endif |
6201 | 6203 |
6202 inline int visitor_id(); | 6204 inline int visitor_id(); |
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8018 | 8020 |
8019 private: | 8021 private: |
8020 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable); | 8022 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable); |
8021 }; | 8023 }; |
8022 | 8024 |
8023 | 8025 |
8024 class CodeCache: public Struct { | 8026 class CodeCache: public Struct { |
8025 public: | 8027 public: |
8026 DECL_ACCESSORS(default_cache, FixedArray) | 8028 DECL_ACCESSORS(default_cache, FixedArray) |
8027 DECL_ACCESSORS(normal_type_cache, Object) | 8029 DECL_ACCESSORS(normal_type_cache, Object) |
| 8030 DECL_ACCESSORS(weak_cell_cache, Object) |
8028 | 8031 |
8029 // Add the code object to the cache. | 8032 // Add the code object to the cache. |
8030 static void Update( | 8033 static void Update( |
8031 Handle<CodeCache> cache, Handle<Name> name, Handle<Code> code); | 8034 Handle<CodeCache> cache, Handle<Name> name, Handle<Code> code); |
8032 | 8035 |
8033 // Lookup code object in the cache. Returns code object if found and undefined | 8036 // Lookup code object in the cache. Returns code object if found and undefined |
8034 // if not. | 8037 // if not. |
8035 Object* Lookup(Name* name, Code::Flags flags); | 8038 Object* Lookup(Name* name, Code::Flags flags); |
8036 | 8039 |
8037 // Get the internal index of a code object in the cache. Returns -1 if the | 8040 // Get the internal index of a code object in the cache. Returns -1 if the |
8038 // code object is not in that cache. This index can be used to later call | 8041 // code object is not in that cache. This index can be used to later call |
8039 // RemoveByIndex. The cache cannot be modified between a call to GetIndex and | 8042 // RemoveByIndex. The cache cannot be modified between a call to GetIndex and |
8040 // RemoveByIndex. | 8043 // RemoveByIndex. |
8041 int GetIndex(Object* name, Code* code); | 8044 int GetIndex(Object* name, Code* code); |
8042 | 8045 |
8043 // Remove an object from the cache with the provided internal index. | 8046 // Remove an object from the cache with the provided internal index. |
8044 void RemoveByIndex(Object* name, Code* code, int index); | 8047 void RemoveByIndex(Object* name, Code* code, int index); |
8045 | 8048 |
8046 DECLARE_CAST(CodeCache) | 8049 DECLARE_CAST(CodeCache) |
8047 | 8050 |
8048 // Dispatched behavior. | 8051 // Dispatched behavior. |
8049 DECLARE_PRINTER(CodeCache) | 8052 DECLARE_PRINTER(CodeCache) |
8050 DECLARE_VERIFIER(CodeCache) | 8053 DECLARE_VERIFIER(CodeCache) |
8051 | 8054 |
8052 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; | 8055 static const int kDefaultCacheOffset = HeapObject::kHeaderSize; |
8053 static const int kNormalTypeCacheOffset = | 8056 static const int kNormalTypeCacheOffset = |
8054 kDefaultCacheOffset + kPointerSize; | 8057 kDefaultCacheOffset + kPointerSize; |
8055 static const int kSize = kNormalTypeCacheOffset + kPointerSize; | 8058 static const int kWeakCellCacheOffset = kNormalTypeCacheOffset + kPointerSize; |
| 8059 static const int kSize = kWeakCellCacheOffset + kPointerSize; |
8056 | 8060 |
8057 private: | 8061 private: |
8058 static void UpdateDefaultCache( | 8062 static void UpdateDefaultCache( |
8059 Handle<CodeCache> code_cache, Handle<Name> name, Handle<Code> code); | 8063 Handle<CodeCache> code_cache, Handle<Name> name, Handle<Code> code); |
8060 static void UpdateNormalTypeCache( | 8064 static void UpdateNormalTypeCache( |
8061 Handle<CodeCache> code_cache, Handle<Name> name, Handle<Code> code); | 8065 Handle<CodeCache> code_cache, Handle<Name> name, Handle<Code> code); |
8062 Object* LookupDefaultCache(Name* name, Code::Flags flags); | 8066 Object* LookupDefaultCache(Name* name, Code::Flags flags); |
8063 Object* LookupNormalTypeCache(Name* name, Code::Flags flags); | 8067 Object* LookupNormalTypeCache(Name* name, Code::Flags flags); |
8064 | 8068 |
8065 // Code cache layout of the default cache. Elements are alternating name and | 8069 // Code cache layout of the default cache. Elements are alternating name and |
(...skipping 2931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10997 } else { | 11001 } else { |
10998 value &= ~(1 << bit_position); | 11002 value &= ~(1 << bit_position); |
10999 } | 11003 } |
11000 return value; | 11004 return value; |
11001 } | 11005 } |
11002 }; | 11006 }; |
11003 | 11007 |
11004 } } // namespace v8::internal | 11008 } } // namespace v8::internal |
11005 | 11009 |
11006 #endif // V8_OBJECTS_H_ | 11010 #endif // V8_OBJECTS_H_ |
OLD | NEW |