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

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

Issue 2433333002: [ic] Refactoring definition of a smi-encoded load handlers. (Closed)
Patch Set: Created 4 years, 2 months 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"
11 #include "src/objects-inl.h" 11 #include "src/objects-inl.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 Handle<Object> SmiHandler::MakeLoadFieldHandler(Isolate* isolate, 16 Handle<Object> LoadHandler::LoadField(Isolate* isolate,
17 FieldIndex field_index) { 17 FieldIndex field_index) {
18 int config = LoadHandlerTypeBits::encode(kLoadICHandlerForFields) | 18 int config = KindBits::encode(kForFields) |
19 FieldOffsetIsInobject::encode(field_index.is_inobject()) | 19 IsInobjectBits::encode(field_index.is_inobject()) |
20 FieldOffsetIsDouble::encode(field_index.is_double()) | 20 IsDoubleBits::encode(field_index.is_double()) |
21 FieldOffsetOffset::encode(field_index.offset()); 21 FieldOffsetBits::encode(field_index.offset());
22 return handle(Smi::FromInt(config), isolate); 22 return handle(Smi::FromInt(config), isolate);
23 } 23 }
24 24
25 Handle<Object> SmiHandler::MakeLoadConstantHandler(Isolate* isolate, 25 Handle<Object> LoadHandler::LoadConstant(Isolate* isolate, int descriptor) {
26 int descriptor) { 26 int config = KindBits::encode(kForConstants) |
27 int config = LoadHandlerTypeBits::encode(kLoadICHandlerForConstants) | 27 DescriptorValueIndexBits::encode(
28 ValueIndexInDescriptorArray::encode(
29 DescriptorArray::ToValueIndex(descriptor)); 28 DescriptorArray::ToValueIndex(descriptor));
30 return handle(Smi::FromInt(config), isolate); 29 return handle(Smi::FromInt(config), isolate);
31 } 30 }
32 31
33 Handle<Object> SmiHandler::MakeKeyedLoadHandler(Isolate* isolate, 32 Handle<Object> LoadHandler::LoadElement(Isolate* isolate,
34 ElementsKind elements_kind, 33 ElementsKind elements_kind,
35 bool convert_hole_to_undefined, 34 bool convert_hole_to_undefined,
36 bool is_js_array) { 35 bool is_js_array) {
37 int config = LoadHandlerTypeBits::encode(kLoadICHandlerForElements) | 36 int config = KindBits::encode(kForElements) |
38 KeyedLoadElementsKind::encode(elements_kind) | 37 ElementsKindBits::encode(elements_kind) |
39 KeyedLoadConvertHole::encode(convert_hole_to_undefined) | 38 ConvertHoleBits::encode(convert_hole_to_undefined) |
40 KeyedLoadIsJsArray::encode(is_js_array); 39 IsJsArrayBits::encode(is_js_array);
41 return handle(Smi::FromInt(config), isolate); 40 return handle(Smi::FromInt(config), isolate);
42 } 41 }
43 42
44 } // namespace internal 43 } // namespace internal
45 } // namespace v8 44 } // namespace v8
46 45
47 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ 46 #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