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

Side by Side Diff: src/objects.h

Issue 2809923002: Unify implementations of Map handles vectors and lists (Closed)
Patch Set: Review feedback 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
« no previous file with comments | « 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 4424 matching lines...) Expand 10 before | Expand all | Expand 10 after
4435 inline int flags(); 4435 inline int flags();
4436 inline void set_flags(int flags); 4436 inline void set_flags(int flags);
4437 class GroupField : public BitField<int, 0, 3> {}; 4437 class GroupField : public BitField<int, 0, 3> {};
4438 class CountField : public BitField<int, 3, 27> {}; 4438 class CountField : public BitField<int, 3, 27> {};
4439 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1); 4439 STATIC_ASSERT(kGroupCount <= GroupField::kMax + 1);
4440 }; 4440 };
4441 4441
4442 4442
4443 class PrototypeInfo; 4443 class PrototypeInfo;
4444 4444
4445 typedef std::vector<Handle<Map>> MapHandles;
4445 4446
4446 // All heap objects have a Map that describes their structure. 4447 // All heap objects have a Map that describes their structure.
4447 // A Map contains information about: 4448 // A Map contains information about:
4448 // - Size information about the object 4449 // - Size information about the object
4449 // - How to iterate over an object (for garbage collection) 4450 // - How to iterate over an object (for garbage collection)
4450 class Map: public HeapObject { 4451 class Map: public HeapObject {
4451 public: 4452 public:
4452 // Instance size. 4453 // Instance size.
4453 // Size in bytes or kVariableSizeSentinel if instances do not have 4454 // Size in bytes or kVariableSizeSentinel if instances do not have
4454 // a fixed size. 4455 // a fixed size.
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
4957 Code* LookupInCodeCache(Name* name, Code::Flags code); 4958 Code* LookupInCodeCache(Name* name, Code::Flags code);
4958 4959
4959 static Handle<Map> GetObjectCreateMap(Handle<HeapObject> prototype); 4960 static Handle<Map> GetObjectCreateMap(Handle<HeapObject> prototype);
4960 4961
4961 // Computes a hash value for this map, to be used in HashTables and such. 4962 // Computes a hash value for this map, to be used in HashTables and such.
4962 int Hash(); 4963 int Hash();
4963 4964
4964 // Returns the transitioned map for this map with the most generic 4965 // Returns the transitioned map for this map with the most generic
4965 // elements_kind that's found in |candidates|, or |nullptr| if no match is 4966 // elements_kind that's found in |candidates|, or |nullptr| if no match is
4966 // found at all. 4967 // found at all.
4967 Map* FindElementsKindTransitionedMap(MapHandleList* candidates); 4968 Map* FindElementsKindTransitionedMap(MapHandles const& candidates);
4968 4969
4969 inline bool CanTransition(); 4970 inline bool CanTransition();
4970 4971
4971 inline bool IsBooleanMap(); 4972 inline bool IsBooleanMap();
4972 inline bool IsPrimitiveMap(); 4973 inline bool IsPrimitiveMap();
4973 inline bool IsJSReceiverMap(); 4974 inline bool IsJSReceiverMap();
4974 inline bool IsJSObjectMap(); 4975 inline bool IsJSObjectMap();
4975 inline bool IsJSArrayMap(); 4976 inline bool IsJSArrayMap();
4976 inline bool IsJSFunctionMap(); 4977 inline bool IsJSFunctionMap();
4977 inline bool IsStringMap(); 4978 inline bool IsStringMap();
(...skipping 5258 matching lines...) Expand 10 before | Expand all | Expand 10 after
10236 } 10237 }
10237 }; 10238 };
10238 10239
10239 10240
10240 } // NOLINT, false-positive due to second-order macros. 10241 } // NOLINT, false-positive due to second-order macros.
10241 } // NOLINT, false-positive due to second-order macros. 10242 } // NOLINT, false-positive due to second-order macros.
10242 10243
10243 #include "src/objects/object-macros-undef.h" 10244 #include "src/objects/object-macros-undef.h"
10244 10245
10245 #endif // V8_OBJECTS_H_ 10246 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698