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_INL_H_ | 5 #ifndef V8_IC_HANDLER_CONFIGURATION_INL_H_ |
6 #define V8_IC_HANDLER_CONFIGURATION_INL_H_ | 6 #define V8_IC_HANDLER_CONFIGURATION_INL_H_ |
7 | 7 |
8 #include "src/ic/handler-configuration.h" | 8 #include "src/ic/handler-configuration.h" |
9 | 9 |
10 #include "src/field-index-inl.h" | 10 #include "src/field-index-inl.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 return handle(Smi::FromInt(config), isolate); | 22 return handle(Smi::FromInt(config), isolate); |
23 } | 23 } |
24 | 24 |
25 Handle<Object> LoadHandler::LoadConstant(Isolate* isolate, int descriptor) { | 25 Handle<Object> LoadHandler::LoadConstant(Isolate* isolate, int descriptor) { |
26 int config = KindBits::encode(kForConstants) | | 26 int config = KindBits::encode(kForConstants) | |
27 DescriptorValueIndexBits::encode( | 27 DescriptorValueIndexBits::encode( |
28 DescriptorArray::ToValueIndex(descriptor)); | 28 DescriptorArray::ToValueIndex(descriptor)); |
29 return handle(Smi::FromInt(config), isolate); | 29 return handle(Smi::FromInt(config), isolate); |
30 } | 30 } |
31 | 31 |
| 32 Handle<Object> LoadHandler::EnableNegativeLookupOnReceiver( |
| 33 Isolate* isolate, Handle<Object> smi_handler) { |
| 34 int config = Smi::cast(*smi_handler)->value(); |
| 35 #ifdef DEBUG |
| 36 Kind kind = KindBits::decode(config); |
| 37 DCHECK(kind == kForFields || kind == kForConstants); |
| 38 #endif |
| 39 config = DoNegativeLookupOnReceiverBits::update(config, true); |
| 40 return handle(Smi::FromInt(config), isolate); |
| 41 } |
| 42 |
32 Handle<Object> LoadHandler::LoadElement(Isolate* isolate, | 43 Handle<Object> LoadHandler::LoadElement(Isolate* isolate, |
33 ElementsKind elements_kind, | 44 ElementsKind elements_kind, |
34 bool convert_hole_to_undefined, | 45 bool convert_hole_to_undefined, |
35 bool is_js_array) { | 46 bool is_js_array) { |
36 int config = KindBits::encode(kForElements) | | 47 int config = KindBits::encode(kForElements) | |
37 ElementsKindBits::encode(elements_kind) | | 48 ElementsKindBits::encode(elements_kind) | |
38 ConvertHoleBits::encode(convert_hole_to_undefined) | | 49 ConvertHoleBits::encode(convert_hole_to_undefined) | |
39 IsJsArrayBits::encode(is_js_array); | 50 IsJsArrayBits::encode(is_js_array); |
40 return handle(Smi::FromInt(config), isolate); | 51 return handle(Smi::FromInt(config), isolate); |
41 } | 52 } |
(...skipping 26 matching lines...) Expand all Loading... |
68 StoreHandler::FieldRepresentationBits::encode(field_rep) | | 79 StoreHandler::FieldRepresentationBits::encode(field_rep) | |
69 StoreHandler::DescriptorValueIndexBits::encode(value_index) | | 80 StoreHandler::DescriptorValueIndexBits::encode(value_index) | |
70 StoreHandler::FieldOffsetBits::encode(field_index.offset()); | 81 StoreHandler::FieldOffsetBits::encode(field_index.offset()); |
71 return handle(Smi::FromInt(config), isolate); | 82 return handle(Smi::FromInt(config), isolate); |
72 } | 83 } |
73 | 84 |
74 } // namespace internal | 85 } // namespace internal |
75 } // namespace v8 | 86 } // namespace v8 |
76 | 87 |
77 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ | 88 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ |
OLD | NEW |