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

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

Issue 2479373006: [ic] Support Api getters by data handlers. (Closed)
Patch Set: 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"
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> LoadHandler::LoadField(Isolate* isolate, 16 Handle<Object> LoadHandler::LoadField(Isolate* isolate,
17 FieldIndex field_index) { 17 FieldIndex field_index) {
18 int config = KindBits::encode(kForFields) | 18 int config = KindBits::encode(kForFields) |
19 IsInobjectBits::encode(field_index.is_inobject()) | 19 IsInobjectBits::encode(field_index.is_inobject()) |
20 IsDoubleBits::encode(field_index.is_double()) | 20 IsDoubleBits::encode(field_index.is_double()) |
21 FieldOffsetBits::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> 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 IsAccessorInfoBits::encode(false) |
27 DescriptorValueIndexBits::encode( 28 DescriptorValueIndexBits::encode(
28 DescriptorArray::ToValueIndex(descriptor)); 29 DescriptorArray::ToValueIndex(descriptor));
29 return handle(Smi::FromInt(config), isolate); 30 return handle(Smi::FromInt(config), isolate);
31 }
32
33 Handle<Object> LoadHandler::LoadApiGetter(Isolate* isolate, int descriptor) {
34 int config = KindBits::encode(kForConstants) |
35 IsAccessorInfoBits::encode(true) |
36 DescriptorValueIndexBits::encode(
37 DescriptorArray::ToValueIndex(descriptor));
38 return handle(Smi::FromInt(config), isolate);
30 } 39 }
31 40
32 Handle<Object> LoadHandler::EnableAccessCheckOnReceiver( 41 Handle<Object> LoadHandler::EnableAccessCheckOnReceiver(
33 Isolate* isolate, Handle<Object> smi_handler) { 42 Isolate* isolate, Handle<Object> smi_handler) {
34 int config = Smi::cast(*smi_handler)->value(); 43 int config = Smi::cast(*smi_handler)->value();
35 #ifdef DEBUG 44 #ifdef DEBUG
36 Kind kind = KindBits::decode(config); 45 Kind kind = KindBits::decode(config);
37 DCHECK_NE(kForElements, kind); 46 DCHECK_NE(kForElements, kind);
38 #endif 47 #endif
39 config = DoAccessCheckOnReceiverBits::update(config, true); 48 config = DoAccessCheckOnReceiverBits::update(config, true);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 StoreHandler::FieldRepresentationBits::encode(field_rep) | 107 StoreHandler::FieldRepresentationBits::encode(field_rep) |
99 StoreHandler::DescriptorValueIndexBits::encode(value_index) | 108 StoreHandler::DescriptorValueIndexBits::encode(value_index) |
100 StoreHandler::FieldOffsetBits::encode(field_index.offset()); 109 StoreHandler::FieldOffsetBits::encode(field_index.offset());
101 return handle(Smi::FromInt(config), isolate); 110 return handle(Smi::FromInt(config), isolate);
102 } 111 }
103 112
104 } // namespace internal 113 } // namespace internal
105 } // namespace v8 114 } // namespace v8
106 115
107 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ 116 #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