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

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

Issue 2438553003: [ic] Support data handlers that represent simple field stores. (Closed)
Patch Set: One more fix for GC stress issues 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
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 22 matching lines...) Expand all
33 ElementsKind elements_kind, 33 ElementsKind elements_kind,
34 bool convert_hole_to_undefined, 34 bool convert_hole_to_undefined,
35 bool is_js_array) { 35 bool is_js_array) {
36 int config = KindBits::encode(kForElements) | 36 int config = KindBits::encode(kForElements) |
37 ElementsKindBits::encode(elements_kind) | 37 ElementsKindBits::encode(elements_kind) |
38 ConvertHoleBits::encode(convert_hole_to_undefined) | 38 ConvertHoleBits::encode(convert_hole_to_undefined) |
39 IsJsArrayBits::encode(is_js_array); 39 IsJsArrayBits::encode(is_js_array);
40 return handle(Smi::FromInt(config), isolate); 40 return handle(Smi::FromInt(config), isolate);
41 } 41 }
42 42
43 Handle<Object> StoreHandler::StoreField(Isolate* isolate, int descriptor,
44 FieldIndex field_index,
45 Representation representation) {
46 StoreHandler::FieldRepresentation field_rep;
47 switch (representation.kind()) {
48 case Representation::kSmi:
49 field_rep = StoreHandler::kSmi;
50 break;
51 case Representation::kDouble:
52 field_rep = StoreHandler::kDouble;
53 break;
54 case Representation::kHeapObject:
55 field_rep = StoreHandler::kHeapObject;
56 break;
57 case Representation::kTagged:
58 field_rep = StoreHandler::kTagged;
59 break;
60 default:
61 UNREACHABLE();
62 return Handle<Object>::null();
63 }
64 int value_index = DescriptorArray::ToValueIndex(descriptor);
65
66 int config = StoreHandler::KindBits::encode(StoreHandler::kForFields) |
67 StoreHandler::IsInobjectBits::encode(field_index.is_inobject()) |
68 StoreHandler::FieldRepresentationBits::encode(field_rep) |
69 StoreHandler::DescriptorValueIndexBits::encode(value_index) |
70 StoreHandler::FieldOffsetBits::encode(field_index.offset());
71 return handle(Smi::FromInt(config), isolate);
72 }
73
43 } // namespace internal 74 } // namespace internal
44 } // namespace v8 75 } // namespace v8
45 76
46 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_ 77 #endif // V8_IC_HANDLER_CONFIGURATION_INL_H_
OLDNEW
« no previous file with comments | « src/ic/handler-configuration.h ('k') | src/ic/ic.cc » ('j') | src/ic/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698