Line data Source code
1 : // Copyright 2017 the V8 project authors. All rights reserved.
2 : // Use of this source code is governed by a BSD-style license that can be
3 : // found in the LICENSE file.
4 :
5 : #ifndef V8_OBJECTS_DATA_HANDLER_INL_H_
6 : #define V8_OBJECTS_DATA_HANDLER_INL_H_
7 :
8 : #include "src/objects-inl.h" // Needed for write barriers
9 : #include "src/objects/data-handler.h"
10 :
11 : // Has to be the last include (doesn't have include guards):
12 : #include "src/objects/object-macros.h"
13 :
14 : namespace v8 {
15 : namespace internal {
16 :
17 : OBJECT_CONSTRUCTORS_IMPL(DataHandler, Struct)
18 :
19 : CAST_ACCESSOR(DataHandler)
20 :
21 3625641 : ACCESSORS(DataHandler, smi_handler, Object, kSmiHandlerOffset)
22 3616996 : ACCESSORS(DataHandler, validity_cell, Object, kValidityCellOffset)
23 :
24 : int DataHandler::data_field_count() const {
25 : return (map()->instance_size() - kSizeWithData0) / kTaggedSize;
26 : }
27 :
28 3281417 : WEAK_ACCESSORS_CHECKED(DataHandler, data1, kData1Offset,
29 : map()->instance_size() >= kSizeWithData1)
30 223298 : WEAK_ACCESSORS_CHECKED(DataHandler, data2, kData2Offset,
31 : map()->instance_size() >= kSizeWithData2)
32 50 : WEAK_ACCESSORS_CHECKED(DataHandler, data3, kData3Offset,
33 : map()->instance_size() >= kSizeWithData3)
34 :
35 : } // namespace internal
36 : } // namespace v8
37 :
38 : #include "src/objects/object-macros-undef.h"
39 :
40 : #endif // V8_OBJECTS_DATA_HANDLER_INL_H_
|