Home | History | Annotate | Download | only in compiler

Lines Matching refs:Node

12 #include "src/compiler/node-properties.h"
23 Reduction ChangeLowering::Reduce(Node* node) {
24 Node* control = graph()->start();
25 switch (node->opcode()) {
27 return ChangeBitToBool(node->InputAt(0), control);
29 return ChangeBoolToBit(node->InputAt(0));
31 return ChangeFloat64ToTagged(node->InputAt(0), control);
33 return ChangeInt32ToTagged(node->InputAt(0), control);
35 return ChangeTaggedToFloat64(node->InputAt(0), control);
37 return ChangeTaggedToUI32(node->InputAt(0), control, kSigned);
39 return ChangeTaggedToUI32(node->InputAt(0), control, kUnsigned);
41 return ChangeUint32ToTagged(node->InputAt(0), control);
43 return LoadField(node);
45 return StoreField(node);
47 return LoadElement(node);
49 return StoreElement(node);
51 return Allocate(node);
60 Node* ChangeLowering::HeapNumberValueIndexConstant() {
65 Node* ChangeLowering::SmiMaxValueConstant() {
70 Node* ChangeLowering::SmiShiftBitsConstant() {
75 Node* ChangeLowering::AllocateHeapNumberWithValue(Node* value, Node* control) {
79 Node* target = jsgraph()->HeapConstant(callable.code());
80 Node* context = jsgraph()->NoContextConstant();
81 Node* effect = graph()->NewNode(common()->BeginRegion(), graph()->start());
88 Node* heap_number = graph()->NewNode(allocate_heap_number_operator_.get(),
90 Node* store = graph()->NewNode(
98 Node* ChangeLowering::ChangeInt32ToFloat64(Node* value) {
103 Node* ChangeLowering::ChangeInt32ToSmi(Node* value) {
111 Node* ChangeLowering::ChangeSmiToFloat64(Node* value) {
116 Node* ChangeLowering::ChangeSmiToInt32(Node* value) {
125 Node* ChangeLowering::ChangeUint32ToFloat64(Node* value) {
130 Node* ChangeLowering::ChangeUint32ToSmi(Node* value) {
138 Node* ChangeLowering::LoadHeapNumberValue(Node* value, Node* control) {
145 Node* ChangeLowering::TestNotSmi(Node* value) {
153 Reduction ChangeLowering::ChangeBitToBool(Node* value, Node* control) {
160 Reduction ChangeLowering::ChangeBoolToBit(Node* value) {
166 Reduction ChangeLowering::ChangeFloat64ToTagged(Node* value, Node* control) {
168 Node* const value32 = graph()->NewNode(
176 Node* check_same = graph()->NewNode(
179 Node* branch_same = graph()->NewNode(common()->Branch(), check_same, control);
181 Node* if_smi = graph()->NewNode(common()->IfTrue(), branch_same);
182 Node* vsmi;
183 Node* if_box = graph()->NewNode(common()->IfFalse(), branch_same);
184 Node* vbox;
188 Node* check_zero = graph()->NewNode(machine()->Word32Equal(), value32,
190 Node* branch_zero = graph()->NewNode(common()->Branch(BranchHint::kFalse),
193 Node* if_zero = graph()->NewNode(common()->IfTrue(), branch_zero);
194 Node* if_notzero = graph()->NewNode(common()->IfFalse(), branch_zero);
197 Node* check_negative = graph()->NewNode(
201 Node* branch_negative = graph()->NewNode(
204 Node* if_negative = graph()->NewNode(common()->IfTrue(), branch_negative);
205 Node* if_notnegative =
218 Node* smi_tag =
221 Node* check_ovf = graph()->NewNode(common()->Projection(1), smi_tag);
222 Node* branch_ovf = graph()->NewNode(common()->Branch(BranchHint::kFalse),
225 Node* if_ovf = graph()->NewNode(common()->IfTrue(), branch_ovf);
242 Reduction ChangeLowering::ChangeInt32ToTagged(Node* value, Node* control) {
248 Node* add = graph()->NewNode(machine()->Int32AddWithOverflow(), value, value);
250 Node* ovf = graph()->NewNode(common()->Projection(1), add);
251 Node* branch =
254 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
255 Node* vtrue =
258 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
259 Node* vfalse = graph()->NewNode(common()->Projection(0), add);
261 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
262 Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
269 Reduction ChangeLowering::ChangeTaggedToUI32(Node* value, Node* control,
283 Node* check = TestNotSmi(value);
284 Node* branch =
287 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
288 Node* vtrue = graph()->NewNode(op, LoadHeapNumberValue(value, if_true));
290 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
291 Node* vfalse = ChangeSmiToInt32(value);
293 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
294 Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kWord32, 2),
303 bool CanCover(Node* value, IrOpcode::Value opcode) {
319 Reduction ChangeLowering::ChangeTaggedToFloat64(Node* value, Node* control) {
326 Node* const object = NodeProperties::GetValueInput(value, 0);
327 Node* const context = NodeProperties::GetContextInput(value);
328 Node* const frame_state = NodeProperties::GetFrameStateInput(value, 0);
329 Node* const effect = NodeProperties::GetEffectInput(value);
330 Node* const control = NodeProperties::GetControlInput(value);
336 Node* check1 = TestNotSmi(object);
337 Node* branch1 =
340 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
341 Node* vtrue1 = graph()->NewNode(value->op(), object, context, frame_state,
343 Node* etrue1 = vtrue1;
345 Node* check2 = TestNotSmi(vtrue1);
346 Node* branch2 = graph()->NewNode(common()->Branch(), check2, if_true1);
348 Node* if_true2 = graph()->NewNode(common()->IfTrue(), branch2);
349 Node* vtrue2 = LoadHeapNumberValue(vtrue1, if_true2);
351 Node* if_false2 = graph()->NewNode(common()->IfFalse(), branch2);
352 Node* vfalse2 = ChangeSmiToFloat64(vtrue1);
357 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1);
358 Node* vfalse1 = ChangeSmiToFloat64(object);
359 Node* efalse1 = effect;
361 Node* merge1 = graph()->NewNode(merge_op, if_true1, if_false1);
362 Node* ephi1 = graph()->NewNode(ephi_op, etrue1, efalse1, merge1);
363 Node* phi1 = graph()->NewNode(phi_op, vtrue1, vfalse1, merge1);
369 // the node and places it inside the diamond. Come up with a helper method!
370 for (Node* use : etrue1->uses()) {
380 Node* check = TestNotSmi(value);
381 Node* branch =
384 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
385 Node* vtrue = LoadHeapNumberValue(value, if_true);
387 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
388 Node* vfalse = ChangeSmiToFloat64(value);
390 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
391 Node* phi = graph()->NewNode(
398 Reduction ChangeLowering::ChangeUint32ToTagged(Node* value, Node* control) {
403 Node* check = graph()->NewNode(machine()->Uint32LessThanOrEqual(), value,
405 Node* branch =
408 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
409 Node* vtrue = ChangeUint32ToSmi(value);
411 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
412 Node* vfalse =
415 Node* merge = graph()->NewNode(common()->Merge(2), if_true, if_false);
416 Node* phi = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
484 Reduction ChangeLowering::LoadField(Node* node) {
485 const FieldAccess& access = FieldAccessOf(node->op());
486 Node* offset = jsgraph()->IntPtrConstant(access.offset - access.tag());
487 node->InsertInput(graph()->zone(), 1, offset);
488 NodeProperties::ChangeOp(node, machine()->Load(access.machine_type));
489 return Changed(node);
493 Reduction ChangeLowering::StoreField(Node* node) {
494 const FieldAccess& access = FieldAccessOf(node->op());
495 Type* type = NodeProperties::GetType(node->InputAt(1));
499 Node* offset = jsgraph()->IntPtrConstant(access.offset - access.tag());
500 node->InsertInput(graph()->zone(), 1, offset);
501 NodeProperties::ChangeOp(node,
504 return Changed(node);
508 Node* ChangeLowering::ComputeIndex(const ElementAccess& access,
509 Node* const key) {
510 Node* index = key;
532 Reduction ChangeLowering::LoadElement(Node* node) {
533 const ElementAccess& access = ElementAccessOf(node->op());
534 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
535 NodeProperties::ChangeOp(node, machine()->Load(access.machine_type));
536 return Changed(node);
540 Reduction ChangeLowering::StoreElement(Node* node) {
541 const ElementAccess& access = ElementAccessOf(node->op());
542 Type* type = NodeProperties::GetType(node->InputAt(2));
543 node->ReplaceInput(1, ComputeIndex(access, node->InputAt(1)));
545 node, machine()->Store(StoreRepresentation(
550 return Changed(node);
554 Reduction ChangeLowering::Allocate(Node* node) {
555 PretenureFlag pretenure = OpParameter<PretenureFlag>(node->op());
558 Node* target = jsgraph()->HeapConstant(callable.code());
563 node->InsertInput(graph()->zone(), 0, target);
564 node->InsertInput(graph()->zone(), 2, jsgraph()->NoContextConstant());
565 NodeProperties::ChangeOp(node, op);
570 Operator::Properties props = node->op()->properties();
575 node->InsertInput(graph()->zone(), 0, jsgraph()->CEntryStubConstant(1));
576 node->InsertInput(graph()->zone(), 2, jsgraph()->SmiConstant(flags));
577 node->InsertInput(graph()->zone(), 3, jsgraph()->ExternalConstant(ref));
578 node->InsertInput(graph()->zone(), 4, jsgraph()->Int32Constant(2));
579 node->InsertInput(graph()->zone(), 5, jsgraph()->NoContextConstant());
580 NodeProperties::ChangeOp(node, common()->Call(desc));
582 return Changed(node);