Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/objects.h

Issue 2809923002: Unify implementations of Map handles vectors and lists (Closed)
Patch Set: Style nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/ic/ic.cc ('K') | « src/ic/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4421 matching lines...) Expand 10 before | Expand all | Expand 10 after
4432 inline int flags(); 4432 inline int flags();
4433 inline void set_flags(int flags); 4433 inline void set_flags(int flags);
4434 class GroupField : public BitField<int, 0, 3> {}; 4434 class GroupField : public BitField<int, 0, 3> {};
4435 class CountField : public BitField<int, 3, 27> {}; 4435 class CountField : public BitField<int, 3, 27> {};
4436 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1); 4436 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1);
4437 }; 4437 };
4438 4438
4439 4439
4440 class PrototypeInfo; 4440 class PrototypeInfo;
4441 4441
4442 typedef std::vector<Handle<Map>> MapHandles;
4442 4443
4443 // All heap objects have a Map that describes their structure. 4444 // All heap objects have a Map that describes their structure.
4444 // A Map contains information about: 4445 // A Map contains information about:
4445 // - Size information about the object 4446 // - Size information about the object
4446 // - How to iterate over an object (for garbage collection) 4447 // - How to iterate over an object (for garbage collection)
4447 class Map: public HeapObject { 4448 class Map: public HeapObject {
4448 public: 4449 public:
4449 // Instance size. 4450 // Instance size.
4450 // Size in bytes or kVariableSizeSentinel if instances do not have 4451 // Size in bytes or kVariableSizeSentinel if instances do not have
4451 // a fixed size. 4452 // a fixed size.
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
4954 Code* LookupInCodeCache(Name* name, Code::Flags code); 4955 Code* LookupInCodeCache(Name* name, Code::Flags code);
4955 4956
4956 static Handle<Map> GetObjectCreateMap(Handle<HeapObject> prototype); 4957 static Handle<Map> GetObjectCreateMap(Handle<HeapObject> prototype);
4957 4958
4958 // Computes a hash value for this map, to be used in HashTables and such. 4959 // Computes a hash value for this map, to be used in HashTables and such.
4959 int Hash(); 4960 int Hash();
4960 4961
4961 // Returns the transitioned map for this map with the most generic 4962 // Returns the transitioned map for this map with the most generic
4962 // elements_kind that's found in |candidates|, or |nullptr| if no match is 4963 // elements_kind that's found in |candidates|, or |nullptr| if no match is
4963 // found at all. 4964 // found at all.
4964 Map* FindElementsKindTransitionedMap(MapHandleList* candidates); 4965 Map* FindElementsKindTransitionedMap(MapHandles const& candidates);
4965 4966
4966 inline bool CanTransition(); 4967 inline bool CanTransition();
4967 4968
4968 inline bool IsBooleanMap(); 4969 inline bool IsBooleanMap();
4969 inline bool IsPrimitiveMap(); 4970 inline bool IsPrimitiveMap();
4970 inline bool IsJSReceiverMap(); 4971 inline bool IsJSReceiverMap();
4971 inline bool IsJSObjectMap(); 4972 inline bool IsJSObjectMap();
4972 inline bool IsJSArrayMap(); 4973 inline bool IsJSArrayMap();
4973 inline bool IsJSFunctionMap(); 4974 inline bool IsJSFunctionMap();
4974 inline bool IsStringMap(); 4975 inline bool IsStringMap();
(...skipping 5251 matching lines...) Expand 10 before | Expand all | Expand 10 after
10226 } 10227 }
10227 }; 10228 };
10228 10229
10229 10230
10230 } // NOLINT, false-positive due to second-order macros. 10231 } // NOLINT, false-positive due to second-order macros.
10231 } // NOLINT, false-positive due to second-order macros. 10232 } // NOLINT, false-positive due to second-order macros.
10232 10233
10233 #include "src/objects/object-macros-undef.h" 10234 #include "src/objects/object-macros-undef.h"
10234 10235
10235 #endif // V8_OBJECTS_H_ 10236 #endif // V8_OBJECTS_H_
OLDNEW
« src/ic/ic.cc ('K') | « src/ic/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698