OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_IC_HANDLER_CONFIGURATION_H_ | 5 #ifndef V8_IC_HANDLER_CONFIGURATION_H_ |
6 #define V8_IC_HANDLER_CONFIGURATION_H_ | 6 #define V8_IC_HANDLER_CONFIGURATION_H_ |
7 | 7 |
8 #include "src/elements-kind.h" | 8 #include "src/elements-kind.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // | 52 // |
53 // Encoding when KindBits contains kForElements. | 53 // Encoding when KindBits contains kForElements. |
54 // | 54 // |
55 class IsJsArrayBits : public BitField<bool, KindBits::kNext, 1> {}; | 55 class IsJsArrayBits : public BitField<bool, KindBits::kNext, 1> {}; |
56 class ConvertHoleBits : public BitField<bool, IsJsArrayBits::kNext, 1> {}; | 56 class ConvertHoleBits : public BitField<bool, IsJsArrayBits::kNext, 1> {}; |
57 class ElementsKindBits | 57 class ElementsKindBits |
58 : public BitField<ElementsKind, ConvertHoleBits::kNext, 8> {}; | 58 : public BitField<ElementsKind, ConvertHoleBits::kNext, 8> {}; |
59 // Make sure we don't overflow the smi. | 59 // Make sure we don't overflow the smi. |
60 STATIC_ASSERT(ElementsKindBits::kNext <= kSmiValueSize); | 60 STATIC_ASSERT(ElementsKindBits::kNext <= kSmiValueSize); |
61 | 61 |
| 62 // The layout of an Tuple3 handler representing a load of a field from |
| 63 // prototype when prototype chain checks do not include non-existing lookups |
| 64 // or access checks. |
| 65 static const int kHolderCellOffset = Tuple3::kValue1Offset; |
| 66 static const int kSmiHandlerOffset = Tuple3::kValue2Offset; |
| 67 static const int kValidityCellOffset = Tuple3::kValue3Offset; |
| 68 |
| 69 // The layout of an array handler representing a load of a field from |
| 70 // prototype when prototype chain checks include non-existing lookups and |
| 71 // access checks. |
| 72 static const int kSmiHandlerIndex = 0; |
| 73 static const int kValidityCellIndex = 1; |
| 74 static const int kHolderCellIndex = 2; |
| 75 static const int kFirstPrototypeIndex = 3; |
| 76 |
62 // Creates a Smi-handler for loading a field from fast object. | 77 // Creates a Smi-handler for loading a field from fast object. |
63 static inline Handle<Object> LoadField(Isolate* isolate, | 78 static inline Handle<Object> LoadField(Isolate* isolate, |
64 FieldIndex field_index); | 79 FieldIndex field_index); |
65 | 80 |
66 // Creates a Smi-handler for loading a constant from fast object. | 81 // Creates a Smi-handler for loading a constant from fast object. |
67 static inline Handle<Object> LoadConstant(Isolate* isolate, int descriptor); | 82 static inline Handle<Object> LoadConstant(Isolate* isolate, int descriptor); |
68 | 83 |
69 // Sets DoNegativeLookupOnReceiverBits in given Smi-handler. The receiver | 84 // Sets DoNegativeLookupOnReceiverBits in given Smi-handler. The receiver |
70 // check is a part of a prototype chain check. | 85 // check is a part of a prototype chain check. |
71 static inline Handle<Object> EnableNegativeLookupOnReceiver( | 86 static inline Handle<Object> EnableNegativeLookupOnReceiver( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Creates a Smi-handler for storing a field to fast object. | 121 // Creates a Smi-handler for storing a field to fast object. |
107 static inline Handle<Object> StoreField(Isolate* isolate, int descriptor, | 122 static inline Handle<Object> StoreField(Isolate* isolate, int descriptor, |
108 FieldIndex field_index, | 123 FieldIndex field_index, |
109 Representation representation); | 124 Representation representation); |
110 }; | 125 }; |
111 | 126 |
112 } // namespace internal | 127 } // namespace internal |
113 } // namespace v8 | 128 } // namespace v8 |
114 | 129 |
115 #endif // V8_IC_HANDLER_CONFIGURATION_H_ | 130 #endif // V8_IC_HANDLER_CONFIGURATION_H_ |
OLD | NEW |