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

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

Issue 1963583004: [turbofan] Initial version of allocation folding and write barrier elimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Jaros comments; Created 4 years, 7 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/compiler/js-generic-lowering.cc ('k') | src/compiler/linkage.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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 this_control = 305 this_control =
306 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, 306 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state,
307 this_effect, this_control); 307 this_effect, this_control);
308 this_value = graph()->NewNode(common()->Guard(Type::Number()), 308 this_value = graph()->NewNode(common()->Guard(Type::Number()),
309 this_value, this_control); 309 this_value, this_control);
310 310
311 if (!field_index.is_inobject() || field_index.is_hidden_field() || 311 if (!field_index.is_inobject() || field_index.is_hidden_field() ||
312 !FLAG_unbox_double_fields) { 312 !FLAG_unbox_double_fields) {
313 if (access_info.HasTransitionMap()) { 313 if (access_info.HasTransitionMap()) {
314 // Allocate a MutableHeapNumber for the new property. 314 // Allocate a MutableHeapNumber for the new property.
315 Callable callable = 315 this_effect =
316 CodeFactory::AllocateMutableHeapNumber(isolate()); 316 graph()->NewNode(common()->BeginRegion(), this_effect);
317 CallDescriptor* desc = Linkage::GetStubCallDescriptor( 317 Node* this_box = this_effect =
318 isolate(), jsgraph()->zone(), callable.descriptor(), 0, 318 graph()->NewNode(simplified()->Allocate(NOT_TENURED),
319 CallDescriptor::kNoFlags, Operator::kNoThrow); 319 jsgraph()->Constant(HeapNumber::kSize),
320 Node* this_box = this_effect = graph()->NewNode( 320 this_effect, this_control);
321 common()->Call(desc), 321 this_effect = graph()->NewNode(
322 jsgraph()->HeapConstant(callable.code()), 322 simplified()->StoreField(AccessBuilder::ForMap()), this_box,
323 jsgraph()->NoContextConstant(), this_effect, this_control); 323 jsgraph()->HeapConstant(factory()->mutable_heap_number_map()),
324 this_effect, this_control);
324 this_effect = graph()->NewNode( 325 this_effect = graph()->NewNode(
325 simplified()->StoreField(AccessBuilder::ForHeapNumberValue()), 326 simplified()->StoreField(AccessBuilder::ForHeapNumberValue()),
326 this_box, this_value, this_effect, this_control); 327 this_box, this_value, this_effect, this_control);
327 this_value = this_box; 328 this_value = this_effect = graph()->NewNode(
329 common()->FinishRegion(), this_box, this_effect);
328 330
329 field_access.type = Type::TaggedPointer(); 331 field_access.type = Type::TaggedPointer();
330 } else { 332 } else {
331 // We just store directly to the MutableHeapNumber. 333 // We just store directly to the MutableHeapNumber.
332 this_storage = this_effect = 334 this_storage = this_effect =
333 graph()->NewNode(simplified()->LoadField(field_access), 335 graph()->NewNode(simplified()->LoadField(field_access),
334 this_storage, this_effect, this_control); 336 this_storage, this_effect, this_control);
335 field_access.offset = HeapNumber::kValueOffset; 337 field_access.offset = HeapNumber::kValueOffset;
336 field_access.name = MaybeHandle<Name>(); 338 field_access.name = MaybeHandle<Name>();
337 field_access.machine_type = MachineType::Float64(); 339 field_access.machine_type = MachineType::Float64();
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1032 }
1031 1033
1032 1034
1033 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 1035 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
1034 return jsgraph()->simplified(); 1036 return jsgraph()->simplified();
1035 } 1037 }
1036 1038
1037 } // namespace compiler 1039 } // namespace compiler
1038 } // namespace internal 1040 } // namespace internal
1039 } // namespace v8 1041 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698