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

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

Issue 2797993006: [turbofan] Add type to the allocation operator. (Closed)
Patch Set: Remove caching Created 3 years, 8 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-builtin-reducer.cc ('k') | src/compiler/js-native-context-specialization.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 #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 25 matching lines...) Expand all
36 effect_(effect), 36 effect_(effect),
37 control_(control) {} 37 control_(control) {}
38 38
39 // Primitive allocation of static size. 39 // Primitive allocation of static size.
40 void Allocate(int size, PretenureFlag pretenure = NOT_TENURED, 40 void Allocate(int size, PretenureFlag pretenure = NOT_TENURED,
41 Type* type = Type::Any()) { 41 Type* type = Type::Any()) {
42 DCHECK_LE(size, kMaxRegularHeapObjectSize); 42 DCHECK_LE(size, kMaxRegularHeapObjectSize);
43 effect_ = graph()->NewNode( 43 effect_ = graph()->NewNode(
44 common()->BeginRegion(RegionObservability::kNotObservable), effect_); 44 common()->BeginRegion(RegionObservability::kNotObservable), effect_);
45 allocation_ = 45 allocation_ =
46 graph()->NewNode(simplified()->Allocate(pretenure), 46 graph()->NewNode(simplified()->Allocate(type, pretenure),
47 jsgraph()->Constant(size), effect_, control_); 47 jsgraph()->Constant(size), effect_, control_);
48 // TODO(turbofan): Maybe we should put the Type* onto the Allocate operator
49 // at some point, or maybe we should have a completely differnt story.
50 NodeProperties::SetType(allocation_, type);
51 effect_ = allocation_; 48 effect_ = allocation_;
52 } 49 }
53 50
54 // Primitive store into a field. 51 // Primitive store into a field.
55 void Store(const FieldAccess& access, Node* value) { 52 void Store(const FieldAccess& access, Node* value) {
56 effect_ = graph()->NewNode(simplified()->StoreField(access), allocation_, 53 effect_ = graph()->NewNode(simplified()->StoreField(access), allocation_,
57 value, effect_, control_); 54 value, effect_, control_);
58 } 55 }
59 56
60 // Primitive store into an element. 57 // Primitive store into an element.
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 return jsgraph()->simplified(); 1354 return jsgraph()->simplified();
1358 } 1355 }
1359 1356
1360 MachineOperatorBuilder* JSCreateLowering::machine() const { 1357 MachineOperatorBuilder* JSCreateLowering::machine() const {
1361 return jsgraph()->machine(); 1358 return jsgraph()->machine();
1362 } 1359 }
1363 1360
1364 } // namespace compiler 1361 } // namespace compiler
1365 } // namespace internal 1362 } // namespace internal
1366 } // namespace v8 1363 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/compiler/js-native-context-specialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698