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

Side by Side Diff: src/ic/handler-configuration-inl.h

Issue 2446983002: [ic] Support negative lookup on receiver in data handlers. (Closed)
Patch Set: Addressing comments Created 4 years, 1 month 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/handler-configuration.h ('k') | src/ic/ic.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 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
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
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_
OLDNEW
« no previous file with comments | « src/ic/handler-configuration.h ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698