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