| 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::EnableAccessCheckOnReceiver( |
| 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_NE(kForElements, kind); |
| 38 #endif |
| 39 config = DoAccessCheckOnReceiverBits::update(config, true); |
| 40 return handle(Smi::FromInt(config), isolate); |
| 41 } |
| 42 |
| 32 Handle<Object> LoadHandler::EnableNegativeLookupOnReceiver( | 43 Handle<Object> LoadHandler::EnableNegativeLookupOnReceiver( |
| 33 Isolate* isolate, Handle<Object> smi_handler) { | 44 Isolate* isolate, Handle<Object> smi_handler) { |
| 34 int config = Smi::cast(*smi_handler)->value(); | 45 int config = Smi::cast(*smi_handler)->value(); |
| 35 #ifdef DEBUG | 46 #ifdef DEBUG |
| 36 Kind kind = KindBits::decode(config); | 47 Kind kind = KindBits::decode(config); |
| 37 DCHECK(kind == kForFields || kind == kForConstants); | 48 DCHECK_NE(kForElements, kind); |
| 38 #endif | 49 #endif |
| 39 config = DoNegativeLookupOnReceiverBits::update(config, true); | 50 config = DoNegativeLookupOnReceiverBits::update(config, true); |
| 40 return handle(Smi::FromInt(config), isolate); | 51 return handle(Smi::FromInt(config), isolate); |
| 41 } | 52 } |
| 42 | 53 |
| 43 Handle<Object> LoadHandler::LoadNonExistent( | 54 Handle<Object> LoadHandler::LoadNonExistent( |
| 44 Isolate* isolate, bool do_negative_lookup_on_receiver) { | 55 Isolate* isolate, bool do_negative_lookup_on_receiver) { |
| 45 int config = | 56 int config = |
| 46 KindBits::encode(kForNonExistent) | | 57 KindBits::encode(kForNonExistent) | |
| 47 DoNegativeLookupOnReceiverBits::encode(do_negative_lookup_on_receiver); | 58 DoNegativeLookupOnReceiverBits::encode(do_negative_lookup_on_receiver); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 StoreHandler::FieldRepresentationBits::encode(field_rep) | | 98 StoreHandler::FieldRepresentationBits::encode(field_rep) | |
| 88 StoreHandler::DescriptorValueIndexBits::encode(value_index) | | 99 StoreHandler::DescriptorValueIndexBits::encode(value_index) | |
| 89 StoreHandler::FieldOffsetBits::encode(field_index.offset()); | 100 StoreHandler::FieldOffsetBits::encode(field_index.offset()); |
| 90 return handle(Smi::FromInt(config), isolate); | 101 return handle(Smi::FromInt(config), isolate); |
| 91 } | 102 } |
| 92 | 103 |
| 93 } // namespace internal | 104 } // namespace internal |
| 94 } // namespace v8 | 105 } // namespace v8 |
| 95 | 106 |
| 96 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ | 107 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ |
| OLD | NEW |