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

Side by Side Diff: src/compiler/js-create-lowering.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Created 3 years, 11 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
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 #include "src/compiler/js-create-lowering.h" 5 #include "src/compiler/js-create-lowering.h"
6 6
7 #include "src/allocation-site-scopes.h" 7 #include "src/allocation-site-scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // TODO(turbofan): Do we want to support out-of-object properties? 172 // TODO(turbofan): Do we want to support out-of-object properties?
173 Handle<FixedArray> properties(boilerplate->properties(), isolate); 173 Handle<FixedArray> properties(boilerplate->properties(), isolate);
174 if (properties->length() > 0) return false; 174 if (properties->length() > 0) return false;
175 175
176 // Check the in-object properties. 176 // Check the in-object properties.
177 Handle<DescriptorArray> descriptors( 177 Handle<DescriptorArray> descriptors(
178 boilerplate->map()->instance_descriptors(), isolate); 178 boilerplate->map()->instance_descriptors(), isolate);
179 int limit = boilerplate->map()->NumberOfOwnDescriptors(); 179 int limit = boilerplate->map()->NumberOfOwnDescriptors();
180 for (int i = 0; i < limit; i++) { 180 for (int i = 0; i < limit; i++) {
181 PropertyDetails details = descriptors->GetDetails(i); 181 PropertyDetails details = descriptors->GetDetails(i);
182 if (details.type() != DATA) continue; 182 if (details.location() != kField) continue;
183 if ((*max_properties)-- == 0) return false; 183 if ((*max_properties)-- == 0) return false;
184 FieldIndex field_index = FieldIndex::ForDescriptor(boilerplate->map(), i); 184 FieldIndex field_index = FieldIndex::ForDescriptor(boilerplate->map(), i);
185 if (boilerplate->IsUnboxedDoubleField(field_index)) continue; 185 if (boilerplate->IsUnboxedDoubleField(field_index)) continue;
186 Handle<Object> value(boilerplate->RawFastPropertyAt(field_index), isolate); 186 Handle<Object> value(boilerplate->RawFastPropertyAt(field_index), isolate);
187 if (value->IsJSObject()) { 187 if (value->IsJSObject()) {
188 Handle<JSObject> value_object = Handle<JSObject>::cast(value); 188 Handle<JSObject> value_object = Handle<JSObject>::cast(value);
189 if (!IsFastLiteral(value_object, max_depth - 1, max_properties)) { 189 if (!IsFastLiteral(value_object, max_depth - 1, max_properties)) {
190 return false; 190 return false;
191 } 191 }
192 } 192 }
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 if (elements->op()->EffectOutputCount() > 0) effect = elements; 1179 if (elements->op()->EffectOutputCount() > 0) effect = elements;
1180 1180
1181 // Compute the in-object properties to store first (might have effects). 1181 // Compute the in-object properties to store first (might have effects).
1182 Handle<Map> boilerplate_map(boilerplate->map(), isolate()); 1182 Handle<Map> boilerplate_map(boilerplate->map(), isolate());
1183 ZoneVector<std::pair<FieldAccess, Node*>> inobject_fields(zone()); 1183 ZoneVector<std::pair<FieldAccess, Node*>> inobject_fields(zone());
1184 inobject_fields.reserve(boilerplate_map->GetInObjectProperties()); 1184 inobject_fields.reserve(boilerplate_map->GetInObjectProperties());
1185 int const boilerplate_nof = boilerplate_map->NumberOfOwnDescriptors(); 1185 int const boilerplate_nof = boilerplate_map->NumberOfOwnDescriptors();
1186 for (int i = 0; i < boilerplate_nof; ++i) { 1186 for (int i = 0; i < boilerplate_nof; ++i) {
1187 PropertyDetails const property_details = 1187 PropertyDetails const property_details =
1188 boilerplate_map->instance_descriptors()->GetDetails(i); 1188 boilerplate_map->instance_descriptors()->GetDetails(i);
1189 if (property_details.type() != DATA) continue; 1189 if (property_details.location() != kField) continue;
1190 Handle<Name> property_name( 1190 Handle<Name> property_name(
1191 boilerplate_map->instance_descriptors()->GetKey(i), isolate()); 1191 boilerplate_map->instance_descriptors()->GetKey(i), isolate());
1192 FieldIndex index = FieldIndex::ForDescriptor(*boilerplate_map, i); 1192 FieldIndex index = FieldIndex::ForDescriptor(*boilerplate_map, i);
1193 FieldAccess access = {kTaggedBase, index.offset(), 1193 FieldAccess access = {kTaggedBase, index.offset(),
1194 property_name, MaybeHandle<Map>(), 1194 property_name, MaybeHandle<Map>(),
1195 Type::Any(), MachineType::AnyTagged(), 1195 Type::Any(), MachineType::AnyTagged(),
1196 kFullWriteBarrier}; 1196 kFullWriteBarrier};
1197 Node* value; 1197 Node* value;
1198 if (boilerplate->IsUnboxedDoubleField(index)) { 1198 if (boilerplate->IsUnboxedDoubleField(index)) {
1199 access.machine_type = MachineType::Float64(); 1199 access.machine_type = MachineType::Float64();
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 return jsgraph()->simplified(); 1382 return jsgraph()->simplified();
1383 } 1383 }
1384 1384
1385 MachineOperatorBuilder* JSCreateLowering::machine() const { 1385 MachineOperatorBuilder* JSCreateLowering::machine() const {
1386 return jsgraph()->machine(); 1386 return jsgraph()->machine();
1387 } 1387 }
1388 1388
1389 } // namespace compiler 1389 } // namespace compiler
1390 } // namespace internal 1390 } // namespace internal
1391 } // namespace v8 1391 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-info.cc ('k') | src/crankshaft/hydrogen.h » ('j') | src/factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698