5 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ 8 #include "src/assembler.h" 9 #include "src/compiler/common-operator.h" 10 #include "src/compiler/graph.h" 11 #include "src/compiler/linkage.h" 12 #include "src/compiler/machine-operator.h" 13 #include "src/compiler/node.h" 14 #include "src/compiler/operator.h" 15 #include "src/globals.h" 16 #include "src/heap/factory.h" 23 class RawMachineLabel;
42 MachineRepresentation word = MachineType::PointerRepresentation(),
44 MachineOperatorBuilder::Flag::kNoFlags,
47 FullUnalignedAccessSupport(),
48 PoisoningMitigationLevel poisoning_level =
49 PoisoningMitigationLevel::kPoisonCriticalOnly);
52 Isolate* isolate()
const {
return isolate_; }
53 Graph* graph()
const {
return graph_; }
54 Zone* zone()
const {
return graph()->zone(); }
57 CallDescriptor* call_descriptor()
const {
return call_descriptor_; }
58 PoisoningMitigationLevel poisoning_level()
const {
return poisoning_level_; }
66 Graph* ExportForOptimization();
74 Node* UndefinedConstant();
77 Node* PointerConstant(
void* value) {
78 return IntPtrConstant(reinterpret_cast<intptr_t>(value));
80 Node* IntPtrConstant(intptr_t value) {
82 return kPointerSize == 8 ? Int64Constant(value)
83 : Int32Constant(static_cast<int>(value));
85 Node* RelocatableIntPtrConstant(intptr_t value, RelocInfo::Mode rmode);
86 Node* Int32Constant(int32_t value) {
87 return AddNode(common()->Int32Constant(value));
89 Node* StackSlot(MachineRepresentation rep,
int alignment = 0) {
90 return AddNode(machine()->StackSlot(rep, alignment));
93 return AddNode(common()->Int64Constant(value));
95 Node* NumberConstant(
double value) {
96 return AddNode(common()->NumberConstant(value));
98 Node* Float32Constant(
float value) {
99 return AddNode(common()->Float32Constant(value));
101 Node* Float64Constant(
double value) {
102 return AddNode(common()->Float64Constant(value));
105 return AddNode(common()->HeapConstant(
object));
108 return AddNode(common()->ExternalConstant(address));
110 Node* RelocatableInt32Constant(int32_t value, RelocInfo::Mode rmode) {
111 return AddNode(common()->RelocatableInt32Constant(value, rmode));
113 Node* RelocatableInt64Constant(
int64_t value, RelocInfo::Mode rmode) {
114 return AddNode(common()->RelocatableInt64Constant(value, rmode));
117 Node* Projection(
int index,
Node* a) {
118 return AddNode(common()->Projection(index), a);
123 LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
124 return Load(rep, base, IntPtrConstant(0), needs_poisoning);
127 LoadSensitivity needs_poisoning = LoadSensitivity::kSafe) {
128 const Operator* op = machine()->Load(rep);
129 CHECK_NE(PoisoningMitigationLevel::kPoisonAll, poisoning_level_);
130 if (needs_poisoning == LoadSensitivity::kCritical &&
131 poisoning_level_ == PoisoningMitigationLevel::kPoisonCriticalOnly) {
132 op = machine()->PoisonedLoad(rep);
134 return AddNode(op, base, index);
136 Node* Store(MachineRepresentation rep,
Node* base,
Node* value,
137 WriteBarrierKind write_barrier) {
138 return Store(rep, base, IntPtrConstant(0), value, write_barrier);
140 Node* Store(MachineRepresentation rep,
Node* base,
Node* index,
Node* value,
141 WriteBarrierKind write_barrier) {
145 Node* Retain(
Node* value) {
return AddNode(common()->Retain(), value); }
149 return UnalignedLoad(
type, base, IntPtrConstant(0));
152 if (machine()->UnalignedLoadSupported(
type.representation())) {
153 return AddNode(machine()->Load(
type), base, index);
155 return AddNode(machine()->UnalignedLoad(
type), base, index);
158 Node* UnalignedStore(MachineRepresentation rep,
Node* base,
Node* value) {
159 return UnalignedStore(rep, base, IntPtrConstant(0), value);
161 Node* UnalignedStore(MachineRepresentation rep,
Node* base,
Node* index,
163 if (machine()->UnalignedStoreSupported(rep)) {
165 rep, WriteBarrierKind::kNoWriteBarrier)),
169 machine()->UnalignedStore(UnalignedStoreRepresentation(rep)), base,
176 if (
type.representation() == MachineRepresentation::kWord64) {
177 if (machine()->Is64()) {
178 return AddNode(machine()->Word64AtomicLoad(
type), base, index);
180 return AddNode(machine()->Word32AtomicPairLoad(), base, index);
183 return AddNode(machine()->Word32AtomicLoad(
type), base, index);
186 #if defined(V8_TARGET_BIG_ENDIAN) 187 #define VALUE_HALVES value_high, value 189 #define VALUE_HALVES value, value_high 192 Node* AtomicStore(MachineRepresentation rep,
Node* base,
Node* index,
194 if (rep == MachineRepresentation::kWord64) {
195 if (machine()->Is64()) {
196 DCHECK_NULL(value_high);
197 return AddNode(machine()->Word64AtomicStore(rep), base, index, value);
199 return AddNode(machine()->Word32AtomicPairStore(), base, index,
203 DCHECK_NULL(value_high);
204 return AddNode(machine()->Word32AtomicStore(rep), base, index, value);
206 #define ATOMIC_FUNCTION(name) \ 207 Node* Atomic##name(MachineType rep, Node* base, Node* index, Node* value, \ 208 Node* value_high) { \ 209 if (rep.representation() == MachineRepresentation::kWord64) { \ 210 if (machine()->Is64()) { \ 211 DCHECK_NULL(value_high); \ 212 return AddNode(machine()->Word64Atomic##name(rep), base, index, \ 215 return AddNode(machine()->Word32AtomicPair##name(), base, index, \ 219 DCHECK_NULL(value_high); \ 220 return AddNode(machine()->Word32Atomic##name(rep), base, index, value); \ 222 ATOMIC_FUNCTION(Exchange);
223 ATOMIC_FUNCTION(Add);
224 ATOMIC_FUNCTION(Sub);
225 ATOMIC_FUNCTION(And);
227 ATOMIC_FUNCTION(Xor);
228 #undef ATOMIC_FUNCTION 232 Node* old_value,
Node* old_value_high,
233 Node* new_value,
Node* new_value_high) {
234 if (rep.representation() == MachineRepresentation::kWord64) {
235 if (machine()->Is64()) {
236 DCHECK_NULL(old_value_high);
237 DCHECK_NULL(new_value_high);
238 return AddNode(machine()->Word64AtomicCompareExchange(rep), base, index,
239 old_value, new_value);
241 return AddNode(machine()->Word32AtomicPairCompareExchange(), base,
242 index, old_value, old_value_high, new_value,
246 DCHECK_NULL(old_value_high);
247 DCHECK_NULL(new_value_high);
248 return AddNode(machine()->Word32AtomicCompareExchange(rep), base, index,
249 old_value, new_value);
252 Node* SpeculationFence() {
253 return AddNode(machine()->SpeculationFence().op());
258 return AddNode(machine()->WordAnd(), a, b);
260 Node* WordOr(
Node* a,
Node* b) {
return AddNode(machine()->WordOr(), a, b); }
262 return AddNode(machine()->WordXor(), a, b);
265 return AddNode(machine()->WordShl(), a, b);
268 return AddNode(machine()->WordShr(), a, b);
271 return AddNode(machine()->WordSar(), a, b);
274 return AddNode(machine()->WordRor(), a, b);
277 return AddNode(machine()->WordEqual(), a, b);
280 return Word32BinaryNot(WordEqual(a, b));
283 if (machine()->Is32()) {
284 return Word32BitwiseNot(a);
291 return AddNode(machine()->Word32And(), a, b);
294 return AddNode(machine()->Word32Or(), a, b);
297 return AddNode(machine()->Word32Xor(), a, b);
300 return AddNode(machine()->Word32Shl(), a, b);
303 return AddNode(machine()->Word32Shr(), a, b);
306 return AddNode(machine()->Word32Sar(), a, b);
309 return AddNode(machine()->Word32Ror(), a, b);
311 Node* Word32Clz(
Node* a) {
return AddNode(machine()->Word32Clz(), a); }
313 return AddNode(machine()->Word32Equal(), a, b);
316 return Word32BinaryNot(Word32Equal(a, b));
318 Node* Word32BitwiseNot(
Node* a) {
return Word32Xor(a, Int32Constant(-1)); }
319 Node* Word32BinaryNot(
Node* a) {
return Word32Equal(a, Int32Constant(0)); }
322 return AddNode(machine()->Word64And(), a, b);
325 return AddNode(machine()->Word64Or(), a, b);
328 return AddNode(machine()->Word64Xor(), a, b);
331 return AddNode(machine()->Word64Shl(), a, b);
334 return AddNode(machine()->Word64Shr(), a, b);
337 return AddNode(machine()->Word64Sar(), a, b);
340 return AddNode(machine()->Word64Ror(), a, b);
342 Node* Word64Clz(
Node* a) {
return AddNode(machine()->Word64Clz(), a); }
344 return AddNode(machine()->Word64Equal(), a, b);
347 return Word32BinaryNot(Word64Equal(a, b));
349 Node* Word64Not(
Node* a) {
return Word64Xor(a, Int64Constant(-1)); }
352 return AddNode(machine()->Int32Add(), a, b);
355 return AddNode(machine()->Int32AddWithOverflow(), a, b);
358 return AddNode(machine()->Int32Sub(), a, b);
361 return AddNode(machine()->Int32SubWithOverflow(), a, b);
364 return AddNode(machine()->Int32Mul(), a, b);
367 return AddNode(machine()->Int32MulHigh(), a, b);
370 return AddNode(machine()->Int32MulWithOverflow(), a, b);
373 return AddNode(machine()->Int32Div(), a, b);
376 return AddNode(machine()->Int32Mod(), a, b);
379 return AddNode(machine()->Int32LessThan(), a, b);
382 return AddNode(machine()->Int32LessThanOrEqual(), a, b);
385 return AddNode(machine()->Uint32Div(), a, b);
388 return AddNode(machine()->Uint32LessThan(), a, b);
391 return AddNode(machine()->Uint32LessThanOrEqual(), a, b);
394 return AddNode(machine()->Uint32Mod(), a, b);
397 return AddNode(machine()->Uint32MulHigh(), a, b);
399 Node* Int32GreaterThan(
Node* a,
Node* b) {
return Int32LessThan(b, a); }
401 return Int32LessThanOrEqual(b, a);
403 Node* Uint32GreaterThan(
Node* a,
Node* b) {
return Uint32LessThan(b, a); }
405 return Uint32LessThanOrEqual(b, a);
407 Node* Int32Neg(
Node* a) {
return Int32Sub(Int32Constant(0), a); }
410 return AddNode(machine()->Int64Add(), a, b);
413 return AddNode(machine()->Int64AddWithOverflow(), a, b);
416 return AddNode(machine()->Int64Sub(), a, b);
419 return AddNode(machine()->Int64SubWithOverflow(), a, b);
422 return AddNode(machine()->Int64Mul(), a, b);
425 return AddNode(machine()->Int64Div(), a, b);
428 return AddNode(machine()->Int64Mod(), a, b);
430 Node* Int64Neg(
Node* a) {
return Int64Sub(Int64Constant(0), a); }
432 return AddNode(machine()->Int64LessThan(), a, b);
435 return AddNode(machine()->Int64LessThanOrEqual(), a, b);
438 return AddNode(machine()->Uint64LessThan(), a, b);
441 return AddNode(machine()->Uint64LessThanOrEqual(), a, b);
443 Node* Int64GreaterThan(
Node* a,
Node* b) {
return Int64LessThan(b, a); }
445 return Int64LessThanOrEqual(b, a);
447 Node* Uint64GreaterThan(
Node* a,
Node* b) {
return Uint64LessThan(b, a); }
449 return Uint64LessThanOrEqual(b, a);
452 return AddNode(machine()->Uint64Div(), a, b);
455 return AddNode(machine()->Uint64Mod(), a, b);
458 return AddNode(machine()->Int32PairAdd(), a_low, a_high, b_low, b_high);
461 return AddNode(machine()->Int32PairSub(), a_low, a_high, b_low, b_high);
464 return AddNode(machine()->Int32PairMul(), a_low, a_high, b_low, b_high);
467 return AddNode(machine()->Word32PairShl(), low_word, high_word, shift);
470 return AddNode(machine()->Word32PairShr(), low_word, high_word, shift);
473 return AddNode(machine()->Word32PairSar(), low_word, high_word, shift);
476 #define INTPTR_BINOP(prefix, name) \ 477 Node* IntPtr##name(Node* a, Node* b) { \ 478 return kPointerSize == 8 ? prefix##64##name(a, b) \ 479 : prefix##32##name(a, b); \ 482 INTPTR_BINOP(Int, Add);
483 INTPTR_BINOP(Int, AddWithOverflow);
484 INTPTR_BINOP(Int, Sub);
485 INTPTR_BINOP(Int, SubWithOverflow);
486 INTPTR_BINOP(Int, Mul);
487 INTPTR_BINOP(Int, Div);
488 INTPTR_BINOP(Int, LessThan);
489 INTPTR_BINOP(Int, LessThanOrEqual);
490 INTPTR_BINOP(Word, Equal);
491 INTPTR_BINOP(Word, NotEqual);
492 INTPTR_BINOP(Int, GreaterThanOrEqual);
493 INTPTR_BINOP(Int, GreaterThan);
497 #define UINTPTR_BINOP(prefix, name) \ 498 Node* UintPtr##name(Node* a, Node* b) { \ 499 return kPointerSize == 8 ? prefix##64##name(a, b) \ 500 : prefix##32##name(a, b); \ 503 UINTPTR_BINOP(Uint, LessThan);
504 UINTPTR_BINOP(Uint, LessThanOrEqual);
505 UINTPTR_BINOP(Uint, GreaterThanOrEqual);
506 UINTPTR_BINOP(Uint, GreaterThan);
510 Node* Int32AbsWithOverflow(
Node* a) {
511 return AddNode(machine()->Int32AbsWithOverflow().op(), a);
514 Node* Int64AbsWithOverflow(
Node* a) {
515 return AddNode(machine()->Int64AbsWithOverflow().op(), a);
518 Node* IntPtrAbsWithOverflow(
Node* a) {
519 return kPointerSize == 8 ? Int64AbsWithOverflow(a)
520 : Int32AbsWithOverflow(a);
524 return AddNode(machine()->Float32Add(), a, b);
527 return AddNode(machine()->Float32Sub(), a, b);
530 return AddNode(machine()->Float32Mul(), a, b);
533 return AddNode(machine()->Float32Div(), a, b);
535 Node* Float32Abs(
Node* a) {
return AddNode(machine()->Float32Abs(), a); }
536 Node* Float32Neg(
Node* a) {
return AddNode(machine()->Float32Neg(), a); }
537 Node* Float32Sqrt(
Node* a) {
return AddNode(machine()->Float32Sqrt(), a); }
539 return AddNode(machine()->Float32Equal(), a, b);
542 return Word32BinaryNot(Float32Equal(a, b));
545 return AddNode(machine()->Float32LessThan(), a, b);
548 return AddNode(machine()->Float32LessThanOrEqual(), a, b);
550 Node* Float32GreaterThan(
Node* a,
Node* b) {
return Float32LessThan(b, a); }
552 return Float32LessThanOrEqual(b, a);
555 return AddNode(machine()->Float32Max(), a, b);
558 return AddNode(machine()->Float32Min(), a, b);
561 return AddNode(machine()->Float64Add(), a, b);
564 return AddNode(machine()->Float64Sub(), a, b);
567 return AddNode(machine()->Float64Mul(), a, b);
570 return AddNode(machine()->Float64Div(), a, b);
573 return AddNode(machine()->Float64Mod(), a, b);
576 return AddNode(machine()->Float64Max(), a, b);
579 return AddNode(machine()->Float64Min(), a, b);
581 Node* Float64Abs(
Node* a) {
return AddNode(machine()->Float64Abs(), a); }
582 Node* Float64Neg(
Node* a) {
return AddNode(machine()->Float64Neg(), a); }
583 Node* Float64Acos(
Node* a) {
return AddNode(machine()->Float64Acos(), a); }
584 Node* Float64Acosh(
Node* a) {
return AddNode(machine()->Float64Acosh(), a); }
585 Node* Float64Asin(
Node* a) {
return AddNode(machine()->Float64Asin(), a); }
586 Node* Float64Asinh(
Node* a) {
return AddNode(machine()->Float64Asinh(), a); }
587 Node* Float64Atan(
Node* a) {
return AddNode(machine()->Float64Atan(), a); }
588 Node* Float64Atanh(
Node* a) {
return AddNode(machine()->Float64Atanh(), a); }
590 return AddNode(machine()->Float64Atan2(), a, b);
592 Node* Float64Cbrt(
Node* a) {
return AddNode(machine()->Float64Cbrt(), a); }
593 Node* Float64Cos(
Node* a) {
return AddNode(machine()->Float64Cos(), a); }
594 Node* Float64Cosh(
Node* a) {
return AddNode(machine()->Float64Cosh(), a); }
595 Node* Float64Exp(
Node* a) {
return AddNode(machine()->Float64Exp(), a); }
596 Node* Float64Expm1(
Node* a) {
return AddNode(machine()->Float64Expm1(), a); }
597 Node* Float64Log(
Node* a) {
return AddNode(machine()->Float64Log(), a); }
598 Node* Float64Log1p(
Node* a) {
return AddNode(machine()->Float64Log1p(), a); }
599 Node* Float64Log10(
Node* a) {
return AddNode(machine()->Float64Log10(), a); }
600 Node* Float64Log2(
Node* a) {
return AddNode(machine()->Float64Log2(), a); }
602 return AddNode(machine()->Float64Pow(), a, b);
604 Node* Float64Sin(
Node* a) {
return AddNode(machine()->Float64Sin(), a); }
605 Node* Float64Sinh(
Node* a) {
return AddNode(machine()->Float64Sinh(), a); }
606 Node* Float64Sqrt(
Node* a) {
return AddNode(machine()->Float64Sqrt(), a); }
607 Node* Float64Tan(
Node* a) {
return AddNode(machine()->Float64Tan(), a); }
608 Node* Float64Tanh(
Node* a) {
return AddNode(machine()->Float64Tanh(), a); }
610 return AddNode(machine()->Float64Equal(), a, b);
613 return Word32BinaryNot(Float64Equal(a, b));
616 return AddNode(machine()->Float64LessThan(), a, b);
619 return AddNode(machine()->Float64LessThanOrEqual(), a, b);
621 Node* Float64GreaterThan(
Node* a,
Node* b) {
return Float64LessThan(b, a); }
623 return Float64LessThanOrEqual(b, a);
627 Node* BitcastTaggedToWord(
Node* a) {
628 if (FLAG_verify_csa || FLAG_optimize_csa) {
629 return AddNode(machine()->BitcastTaggedToWord(), a);
633 Node* BitcastMaybeObjectToWord(
Node* a) {
634 if (FLAG_verify_csa || FLAG_optimize_csa) {
635 return AddNode(machine()->BitcastMaybeObjectToWord(), a);
639 Node* BitcastWordToTagged(
Node* a) {
640 return AddNode(machine()->BitcastWordToTagged(), a);
642 Node* BitcastWordToTaggedSigned(
Node* a) {
643 if (FLAG_verify_csa || FLAG_optimize_csa) {
644 return AddNode(machine()->BitcastWordToTaggedSigned(), a);
648 Node* TruncateFloat64ToWord32(
Node* a) {
649 return AddNode(machine()->TruncateFloat64ToWord32(), a);
651 Node* ChangeFloat32ToFloat64(
Node* a) {
652 return AddNode(machine()->ChangeFloat32ToFloat64(), a);
654 Node* ChangeInt32ToFloat64(
Node* a) {
655 return AddNode(machine()->ChangeInt32ToFloat64(), a);
657 Node* ChangeInt64ToFloat64(
Node* a) {
658 return AddNode(machine()->ChangeInt64ToFloat64(), a);
660 Node* ChangeUint32ToFloat64(
Node* a) {
661 return AddNode(machine()->ChangeUint32ToFloat64(), a);
663 Node* ChangeFloat64ToInt32(
Node* a) {
664 return AddNode(machine()->ChangeFloat64ToInt32(), a);
666 Node* ChangeFloat64ToInt64(
Node* a) {
667 return AddNode(machine()->ChangeFloat64ToInt64(), a);
669 Node* ChangeFloat64ToUint32(
Node* a) {
670 return AddNode(machine()->ChangeFloat64ToUint32(), a);
672 Node* ChangeFloat64ToUint64(
Node* a) {
673 return AddNode(machine()->ChangeFloat64ToUint64(), a);
675 Node* TruncateFloat64ToUint32(
Node* a) {
676 return AddNode(machine()->TruncateFloat64ToUint32(), a);
678 Node* TruncateFloat32ToInt32(
Node* a) {
679 return AddNode(machine()->TruncateFloat32ToInt32(), a);
681 Node* TruncateFloat32ToUint32(
Node* a) {
682 return AddNode(machine()->TruncateFloat32ToUint32(), a);
684 Node* TryTruncateFloat32ToInt64(
Node* a) {
685 return AddNode(machine()->TryTruncateFloat32ToInt64(), a);
687 Node* TryTruncateFloat64ToInt64(
Node* a) {
688 return AddNode(machine()->TryTruncateFloat64ToInt64(), a);
690 Node* TryTruncateFloat32ToUint64(
Node* a) {
691 return AddNode(machine()->TryTruncateFloat32ToUint64(), a);
693 Node* TryTruncateFloat64ToUint64(
Node* a) {
694 return AddNode(machine()->TryTruncateFloat64ToUint64(), a);
697 return AddNode(machine()->ChangeInt32ToInt64(), a);
699 Node* ChangeUint32ToUint64(
Node* a) {
700 return AddNode(machine()->ChangeUint32ToUint64(), a);
702 Node* TruncateFloat64ToFloat32(
Node* a) {
703 return AddNode(machine()->TruncateFloat64ToFloat32(), a);
705 Node* TruncateInt64ToInt32(
Node* a) {
706 return AddNode(machine()->TruncateInt64ToInt32(), a);
708 Node* RoundFloat64ToInt32(
Node* a) {
709 return AddNode(machine()->RoundFloat64ToInt32(), a);
711 Node* RoundInt32ToFloat32(
Node* a) {
712 return AddNode(machine()->RoundInt32ToFloat32(), a);
714 Node* RoundInt64ToFloat32(
Node* a) {
715 return AddNode(machine()->RoundInt64ToFloat32(), a);
717 Node* RoundInt64ToFloat64(
Node* a) {
718 return AddNode(machine()->RoundInt64ToFloat64(), a);
720 Node* RoundUint32ToFloat32(
Node* a) {
721 return AddNode(machine()->RoundUint32ToFloat32(), a);
723 Node* RoundUint64ToFloat32(
Node* a) {
724 return AddNode(machine()->RoundUint64ToFloat32(), a);
726 Node* RoundUint64ToFloat64(
Node* a) {
727 return AddNode(machine()->RoundUint64ToFloat64(), a);
729 Node* BitcastFloat32ToInt32(
Node* a) {
730 return AddNode(machine()->BitcastFloat32ToInt32(), a);
732 Node* BitcastFloat64ToInt64(
Node* a) {
733 return AddNode(machine()->BitcastFloat64ToInt64(), a);
735 Node* BitcastInt32ToFloat32(
Node* a) {
736 return AddNode(machine()->BitcastInt32ToFloat32(), a);
738 Node* BitcastInt64ToFloat64(
Node* a) {
739 return AddNode(machine()->BitcastInt64ToFloat64(), a);
742 return AddNode(machine()->Float32RoundDown().op(), a);
745 return AddNode(machine()->Float64RoundDown().op(), a);
748 return AddNode(machine()->Float32RoundUp().op(), a);
751 return AddNode(machine()->Float64RoundUp().op(), a);
753 Node* Float32RoundTruncate(
Node* a) {
754 return AddNode(machine()->Float32RoundTruncate().op(), a);
756 Node* Float64RoundTruncate(
Node* a) {
757 return AddNode(machine()->Float64RoundTruncate().op(), a);
759 Node* Float64RoundTiesAway(
Node* a) {
760 return AddNode(machine()->Float64RoundTiesAway().op(), a);
762 Node* Float32RoundTiesEven(
Node* a) {
763 return AddNode(machine()->Float32RoundTiesEven().op(), a);
765 Node* Float64RoundTiesEven(
Node* a) {
766 return AddNode(machine()->Float64RoundTiesEven().op(), a);
769 return AddNode(machine()->Word32ReverseBytes(), a);
772 return AddNode(machine()->Word64ReverseBytes(), a);
776 Node* Float64ExtractLowWord32(
Node* a) {
777 return AddNode(machine()->Float64ExtractLowWord32(), a);
779 Node* Float64ExtractHighWord32(
Node* a) {
780 return AddNode(machine()->Float64ExtractHighWord32(), a);
783 return AddNode(machine()->Float64InsertLowWord32(), a, b);
786 return AddNode(machine()->Float64InsertHighWord32(), a, b);
789 return AddNode(machine()->Float64SilenceNaN(), a);
793 Node* LoadStackPointer() {
return AddNode(machine()->LoadStackPointer()); }
794 Node* LoadFramePointer() {
return AddNode(machine()->LoadFramePointer()); }
795 Node* LoadParentFramePointer() {
796 return AddNode(machine()->LoadParentFramePointer());
800 Node* TargetParameter();
801 Node* Parameter(
size_t index);
804 Node* LoadFromPointer(
void* address,
MachineType rep, int32_t offset = 0) {
805 return Load(rep, PointerConstant(address), Int32Constant(offset));
807 Node* StoreToPointer(
void* address, MachineRepresentation rep,
Node* node) {
808 return Store(rep, PointerConstant(address), node, kNoWriteBarrier);
811 int32_t offset = 0) {
812 return UnalignedLoad(rep, PointerConstant(address), Int32Constant(offset));
814 Node* UnalignedStoreToPointer(
void* address, MachineRepresentation rep,
816 return UnalignedStore(rep, PointerConstant(address), node);
818 Node* StringConstant(
const char*
string) {
819 return HeapConstant(isolate()->factory()->InternalizeUtf8String(
string));
822 Node* TaggedPoisonOnSpeculation(
Node* value) {
823 if (poisoning_level_ != PoisoningMitigationLevel::kDontPoison) {
824 return AddNode(machine()->TaggedPoisonOnSpeculation(), value);
829 Node* WordPoisonOnSpeculation(
Node* value) {
830 if (poisoning_level_ != PoisoningMitigationLevel::kDontPoison) {
831 return AddNode(machine()->WordPoisonOnSpeculation(), value);
839 Node*
const* inputs);
844 Node*
const* inputs);
849 Node*
const* inputs);
858 Node* CallCFunction1WithCallerSavedRegisters(
860 Node* arg0, SaveFPRegsMode mode = kSaveFPRegs);
871 Node* CallCFunction3WithCallerSavedRegisters(
874 SaveFPRegsMode mode = kSaveFPRegs);
922 void Return(
Node* value);
926 void Return(
int count,
Node* v[]);
927 void PopAndReturn(
Node* pop,
Node* value);
932 void Deoptimize(
Node* state);
933 void DebugAbort(
Node* message);
936 void Comment(
const char* msg);
941 void PrintCurrentBlock(std::ostream& os);
951 Node* Phi(MachineRepresentation rep,
Node* n1,
Node* n2) {
952 return AddNode(common()->Phi(rep, 2), n1, n2, graph()->start());
955 return AddNode(common()->Phi(rep, 3), n1, n2, n3, graph()->start());
958 return AddNode(common()->Phi(rep, 4), n1, n2, n3, n4, graph()->start());
960 Node* Phi(MachineRepresentation rep,
int input_count,
Node*
const* inputs);
961 void AppendPhiInput(
Node* phi,
Node* new_input);
971 return AddNode(op, 0, static_cast<Node* const*>(
nullptr));
974 template <
class... TArgs>
976 Node* buffer[] = {n1, args...};
977 return AddNode(op,
sizeof...(args) + 1, buffer);
989 void MakeReschedulable();
990 Node* CreateNodeFromPredecessors(
const std::vector<BasicBlock*>& predecessors,
991 const std::vector<Node*>& sidetable,
993 const std::vector<Node*>& additional_inputs);
994 void MakePhiBinary(
Node* phi,
int split_point,
Node* left_control,
995 Node* right_control);
996 void MarkControlDeferred(
Node* control_input);
998 Schedule* schedule() {
return schedule_; }
999 size_t parameter_count()
const {
return call_descriptor_->ParameterCount(); }
1007 Node* target_parameter_;
1010 PoisoningMitigationLevel poisoning_level_;
1017 enum Type { kDeferred, kNonDeferred };
1020 : deferred_(
type == kDeferred) {}
1028 bool bound_ =
false;
1038 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_