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

Side by Side Diff: src/compiler/js-native-context-specialization.cc

Issue 1514863002: [turbofan] Make FieldAccess::name usable in practice. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment. Created 5 years 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/compiler/access-builder.cc ('k') | src/compiler/simplified-operator.h » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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-native-context-specialization.h" 5 #include "src/compiler/js-native-context-specialization.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 if (access_mode == AccessMode::kLoad && 246 if (access_mode == AccessMode::kLoad &&
247 access_info.holder().ToHandle(&holder)) { 247 access_info.holder().ToHandle(&holder)) {
248 this_receiver = jsgraph()->Constant(holder); 248 this_receiver = jsgraph()->Constant(holder);
249 } 249 }
250 Node* this_storage = this_receiver; 250 Node* this_storage = this_receiver;
251 if (!field_index.is_inobject()) { 251 if (!field_index.is_inobject()) {
252 this_storage = this_effect = graph()->NewNode( 252 this_storage = this_effect = graph()->NewNode(
253 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), 253 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()),
254 this_storage, this_effect, this_control); 254 this_storage, this_effect, this_control);
255 } 255 }
256 FieldAccess field_access = {kTaggedBase, field_index.offset(), name, 256 const char* field_name =
257 AccessBuilder::GetNameForTracing(name, graph()->zone());
258 FieldAccess field_access = {kTaggedBase, field_index.offset(), field_name,
257 field_type, MachineType::AnyTagged()}; 259 field_type, MachineType::AnyTagged()};
258 if (access_mode == AccessMode::kLoad) { 260 if (access_mode == AccessMode::kLoad) {
259 if (field_type->Is(Type::UntaggedFloat64())) { 261 if (field_type->Is(Type::UntaggedFloat64())) {
260 if (!field_index.is_inobject() || field_index.is_hidden_field() || 262 if (!field_index.is_inobject() || field_index.is_hidden_field() ||
261 !FLAG_unbox_double_fields) { 263 !FLAG_unbox_double_fields) {
262 this_storage = this_effect = 264 this_storage = this_effect =
263 graph()->NewNode(simplified()->LoadField(field_access), 265 graph()->NewNode(simplified()->LoadField(field_access),
264 this_storage, this_effect, this_control); 266 this_storage, this_effect, this_control);
265 field_access.offset = HeapNumber::kValueOffset; 267 field_access.offset = HeapNumber::kValueOffset;
266 field_access.name = MaybeHandle<Name>(); 268 field_access.name = "HeapNumber::value";
267 } 269 }
268 field_access.machine_type = MachineType::Float64(); 270 field_access.machine_type = MachineType::Float64();
269 } 271 }
270 this_value = this_effect = 272 this_value = this_effect =
271 graph()->NewNode(simplified()->LoadField(field_access), 273 graph()->NewNode(simplified()->LoadField(field_access),
272 this_storage, this_effect, this_control); 274 this_storage, this_effect, this_control);
273 } else { 275 } else {
274 DCHECK_EQ(AccessMode::kStore, access_mode); 276 DCHECK_EQ(AccessMode::kStore, access_mode);
275 if (field_type->Is(Type::UntaggedFloat64())) { 277 if (field_type->Is(Type::UntaggedFloat64())) {
276 Node* check = 278 Node* check =
(...skipping 24 matching lines...) Expand all
301 this_box, this_value, this_effect, this_control); 303 this_box, this_value, this_effect, this_control);
302 this_value = this_box; 304 this_value = this_box;
303 305
304 field_access.type = Type::TaggedPointer(); 306 field_access.type = Type::TaggedPointer();
305 } else { 307 } else {
306 // We just store directly to the MutableHeapNumber. 308 // We just store directly to the MutableHeapNumber.
307 this_storage = this_effect = 309 this_storage = this_effect =
308 graph()->NewNode(simplified()->LoadField(field_access), 310 graph()->NewNode(simplified()->LoadField(field_access),
309 this_storage, this_effect, this_control); 311 this_storage, this_effect, this_control);
310 field_access.offset = HeapNumber::kValueOffset; 312 field_access.offset = HeapNumber::kValueOffset;
311 field_access.name = MaybeHandle<Name>(); 313 field_access.name = "HeapNumber::value";
312 field_access.machine_type = MachineType::Float64(); 314 field_access.machine_type = MachineType::Float64();
313 } 315 }
314 } else { 316 } else {
315 // Unboxed double field, we store directly to the field. 317 // Unboxed double field, we store directly to the field.
316 field_access.machine_type = MachineType::Float64(); 318 field_access.machine_type = MachineType::Float64();
317 } 319 }
318 } else if (field_type->Is(Type::TaggedSigned())) { 320 } else if (field_type->Is(Type::TaggedSigned())) {
319 Node* check = 321 Node* check =
320 graph()->NewNode(simplified()->ObjectIsSmi(), this_value); 322 graph()->NewNode(simplified()->ObjectIsSmi(), this_value);
321 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), 323 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue),
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 } 1022 }
1021 1023
1022 1024
1023 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 1025 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
1024 return jsgraph()->simplified(); 1026 return jsgraph()->simplified();
1025 } 1027 }
1026 1028
1027 } // namespace compiler 1029 } // namespace compiler
1028 } // namespace internal 1030 } // namespace internal
1029 } // namespace v8 1031 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/access-builder.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698