5 #ifndef V8_COMPILER_ALLOCATION_BUILDER_H_ 6 #define V8_COMPILER_ALLOCATION_BUILDER_H_ 8 #include "src/compiler/js-graph.h" 9 #include "src/compiler/node.h" 10 #include "src/compiler/simplified-operator.h" 28 void Allocate(
int size, PretenureFlag pretenure = NOT_TENURED,
30 DCHECK_LE(size, kMaxRegularHeapObjectSize);
31 effect_ = graph()->NewNode(
32 common()->BeginRegion(RegionObservability::kNotObservable), effect_);
34 graph()->NewNode(simplified()->Allocate(
type, pretenure),
35 jsgraph()->
Constant(size), effect_, control_);
36 effect_ = allocation_;
41 effect_ = graph()->NewNode(simplified()->StoreField(access), allocation_,
42 value, effect_, control_);
47 effect_ = graph()->NewNode(simplified()->StoreElement(access), allocation_,
48 index, value, effect_, control_);
52 inline void AllocateContext(
int variadic_part_length,
Handle<Map> map);
55 inline void AllocateArray(
int length,
Handle<Map> map,
56 PretenureFlag pretenure = NOT_TENURED);
60 Store(access, jsgraph()->
Constant(value));
64 Store(access, jsgraph()->
Constant(value));
67 void FinishAndChange(
Node* node) {
68 NodeProperties::SetType(allocation_, NodeProperties::GetType(node));
69 node->ReplaceInput(0, allocation_);
70 node->ReplaceInput(1, effect_);
71 node->TrimInputCount(2);
72 NodeProperties::ChangeOp(node, common()->FinishRegion());
76 return graph()->NewNode(common()->FinishRegion(), allocation_, effect_);
80 JSGraph* jsgraph() {
return jsgraph_; }
81 Isolate* isolate()
const {
return jsgraph_->isolate(); }
82 Graph* graph() {
return jsgraph_->graph(); }
97 #endif // V8_COMPILER_ALLOCATION_BUILDER_H_