OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 4420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4431 inline int flags(); | 4431 inline int flags(); |
4432 inline void set_flags(int flags); | 4432 inline void set_flags(int flags); |
4433 class GroupField : public BitField<int, 0, 3> {}; | 4433 class GroupField : public BitField<int, 0, 3> {}; |
4434 class CountField : public BitField<int, 3, 27> {}; | 4434 class CountField : public BitField<int, 3, 27> {}; |
4435 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1); | 4435 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1); |
4436 }; | 4436 }; |
4437 | 4437 |
4438 | 4438 |
4439 class PrototypeInfo; | 4439 class PrototypeInfo; |
4440 | 4440 |
| 4441 typedef std::vector<Handle<Map>> MapHandles; |
4441 | 4442 |
4442 // All heap objects have a Map that describes their structure. | 4443 // All heap objects have a Map that describes their structure. |
4443 // A Map contains information about: | 4444 // A Map contains information about: |
4444 // - Size information about the object | 4445 // - Size information about the object |
4445 // - How to iterate over an object (for garbage collection) | 4446 // - How to iterate over an object (for garbage collection) |
4446 class Map: public HeapObject { | 4447 class Map: public HeapObject { |
4447 public: | 4448 public: |
4448 // Instance size. | 4449 // Instance size. |
4449 // Size in bytes or kVariableSizeSentinel if instances do not have | 4450 // Size in bytes or kVariableSizeSentinel if instances do not have |
4450 // a fixed size. | 4451 // a fixed size. |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4953 Code* LookupInCodeCache(Name* name, Code::Flags code); | 4954 Code* LookupInCodeCache(Name* name, Code::Flags code); |
4954 | 4955 |
4955 static Handle<Map> GetObjectCreateMap(Handle<HeapObject> prototype); | 4956 static Handle<Map> GetObjectCreateMap(Handle<HeapObject> prototype); |
4956 | 4957 |
4957 // Computes a hash value for this map, to be used in HashTables and such. | 4958 // Computes a hash value for this map, to be used in HashTables and such. |
4958 int Hash(); | 4959 int Hash(); |
4959 | 4960 |
4960 // Returns the transitioned map for this map with the most generic | 4961 // Returns the transitioned map for this map with the most generic |
4961 // elements_kind that's found in |candidates|, or |nullptr| if no match is | 4962 // elements_kind that's found in |candidates|, or |nullptr| if no match is |
4962 // found at all. | 4963 // found at all. |
4963 Map* FindElementsKindTransitionedMap(MapHandleList* candidates); | 4964 Map* FindElementsKindTransitionedMap(MapHandles const& candidates); |
4964 | 4965 |
4965 inline bool CanTransition(); | 4966 inline bool CanTransition(); |
4966 | 4967 |
4967 inline bool IsBooleanMap(); | 4968 inline bool IsBooleanMap(); |
4968 inline bool IsPrimitiveMap(); | 4969 inline bool IsPrimitiveMap(); |
4969 inline bool IsJSReceiverMap(); | 4970 inline bool IsJSReceiverMap(); |
4970 inline bool IsJSObjectMap(); | 4971 inline bool IsJSObjectMap(); |
4971 inline bool IsJSArrayMap(); | 4972 inline bool IsJSArrayMap(); |
4972 inline bool IsJSFunctionMap(); | 4973 inline bool IsJSFunctionMap(); |
4973 inline bool IsStringMap(); | 4974 inline bool IsStringMap(); |
(...skipping 5246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10220 } | 10221 } |
10221 }; | 10222 }; |
10222 | 10223 |
10223 | 10224 |
10224 } // NOLINT, false-positive due to second-order macros. | 10225 } // NOLINT, false-positive due to second-order macros. |
10225 } // NOLINT, false-positive due to second-order macros. | 10226 } // NOLINT, false-positive due to second-order macros. |
10226 | 10227 |
10227 #include "src/objects/object-macros-undef.h" | 10228 #include "src/objects/object-macros-undef.h" |
10228 | 10229 |
10229 #endif // V8_OBJECTS_H_ | 10230 #endif // V8_OBJECTS_H_ |
OLD | NEW |