Lines Matching full:wasm
5 #include "src/compiler/wasm-compiler.h"
42 #include "src/wasm/function-body-decoder.h"
43 #include "src/wasm/function-compiler.h"
44 #include "src/wasm/jump-table-assembler.h"
45 #include "src/wasm/memory-tracing.h"
46 #include "src/wasm/wasm-code-manager.h"
47 #include "src/wasm/wasm-limits.h"
48 #include "src/wasm/wasm-linkage.h"
49 #include "src/wasm/wasm-module.h"
50 #include "src/wasm/wasm-objects-inl.h"
51 #include "src/wasm/wasm-opcodes.h"
52 #include "src/wasm/wasm-text.h"
67 wasm::WasmOpcodes::OpcodeName(opcode));
102 bool ContainsSimd(wasm::FunctionSig* sig) { in ContainsSimd()
104 if (type == wasm::kWasmS128) return true; in ContainsSimd()
109 bool ContainsInt64(wasm::FunctionSig* sig) { in ContainsInt64()
111 if (type == wasm::kWasmI64) return true; in ContainsInt64()
118 wasm::ModuleEnv* env, Zone* zone, MachineGraph* mcgraph, in WasmGraphBuilder()
119 wasm::FunctionSig* sig, in WasmGraphBuilder()
196 Node* WasmGraphBuilder::Phi(wasm::ValueType type, unsigned count, Node** vals, in Phi()
202 mcgraph()->common()->Phi(wasm::ValueTypes::MachineRepresentationFor(type), in Phi()
241 void WasmGraphBuilder::StackCheck(wasm::WasmCodePosition position, in StackCheck()
280 // A direct call to a wasm runtime stub defined in this module. in StackCheck()
283 wasm::WasmCode::kWasmStackGuard, RelocInfo::WASM_STUB_CALL)); in StackCheck()
320 Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right, in Binop()
321 wasm::WasmCodePosition position) { in Binop()
325 case wasm::kExprI32Add: in Binop()
328 case wasm::kExprI32Sub: in Binop()
331 case wasm::kExprI32Mul: in Binop()
334 case wasm::kExprI32DivS: in Binop()
336 case wasm::kExprI32DivU: in Binop()
338 case wasm::kExprI32RemS: in Binop()
340 case wasm::kExprI32RemU: in Binop()
342 case wasm::kExprI32And: in Binop()
345 case wasm::kExprI32Ior: in Binop()
348 case wasm::kExprI32Xor: in Binop()
351 case wasm::kExprI32Shl: in Binop()
355 case wasm::kExprI32ShrU: in Binop()
359 case wasm::kExprI32ShrS: in Binop()
363 case wasm::kExprI32Ror: in Binop()
367 case wasm::kExprI32Rol: in Binop()
370 case wasm::kExprI32Eq: in Binop()
373 case wasm::kExprI32Ne: in Binop()
374 return Invert(Binop(wasm::kExprI32Eq, left, right)); in Binop()
375 case wasm::kExprI32LtS: in Binop()
378 case wasm::kExprI32LeS: in Binop()
381 case wasm::kExprI32LtU: in Binop()
384 case wasm::kExprI32LeU: in Binop()
387 case wasm::kExprI32GtS: in Binop()
391 case wasm::kExprI32GeS: in Binop()
395 case wasm::kExprI32GtU: in Binop()
399 case wasm::kExprI32GeU: in Binop()
403 case wasm::kExprI64And: in Binop()
406 case wasm::kExprI64Add: in Binop()
409 case wasm::kExprI64Sub: in Binop()
412 case wasm::kExprI64Mul: in Binop()
415 case wasm::kExprI64DivS: in Binop()
417 case wasm::kExprI64DivU: in Binop()
419 case wasm::kExprI64RemS: in Binop()
421 case wasm::kExprI64RemU: in Binop()
423 case wasm::kExprI64Ior: in Binop()
426 case wasm::kExprI64Xor: in Binop()
429 case wasm::kExprI64Shl: in Binop()
433 case wasm::kExprI64ShrU: in Binop()
437 case wasm::kExprI64ShrS: in Binop()
441 case wasm::kExprI64Eq: in Binop()
444 case wasm::kExprI64Ne: in Binop()
445 return Invert(Binop(wasm::kExprI64Eq, left, right)); in Binop()
446 case wasm::kExprI64LtS: in Binop()
449 case wasm::kExprI64LeS: in Binop()
452 case wasm::kExprI64LtU: in Binop()
455 case wasm::kExprI64LeU: in Binop()
458 case wasm::kExprI64GtS: in Binop()
462 case wasm::kExprI64GeS: in Binop()
466 case wasm::kExprI64GtU: in Binop()
470 case wasm::kExprI64GeU: in Binop()
474 case wasm::kExprI64Ror: in Binop()
478 case wasm::kExprI64Rol: in Binop()
480 case wasm::kExprF32CopySign: in Binop()
482 case wasm::kExprF64CopySign: in Binop()
484 case wasm::kExprF32Add: in Binop()
487 case wasm::kExprF32Sub: in Binop()
490 case wasm::kExprF32Mul: in Binop()
493 case wasm::kExprF32Div: in Binop()
496 case wasm::kExprF32Eq: in Binop()
499 case wasm::kExprF32Ne: in Binop()
500 return Invert(Binop(wasm::kExprF32Eq, left, right)); in Binop()
501 case wasm::kExprF32Lt: in Binop()
504 case wasm::kExprF32Ge: in Binop()
508 case wasm::kExprF32Gt: in Binop()
512 case wasm::kExprF32Le: in Binop()
515 case wasm::kExprF64Add: in Binop()
518 case wasm::kExprF64Sub: in Binop()
521 case wasm::kExprF64Mul: in Binop()
524 case wasm::kExprF64Div: in Binop()
527 case wasm::kExprF64Eq: in Binop()
530 case wasm::kExprF64Ne: in Binop()
531 return Invert(Binop(wasm::kExprF64Eq, left, right)); in Binop()
532 case wasm::kExprF64Lt: in Binop()
535 case wasm::kExprF64Le: in Binop()
538 case wasm::kExprF64Gt: in Binop()
542 case wasm::kExprF64Ge: in Binop()
546 case wasm::kExprF32Min: in Binop()
549 case wasm::kExprF64Min: in Binop()
552 case wasm::kExprF32Max: in Binop()
555 case wasm::kExprF64Max: in Binop()
558 case wasm::kExprF64Pow: in Binop()
560 case wasm::kExprF64Atan2: in Binop()
563 case wasm::kExprF64Mod: in Binop()
565 case wasm::kExprI32AsmjsDivS: in Binop()
567 case wasm::kExprI32AsmjsDivU: in Binop()
569 case wasm::kExprI32AsmjsRemS: in Binop()
571 case wasm::kExprI32AsmjsRemU: in Binop()
573 case wasm::kExprI32AsmjsStoreMem8: in Binop()
575 case wasm::kExprI32AsmjsStoreMem16: in Binop()
577 case wasm::kExprI32AsmjsStoreMem: in Binop()
579 case wasm::kExprF32AsmjsStoreMem: in Binop()
581 case wasm::kExprF64AsmjsStoreMem: in Binop()
589 Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input, in Unop()
590 wasm::WasmCodePosition position) { in Unop()
594 case wasm::kExprI32Eqz: in Unop()
597 case wasm::kExprF32Abs: in Unop()
600 case wasm::kExprF32Neg: { in Unop()
604 case wasm::kExprF32Sqrt: in Unop()
607 case wasm::kExprF64Abs: in Unop()
610 case wasm::kExprF64Neg: { in Unop()
614 case wasm::kExprF64Sqrt: in Unop()
617 case wasm::kExprI32SConvertF32: in Unop()
618 case wasm::kExprI32UConvertF32: in Unop()
619 case wasm::kExprI32SConvertF64: in Unop()
620 case wasm::kExprI32UConvertF64: in Unop()
621 case wasm::kExprI32SConvertSatF64: in Unop()
622 case wasm::kExprI32UConvertSatF64: in Unop()
623 case wasm::kExprI32SConvertSatF32: in Unop()
624 case wasm::kExprI32UConvertSatF32: in Unop()
626 case wasm::kExprI32AsmjsSConvertF64: in Unop()
628 case wasm::kExprI32AsmjsUConvertF64: in Unop()
630 case wasm::kExprF32ConvertF64: in Unop()
633 case wasm::kExprF64SConvertI32: in Unop()
636 case wasm::kExprF64UConvertI32: in Unop()
639 case wasm::kExprF32SConvertI32: in Unop()
642 case wasm::kExprF32UConvertI32: in Unop()
645 case wasm::kExprI32AsmjsSConvertF32: in Unop()
647 case wasm::kExprI32AsmjsUConvertF32: in Unop()
649 case wasm::kExprF64ConvertF32: in Unop()
652 case wasm::kExprF32ReinterpretI32: in Unop()
655 case wasm::kExprI32ReinterpretF32: in Unop()
658 case wasm::kExprI32Clz: in Unop()
661 case wasm::kExprI32Ctz: { in Unop()
673 case wasm::kExprI32Popcnt: { in Unop()
681 case wasm::kExprF32Floor: { in Unop()
686 case wasm::kExprF32Ceil: { in Unop()
691 case wasm::kExprF32Trunc: { in Unop()
696 case wasm::kExprF32NearestInt: { in Unop()
702 case wasm::kExprF64Floor: { in Unop()
707 case wasm::kExprF64Ceil: { in Unop()
712 case wasm::kExprF64Trunc: { in Unop()
717 case wasm::kExprF64NearestInt: { in Unop()
723 case wasm::kExprF64Acos: { in Unop()
726 case wasm::kExprF64Asin: { in Unop()
729 case wasm::kExprF64Atan: in Unop()
732 case wasm::kExprF64Cos: { in Unop()
736 case wasm::kExprF64Sin: { in Unop()
740 case wasm::kExprF64Tan: { in Unop()
744 case wasm::kExprF64Exp: { in Unop()
748 case wasm::kExprF64Log: in Unop()
751 case wasm::kExprI32ConvertI64: in Unop()
754 case wasm::kExprI64SConvertI32: in Unop()
757 case wasm::kExprI64UConvertI32: in Unop()
760 case wasm::kExprF64ReinterpretI64: in Unop()
763 case wasm::kExprI64ReinterpretF64: in Unop()
766 case wasm::kExprI64Clz: in Unop()
769 case wasm::kExprI64Ctz: { in Unop()
785 case wasm::kExprI64Popcnt: { in Unop()
796 case wasm::kExprI64Eqz: in Unop()
799 case wasm::kExprF32SConvertI64: in Unop()
805 case wasm::kExprF32UConvertI64: in Unop()
811 case wasm::kExprF64SConvertI64: in Unop()
817 case wasm::kExprF64UConvertI64: in Unop()
823 case wasm::kExprI32SExtendI8: in Unop()
826 case wasm::kExprI32SExtendI16: in Unop()
829 case wasm::kExprI64SExtendI8: in Unop()
832 case wasm::kExprI64SExtendI16: in Unop()
835 case wasm::kExprI64SExtendI32: in Unop()
838 case wasm::kExprI64SConvertF32: in Unop()
839 case wasm::kExprI64UConvertF32: in Unop()
840 case wasm::kExprI64SConvertF64: in Unop()
841 case wasm::kExprI64UConvertF64: in Unop()
842 case wasm::kExprI64SConvertSatF32: in Unop()
843 case wasm::kExprI64UConvertSatF32: in Unop()
844 case wasm::kExprI64SConvertSatF64: in Unop()
845 case wasm::kExprI64UConvertSatF64: in Unop()
849 case wasm::kExprRefIsNull: in Unop()
851 case wasm::kExprI32AsmjsLoadMem8S: in Unop()
853 case wasm::kExprI32AsmjsLoadMem8U: in Unop()
855 case wasm::kExprI32AsmjsLoadMem16S: in Unop()
857 case wasm::kExprI32AsmjsLoadMem16U: in Unop()
859 case wasm::kExprI32AsmjsLoadMem: in Unop()
861 case wasm::kExprF32AsmjsLoadMem: in Unop()
863 case wasm::kExprF64AsmjsLoadMem: in Unop()
910 TrapId WasmGraphBuilder::GetTrapIdForTrap(wasm::TrapReason reason) { in GetTrapIdForTrap()
911 // TODO(wasm): "!env_" should not happen when compiling an actual wasm in GetTrapIdForTrap()
922 case wasm::k##name: \ in GetTrapIdForTrap()
924 static_cast<int>(TrapId::k##name) == wasm::WasmCode::kThrowWasm##name, \ in GetTrapIdForTrap()
934 Node* WasmGraphBuilder::TrapIfTrue(wasm::TrapReason reason, Node* cond, in TrapIfTrue()
935 wasm::WasmCodePosition position) { in TrapIfTrue()
943 Node* WasmGraphBuilder::TrapIfFalse(wasm::TrapReason reason, Node* cond, in TrapIfFalse()
944 wasm::WasmCodePosition position) { in TrapIfFalse()
953 Node* WasmGraphBuilder::TrapIfEq32(wasm::TrapReason reason, Node* node, in TrapIfEq32()
955 wasm::WasmCodePosition position) { in TrapIfEq32()
969 Node* WasmGraphBuilder::ZeroCheck32(wasm::TrapReason reason, Node* node, in ZeroCheck32()
970 wasm::WasmCodePosition position) { in ZeroCheck32()
975 Node* WasmGraphBuilder::TrapIfEq64(wasm::TrapReason reason, Node* node, in TrapIfEq64()
977 wasm::WasmCodePosition position) { in TrapIfEq64()
987 Node* WasmGraphBuilder::ZeroCheck64(wasm::TrapReason reason, Node* node, in ZeroCheck64()
988 wasm::WasmCodePosition position) { in ZeroCheck64()
1030 Node* WasmGraphBuilder::Unreachable(wasm::WasmCodePosition position) { in Unreachable()
1031 TrapIfFalse(wasm::TrapReason::kTrapUnreachable, Int32Constant(0), position); in Unreachable()
1083 Node* node, MachineRepresentation mem_rep, wasm::ValueType wasmtype) { in BuildChangeEndiannessStore()
1087 int valueSizeInBytes = wasm::ValueTypes::ElementSizeInBytes(wasmtype); in BuildChangeEndiannessStore()
1092 case wasm::kWasmF64: in BuildChangeEndiannessStore()
1096 case wasm::kWasmI64: in BuildChangeEndiannessStore()
1099 case wasm::kWasmF32: in BuildChangeEndiannessStore()
1103 case wasm::kWasmI32: in BuildChangeEndiannessStore()
1106 case wasm::kWasmS128: in BuildChangeEndiannessStore()
1118 if (wasmtype == wasm::kWasmI64 && mem_rep < MachineRepresentation::kWord64) { in BuildChangeEndiannessStore()
1122 valueSizeInBytes = wasm::ValueTypes::ElementSizeInBytes(wasm::kWasmI32); in BuildChangeEndiannessStore()
1128 } else if (wasmtype == wasm::kWasmI32 && in BuildChangeEndiannessStore()
1215 case wasm::kWasmF64: in BuildChangeEndiannessStore()
1218 case wasm::kWasmF32: in BuildChangeEndiannessStore()
1232 wasm::ValueType wasmtype) { in BuildChangeEndiannessLoad()
1374 if (wasmtype == wasm::kWasmI64) { in BuildChangeEndiannessLoad()
1382 } else if (wasmtype == wasm::kWasmI32) { in BuildChangeEndiannessLoad()
1397 wasm::kExprF32ReinterpretI32, in BuildF32CopySign()
1398 Binop(wasm::kExprI32Ior, in BuildF32CopySign()
1399 Binop(wasm::kExprI32And, Unop(wasm::kExprI32ReinterpretF32, left), in BuildF32CopySign()
1401 Binop(wasm::kExprI32And, Unop(wasm::kExprI32ReinterpretF32, right), in BuildF32CopySign()
1410 wasm::kExprF64ReinterpretI64, in BuildF64CopySign()
1411 Binop(wasm::kExprI64Ior, in BuildF64CopySign()
1412 Binop(wasm::kExprI64And, Unop(wasm::kExprI64ReinterpretF64, left), in BuildF64CopySign()
1414 Binop(wasm::kExprI64And, Unop(wasm::kExprI64ReinterpretF64, right), in BuildF64CopySign()
1425 Node* new_high_word = Binop(wasm::kExprI32Ior, in BuildF64CopySign()
1426 Binop(wasm::kExprI32And, high_word_left, in BuildF64CopySign()
1428 Binop(wasm::kExprI32And, high_word_right, in BuildF64CopySign()
1437 MachineType IntConvertType(wasm::WasmOpcode opcode) { in IntConvertType()
1439 case wasm::kExprI32SConvertF32: in IntConvertType()
1440 case wasm::kExprI32SConvertF64: in IntConvertType()
1441 case wasm::kExprI32SConvertSatF32: in IntConvertType()
1442 case wasm::kExprI32SConvertSatF64: in IntConvertType()
1444 case wasm::kExprI32UConvertF32: in IntConvertType()
1445 case wasm::kExprI32UConvertF64: in IntConvertType()
1446 case wasm::kExprI32UConvertSatF32: in IntConvertType()
1447 case wasm::kExprI32UConvertSatF64: in IntConvertType()
1449 case wasm::kExprI64SConvertF32: in IntConvertType()
1450 case wasm::kExprI64SConvertF64: in IntConvertType()
1451 case wasm::kExprI64SConvertSatF32: in IntConvertType()
1452 case wasm::kExprI64SConvertSatF64: in IntConvertType()
1454 case wasm::kExprI64UConvertF32: in IntConvertType()
1455 case wasm::kExprI64UConvertF64: in IntConvertType()
1456 case wasm::kExprI64UConvertSatF32: in IntConvertType()
1457 case wasm::kExprI64UConvertSatF64: in IntConvertType()
1464 MachineType FloatConvertType(wasm::WasmOpcode opcode) { in FloatConvertType()
1466 case wasm::kExprI32SConvertF32: in FloatConvertType()
1467 case wasm::kExprI32UConvertF32: in FloatConvertType()
1468 case wasm::kExprI32SConvertSatF32: in FloatConvertType()
1469 case wasm::kExprI64SConvertF32: in FloatConvertType()
1470 case wasm::kExprI64UConvertF32: in FloatConvertType()
1471 case wasm::kExprI32UConvertSatF32: in FloatConvertType()
1472 case wasm::kExprI64SConvertSatF32: in FloatConvertType()
1473 case wasm::kExprI64UConvertSatF32: in FloatConvertType()
1475 case wasm::kExprI32SConvertF64: in FloatConvertType()
1476 case wasm::kExprI32UConvertF64: in FloatConvertType()
1477 case wasm::kExprI64SConvertF64: in FloatConvertType()
1478 case wasm::kExprI64UConvertF64: in FloatConvertType()
1479 case wasm::kExprI32SConvertSatF64: in FloatConvertType()
1480 case wasm::kExprI32UConvertSatF64: in FloatConvertType()
1481 case wasm::kExprI64SConvertSatF64: in FloatConvertType()
1482 case wasm::kExprI64UConvertSatF64: in FloatConvertType()
1489 const Operator* ConvertOp(WasmGraphBuilder* builder, wasm::WasmOpcode opcode) { in ConvertOp()
1491 case wasm::kExprI32SConvertF32: in ConvertOp()
1492 case wasm::kExprI32SConvertSatF32: in ConvertOp()
1494 case wasm::kExprI32UConvertF32: in ConvertOp()
1495 case wasm::kExprI32UConvertSatF32: in ConvertOp()
1497 case wasm::kExprI32SConvertF64: in ConvertOp()
1498 case wasm::kExprI32SConvertSatF64: in ConvertOp()
1500 case wasm::kExprI32UConvertF64: in ConvertOp()
1501 case wasm::kExprI32UConvertSatF64: in ConvertOp()
1503 case wasm::kExprI64SConvertF32: in ConvertOp()
1504 case wasm::kExprI64SConvertSatF32: in ConvertOp()
1506 case wasm::kExprI64UConvertF32: in ConvertOp()
1507 case wasm::kExprI64UConvertSatF32: in ConvertOp()
1509 case wasm::kExprI64SConvertF64: in ConvertOp()
1510 case wasm::kExprI64SConvertSatF64: in ConvertOp()
1512 case wasm::kExprI64UConvertF64: in ConvertOp()
1513 case wasm::kExprI64UConvertSatF64: in ConvertOp()
1520 wasm::WasmOpcode ConvertBackOp(wasm::WasmOpcode opcode) { in ConvertBackOp()
1522 case wasm::kExprI32SConvertF32: in ConvertBackOp()
1523 case wasm::kExprI32SConvertSatF32: in ConvertBackOp()
1524 return wasm::kExprF32SConvertI32; in ConvertBackOp()
1525 case wasm::kExprI32UConvertF32: in ConvertBackOp()
1526 case wasm::kExprI32UConvertSatF32: in ConvertBackOp()
1527 return wasm::kExprF32UConvertI32; in ConvertBackOp()
1528 case wasm::kExprI32SConvertF64: in ConvertBackOp()
1529 case wasm::kExprI32SConvertSatF64: in ConvertBackOp()
1530 return wasm::kExprF64SConvertI32; in ConvertBackOp()
1531 case wasm::kExprI32UConvertF64: in ConvertBackOp()
1532 case wasm::kExprI32UConvertSatF64: in ConvertBackOp()
1533 return wasm::kExprF64UConvertI32; in ConvertBackOp()
1539 bool IsTrappingConvertOp(wasm::WasmOpcode opcode) { in IsTrappingConvertOp()
1541 case wasm::kExprI32SConvertF32: in IsTrappingConvertOp()
1542 case wasm::kExprI32UConvertF32: in IsTrappingConvertOp()
1543 case wasm::kExprI32SConvertF64: in IsTrappingConvertOp()
1544 case wasm::kExprI32UConvertF64: in IsTrappingConvertOp()
1545 case wasm::kExprI64SConvertF32: in IsTrappingConvertOp()
1546 case wasm::kExprI64UConvertF32: in IsTrappingConvertOp()
1547 case wasm::kExprI64SConvertF64: in IsTrappingConvertOp()
1548 case wasm::kExprI64UConvertF64: in IsTrappingConvertOp()
1550 case wasm::kExprI32SConvertSatF64: in IsTrappingConvertOp()
1551 case wasm::kExprI32UConvertSatF64: in IsTrappingConvertOp()
1552 case wasm::kExprI32SConvertSatF32: in IsTrappingConvertOp()
1553 case wasm::kExprI32UConvertSatF32: in IsTrappingConvertOp()
1554 case wasm::kExprI64SConvertSatF32: in IsTrappingConvertOp()
1555 case wasm::kExprI64UConvertSatF32: in IsTrappingConvertOp()
1556 case wasm::kExprI64SConvertSatF64: in IsTrappingConvertOp()
1557 case wasm::kExprI64UConvertSatF64: in IsTrappingConvertOp()
1609 wasm::WasmOpcode TruncOp(const MachineType& ty) { in TruncOp()
1612 return wasm::kExprF32Trunc; in TruncOp()
1614 return wasm::kExprF64Trunc; in TruncOp()
1620 wasm::WasmOpcode NeOp(const MachineType& ty) { in NeOp()
1623 return wasm::kExprF32Ne; in NeOp()
1625 return wasm::kExprF64Ne; in NeOp()
1631 wasm::WasmOpcode LtOp(const MachineType& ty) { in LtOp()
1634 return wasm::kExprF32Lt; in LtOp()
1636 return wasm::kExprF64Lt; in LtOp()
1642 Node* ConvertTrapTest(WasmGraphBuilder* builder, wasm::WasmOpcode opcode, in ConvertTrapTest()
1653 Node* ConvertSaturateTest(WasmGraphBuilder* builder, wasm::WasmOpcode opcode, in ConvertSaturateTest()
1660 test = builder->Binop(wasm::kExprI64Eq, test, builder->Int64Constant(0)); in ConvertSaturateTest()
1668 wasm::WasmCodePosition position, in BuildIntConvertFloat()
1669 wasm::WasmOpcode opcode) { in BuildIntConvertFloat()
1689 TrapIfTrue(wasm::kTrapFloatUnrepresentable, test, position); in BuildIntConvertFloat()
1691 ZeroCheck64(wasm::kTrapFloatUnrepresentable, test, position); in BuildIntConvertFloat()
1763 return Unop(wasm::kExprI64UConvertI32, in BuildI64Ctz()
1775 wasm::kExprI64UConvertI32, in BuildI64Popcnt()
1938 wasm::WasmOpcode opcode) { in convert_ccall_ref()
1940 case wasm::kExprI64SConvertF32: in convert_ccall_ref()
1941 case wasm::kExprI64SConvertSatF32: in convert_ccall_ref()
1943 case wasm::kExprI64UConvertF32: in convert_ccall_ref()
1944 case wasm::kExprI64UConvertSatF32: in convert_ccall_ref()
1946 case wasm::kExprI64SConvertF64: in convert_ccall_ref()
1947 case wasm::kExprI64SConvertSatF64: in convert_ccall_ref()
1949 case wasm::kExprI64UConvertF64: in convert_ccall_ref()
1950 case wasm::kExprI64UConvertSatF64: in convert_ccall_ref()
1960 wasm::WasmCodePosition position, in BuildCcallConvertFloat()
1961 wasm::WasmOpcode opcode) { in BuildCcallConvertFloat()
1979 ZeroCheck32(wasm::kTrapFloatUnrepresentable, overflow, position); in BuildCcallConvertFloat()
1984 Node* test = Binop(wasm::kExprI32Eq, overflow, Int32Constant(0), position); in BuildCcallConvertFloat()
2014 // A direct call to a wasm runtime stub defined in this module. in GrowMemory()
2017 wasm::WasmCode::kWasmGrowMemory, RelocInfo::WASM_STUB_CALL); in GrowMemory()
2024 const wasm::WasmException* exception) const { in GetExceptionEncodedSize()
2025 const wasm::WasmExceptionSig* sig = exception->sig; in GetExceptionEncodedSize()
2029 wasm::ValueTypes::ElementSizeInBytes(sig->GetParam(i))); in GetExceptionEncodedSize()
2038 const wasm::WasmException* exception, in Throw()
2048 const wasm::WasmExceptionSig* sig = exception->sig; in Throw()
2053 case wasm::kWasmF32: in Throw()
2056 case wasm::kWasmI32: in Throw()
2059 case wasm::kWasmF64: in Throw()
2062 case wasm::kWasmI64: { in Throw()
2065 Binop(wasm::kExprI64ShrU, value, Int64Constant(32))); in Throw()
2131 const wasm::WasmException* except_decl) { in GetExceptionValues()
2147 const wasm::WasmExceptionSig* sig = except_decl->sig; in GetExceptionValues()
2150 switch (wasm::ValueType type = sig->GetParam(i)) { in GetExceptionValues()
2151 case wasm::kWasmF32: { in GetExceptionValues()
2152 value = Unop(wasm::kExprF32ReinterpretI32, value); in GetExceptionValues()
2155 case wasm::kWasmI32: in GetExceptionValues()
2157 case wasm::kWasmF64: in GetExceptionValues()
2158 case wasm::kWasmI64: { in GetExceptionValues()
2160 Binop(wasm::kExprI64Shl, Unop(wasm::kExprI64UConvertI32, value), in GetExceptionValues()
2162 Node* lower = Unop(wasm::kExprI64UConvertI32, in GetExceptionValues()
2164 value = Binop(wasm::kExprI64Ior, upper, lower); in GetExceptionValues()
2165 if (type == wasm::kWasmF64) { in GetExceptionValues()
2166 value = Unop(wasm::kExprF64ReinterpretI64, value); in GetExceptionValues()
2180 wasm::WasmCodePosition position) { in BuildI32DivS()
2182 ZeroCheck32(wasm::kTrapDivByZero, right, position); in BuildI32DivS()
2190 TrapIfEq32(wasm::kTrapDivUnrepresentable, left, kMinInt, position); in BuildI32DivS()
2201 wasm::WasmCodePosition position) { in BuildI32RemS()
2204 ZeroCheck32(wasm::kTrapRemByZero, right, position); in BuildI32RemS()
2217 wasm::WasmCodePosition position) { in BuildI32DivU()
2220 ZeroCheck32(wasm::kTrapDivByZero, right, position)); in BuildI32DivU()
2224 wasm::WasmCodePosition position) { in BuildI32RemU()
2227 ZeroCheck32(wasm::kTrapRemByZero, right, position)); in BuildI32RemU()
2404 wasm::WasmCodePosition position) { in BuildI64DivS()
2407 MachineType::Int64(), wasm::kTrapDivByZero, position); in BuildI64DivS()
2409 ZeroCheck64(wasm::kTrapDivByZero, right, position); in BuildI64DivS()
2417 TrapIfEq64(wasm::kTrapDivUnrepresentable, left, in BuildI64DivS()
2430 wasm::WasmCodePosition position) { in BuildI64RemS()
2433 MachineType::Int64(), wasm::kTrapRemByZero, position); in BuildI64RemS()
2435 ZeroCheck64(wasm::kTrapRemByZero, right, position); in BuildI64RemS()
2450 wasm::WasmCodePosition position) { in BuildI64DivU()
2453 MachineType::Int64(), wasm::kTrapDivByZero, position); in BuildI64DivU()
2456 ZeroCheck64(wasm::kTrapDivByZero, right, position)); in BuildI64DivU()
2459 wasm::WasmCodePosition position) { in BuildI64RemU()
2462 MachineType::Int64(), wasm::kTrapRemByZero, position); in BuildI64RemU()
2465 ZeroCheck64(wasm::kTrapRemByZero, right, position)); in BuildI64RemU()
2471 wasm::TrapReason trap_zero, in BuildDiv64Call()
2472 wasm::WasmCodePosition position) { in BuildDiv64Call()
2491 TrapIfEq32(wasm::kTrapDivUnrepresentable, call, -1, position); in BuildDiv64Call()
2511 Node* WasmGraphBuilder::BuildWasmCall(wasm::FunctionSig* sig, Node** args, in BuildWasmCall()
2513 wasm::WasmCodePosition position, in BuildWasmCall()
2540 DCHECK(position == wasm::kNoCodePosition || position > 0); in BuildWasmCall()
2560 Node* WasmGraphBuilder::BuildImportWasmCall(wasm::FunctionSig* sig, Node** args, in BuildImportWasmCall()
2562 wasm::WasmCodePosition position, in BuildImportWasmCall()
2581 Node* WasmGraphBuilder::BuildImportWasmCall(wasm::FunctionSig* sig, Node** args, in BuildImportWasmCall()
2583 wasm::WasmCodePosition position, in BuildImportWasmCall()
2613 wasm::WasmCodePosition position) { in CallDirect()
2615 wasm::FunctionSig* sig = env_->module->functions[index].sig; in CallDirect()
2622 // A direct call to a wasm function defined in this module. in CallDirect()
2632 wasm::WasmCodePosition position) { in CallIndirect()
2637 wasm::FunctionSig* sig = env_->module->signatures[sig_index]; in CallIndirect()
2647 TrapIfFalse(wasm::kTrapFuncInvalid, in_bounds, position); in CallIndirect()
2676 TrapIfFalse(wasm::kTrapFuncSigMismatch, sig_match, position); in CallIndirect()
2707 return Binop(wasm::kExprI32Ror, left, in BuildI32Rol()
2710 return Binop(wasm::kExprI32Ror, left, in BuildI32Rol()
2711 Binop(wasm::kExprI32Sub, mcgraph()->Int32Constant(32), right)); in BuildI32Rol()
2720 return Binop(wasm::kExprI64Ror, left, in BuildI64Rol()
2723 return Binop(wasm::kExprI64Ror, left, in BuildI64Rol()
2724 Binop(wasm::kExprI64Sub, mcgraph()->Int64Constant(64), right)); in BuildI64Rol()
2729 return Unop(wasm::kExprI32Eqz, node); in Invert()
2887 const wasm::WasmGlobal& global, in GetGlobalBaseAndOffset()
2910 // TODO(wasm): we currently generate only one load of the {globals_start} in GetGlobalBaseAndOffset()
2947 DCHECK_EQ(wasm::kWasmOrigin, env_->module->origin); in CurrentMemoryPages()
2953 mcgraph()->Int32Constant(wasm::kWasmPageSizeLog2)); in CurrentMemoryPages()
3006 wasm::ValueTypes::MachineTypeFor(env_->module->globals[index].type); in GetGlobal()
3022 wasm::ValueTypes::MachineTypeFor(env_->module->globals[index].type); in SetGlobal()
3039 wasm::WasmCodePosition position) { in CheckBoundsAndAlignment()
3053 TrapIfFalse(wasm::kTrapUnalignedAccess, in CheckBoundsAndAlignment()
3062 wasm::WasmCodePosition position, in BoundsCheckMem()
3076 TrapIfEq32(wasm::kTrapMemOutOfBounds, Int32Constant(0), 0, position); in BoundsCheckMem()
3097 TrapIfFalse(wasm::kTrapMemOutOfBounds, cond, position); in BoundsCheckMem()
3118 TrapIfFalse(wasm::kTrapMemOutOfBounds, cond, position); in BoundsCheckMem()
3130 wasm::ValueType type) { in GetSafeLoadOperator()
3131 int alignment = offset % (wasm::ValueTypes::ElementSizeInBytes(type)); in GetSafeLoadOperator()
3132 MachineType mach_type = wasm::ValueTypes::MachineTypeFor(type); in GetSafeLoadOperator()
3134 wasm::ValueTypes::MachineRepresentationFor(type))) { in GetSafeLoadOperator()
3141 wasm::ValueType type) { in GetSafeStoreOperator()
3142 int alignment = offset % (wasm::ValueTypes::ElementSizeInBytes(type)); in GetSafeStoreOperator()
3143 MachineRepresentation rep = wasm::ValueTypes::MachineRepresentationFor(type); in GetSafeStoreOperator()
3155 wasm::WasmCodePosition position) { in TraceMemoryOperation()
3158 mcgraph()->machine()->StackSlot(sizeof(wasm::MemoryTracingInfo), kAlign)); in TraceMemoryOperation()
3168 store(offsetof(wasm::MemoryTracingInfo, address), in TraceMemoryOperation()
3170 store(offsetof(wasm::MemoryTracingInfo, is_store), in TraceMemoryOperation()
3173 store(offsetof(wasm::MemoryTracingInfo, mem_rep), in TraceMemoryOperation()
3182 Node* WasmGraphBuilder::LoadMem(wasm::ValueType type, MachineType memtype, in LoadMem()
3185 wasm::WasmCodePosition position) { in LoadMem()
3188 // Wasm semantics throw on OOB. Introduce explicit bounds check and in LoadMem()
3190 index = BoundsCheckMem(wasm::ValueTypes::MemSize(memtype), index, offset, in LoadMem()
3216 if (type == wasm::kWasmI64 && in LoadMem()
3239 wasm::WasmCodePosition position, in StoreMem()
3240 wasm::ValueType type) { in StoreMem()
3390 Zone* zone, wasm::FunctionSig* sig) { in CreateMachineSignature()
3394 builder.AddReturn(wasm::ValueTypes::MachineRepresentationFor(ret)); in CreateMachineSignature()
3398 builder.AddParam(wasm::ValueTypes::MachineRepresentationFor(param)); in CreateMachineSignature()
3418 wasm::WasmCodePosition position) { in SetSourcePosition()
3419 DCHECK_NE(position, wasm::kNoCodePosition); in SetSourcePosition()
3429 Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode, Node* const* inputs) { in SimdOp()
3432 case wasm::kExprF32x4Splat: in SimdOp()
3434 case wasm::kExprF32x4SConvertI32x4: in SimdOp()
3437 case wasm::kExprF32x4UConvertI32x4: in SimdOp()
3440 case wasm::kExprF32x4Abs: in SimdOp()
3442 case wasm::kExprF32x4Neg: in SimdOp()
3444 case wasm::kExprF32x4RecipApprox: in SimdOp()
3447 case wasm::kExprF32x4RecipSqrtApprox: in SimdOp()
3450 case wasm::kExprF32x4Add: in SimdOp()
3453 case wasm::kExprF32x4AddHoriz: in SimdOp()
3456 case wasm::kExprF32x4Sub: in SimdOp()
3459 case wasm::kExprF32x4Mul: in SimdOp()
3462 case wasm::kExprF32x4Min: in SimdOp()
3465 case wasm::kExprF32x4Max: in SimdOp()
3468 case wasm::kExprF32x4Eq: in SimdOp()
3471 case wasm::kExprF32x4Ne: in SimdOp()
3474 case wasm::kExprF32x4Lt: in SimdOp()
3477 case wasm::kExprF32x4Le: in SimdOp()
3480 case wasm::kExprF32x4Gt: in SimdOp()
3483 case wasm::kExprF32x4Ge: in SimdOp()
3486 case wasm::kExprI32x4Splat: in SimdOp()
3488 case wasm::kExprI32x4SConvertF32x4: in SimdOp()
3491 case wasm::kExprI32x4UConvertF32x4: in SimdOp()
3494 case wasm::kExprI32x4SConvertI16x8Low: in SimdOp()
3497 case wasm::kExprI32x4SConvertI16x8High: in SimdOp()
3500 case wasm::kExprI32x4Neg: in SimdOp()
3502 case wasm::kExprI32x4Add: in SimdOp()
3505 case wasm::kExprI32x4AddHoriz: in SimdOp()
3508 case wasm::kExprI32x4Sub: in SimdOp()
3511 case wasm::kExprI32x4Mul: in SimdOp()
3514 case wasm::kExprI32x4MinS: in SimdOp()
3517 case wasm::kExprI32x4MaxS: in SimdOp()
3520 case wasm::kExprI32x4Eq: in SimdOp()
3523 case wasm::kExprI32x4Ne: in SimdOp()
3526 case wasm::kExprI32x4LtS: in SimdOp()
3529 case wasm::kExprI32x4LeS: in SimdOp()
3532 case wasm::kExprI32x4GtS: in SimdOp()
3535 case wasm::kExprI32x4GeS: in SimdOp()
3538 case wasm::kExprI32x4UConvertI16x8Low: in SimdOp()
3541 case wasm::kExprI32x4UConvertI16x8High: in SimdOp()
3544 case wasm::kExprI32x4MinU: in SimdOp()
3547 case wasm::kExprI32x4MaxU: in SimdOp()
3550 case wasm::kExprI32x4LtU: in SimdOp()
3553 case wasm::kExprI32x4LeU: in SimdOp()
3556 case wasm::kExprI32x4GtU: in SimdOp()
3559 case wasm::kExprI32x4GeU: in SimdOp()
3562 case wasm::kExprI16x8Splat: in SimdOp()
3564 case wasm::kExprI16x8SConvertI8x16Low: in SimdOp()
3567 case wasm::kExprI16x8SConvertI8x16High: in SimdOp()
3570 case wasm::kExprI16x8Neg: in SimdOp()
3572 case wasm::kExprI16x8SConvertI32x4: in SimdOp()
3575 case wasm::kExprI16x8Add: in SimdOp()
3578 case wasm::kExprI16x8AddSaturateS: in SimdOp()
3581 case wasm::kExprI16x8AddHoriz: in SimdOp()
3584 case wasm::kExprI16x8Sub: in SimdOp()
3587 case wasm::kExprI16x8SubSaturateS: in SimdOp()
3590 case wasm::kExprI16x8Mul: in SimdOp()
3593 case wasm::kExprI16x8MinS: in SimdOp()
3596 case wasm::kExprI16x8MaxS: in SimdOp()
3599 case wasm::kExprI16x8Eq: in SimdOp()
3602 case wasm::kExprI16x8Ne: in SimdOp()
3605 case wasm::kExprI16x8LtS: in SimdOp()
3608 case wasm::kExprI16x8LeS: in SimdOp()
3611 case wasm::kExprI16x8GtS: in SimdOp()
3614 case wasm::kExprI16x8GeS: in SimdOp()
3617 case wasm::kExprI16x8UConvertI8x16Low: in SimdOp()
3620 case wasm::kExprI16x8UConvertI8x16High: in SimdOp()
3623 case wasm::kExprI16x8UConvertI32x4: in SimdOp()
3626 case wasm::kExprI16x8AddSaturateU: in SimdOp()
3629 case wasm::kExprI16x8SubSaturateU: in SimdOp()
3632 case wasm::kExprI16x8MinU: in SimdOp()
3635 case wasm::kExprI16x8MaxU: in SimdOp()
3638 case wasm::kExprI16x8LtU: in SimdOp()
3641 case wasm::kExprI16x8LeU: in SimdOp()
3644 case wasm::kExprI16x8GtU: in SimdOp()
3647 case wasm::kExprI16x8GeU: in SimdOp()
3650 case wasm::kExprI8x16Splat: in SimdOp()
3652 case wasm::kExprI8x16Neg: in SimdOp()
3654 case wasm::kExprI8x16SConvertI16x8: in SimdOp()
3657 case wasm::kExprI8x16Add: in SimdOp()
3660 case wasm::kExprI8x16AddSaturateS: in SimdOp()
3663 case wasm::kExprI8x16Sub: in SimdOp()
3666 case wasm::kExprI8x16SubSaturateS: in SimdOp()
3669 case wasm::kExprI8x16Mul: in SimdOp()
3672 case wasm::kExprI8x16MinS: in SimdOp()
3675 case wasm::kExprI8x16MaxS: in SimdOp()
3678 case wasm::kExprI8x16Eq: in SimdOp()
3681 case wasm::kExprI8x16Ne: in SimdOp()
3684 case wasm::kExprI8x16LtS: in SimdOp()
3687 case wasm::kExprI8x16LeS: in SimdOp()
3690 case wasm::kExprI8x16GtS: in SimdOp()
3693 case wasm::kExprI8x16GeS: in SimdOp()
3696 case wasm::kExprI8x16UConvertI16x8: in SimdOp()
3699 case wasm::kExprI8x16AddSaturateU: in SimdOp()
3702 case wasm::kExprI8x16SubSaturateU: in SimdOp()
3705 case wasm::kExprI8x16MinU: in SimdOp()
3708 case wasm::kExprI8x16MaxU: in SimdOp()
3711 case wasm::kExprI8x16LtU: in SimdOp()
3714 case wasm::kExprI8x16LeU: in SimdOp()
3717 case wasm::kExprI8x16GtU: in SimdOp()
3720 case wasm::kExprI8x16GeU: in SimdOp()
3723 case wasm::kExprS128And: in SimdOp()
3726 case wasm::kExprS128Or: in SimdOp()
3729 case wasm::kExprS128Xor: in SimdOp()
3732 case wasm::kExprS128Not: in SimdOp()
3734 case wasm::kExprS128Select: in SimdOp()
3737 case wasm::kExprS1x4AnyTrue: in SimdOp()
3739 case wasm::kExprS1x4AllTrue: in SimdOp()
3741 case wasm::kExprS1x8AnyTrue: in SimdOp()
3743 case wasm::kExprS1x8AllTrue: in SimdOp()
3745 case wasm::kExprS1x16AnyTrue: in SimdOp()
3747 case wasm::kExprS1x16AllTrue: in SimdOp()
3754 Node* WasmGraphBuilder::SimdLaneOp(wasm::WasmOpcode opcode, uint8_t lane, in SimdLaneOp()
3758 case wasm::kExprF32x4ExtractLane: in SimdLaneOp()
3761 case wasm::kExprF32x4ReplaceLane: in SimdLaneOp()
3764 case wasm::kExprI32x4ExtractLane: in SimdLaneOp()
3767 case wasm::kExprI32x4ReplaceLane: in SimdLaneOp()
3770 case wasm::kExprI16x8ExtractLane: in SimdLaneOp()
3773 case wasm::kExprI16x8ReplaceLane: in SimdLaneOp()
3776 case wasm::kExprI8x16ExtractLane: in SimdLaneOp()
3779 case wasm::kExprI8x16ReplaceLane: in SimdLaneOp()
3787 Node* WasmGraphBuilder::SimdShiftOp(wasm::WasmOpcode opcode, uint8_t shift, in SimdShiftOp()
3791 case wasm::kExprI32x4Shl: in SimdShiftOp()
3793 case wasm::kExprI32x4ShrS: in SimdShiftOp()
3796 case wasm::kExprI32x4ShrU: in SimdShiftOp()
3799 case wasm::kExprI16x8Shl: in SimdShiftOp()
3801 case wasm::kExprI16x8ShrS: in SimdShiftOp()
3804 case wasm::kExprI16x8ShrU: in SimdShiftOp()
3807 case wasm::kExprI8x16Shl: in SimdShiftOp()
3809 case wasm::kExprI8x16ShrS: in SimdShiftOp()
3812 case wasm::kExprI8x16ShrU: in SimdShiftOp()
3898 Node* WasmGraphBuilder::AtomicOp(wasm::WasmOpcode opcode, Node* const* inputs, in AtomicOp()
3900 wasm::WasmCodePosition position) { in AtomicOp()
3904 case wasm::kExpr##Name: { \ in AtomicOp()
3906 wasm::ValueTypes::MemSize(MachineType::Type()), inputs[0], offset, \ in AtomicOp()
3917 case wasm::kExpr##Name: { \ in AtomicOp()
3919 wasm::ValueTypes::MemSize(MachineType::Type()), inputs[0], offset, \ in AtomicOp()
3931 case wasm::kExpr##Name: { \ in AtomicOp()
3933 wasm::ValueTypes::MemSize(MachineType::Type()), inputs[0], offset, \ in AtomicOp()
3944 case wasm::kExpr##Name: { \ in AtomicOp()
3946 wasm::ValueTypes::MemSize(MachineType::Type()), inputs[0], offset, \ in AtomicOp()
3968 explicit WasmDecorator(NodeOriginTable* origins, wasm::Decoder* decoder) in WasmDecorator()
3973 node, NodeOrigin("wasm graph creation", "n/a", in Decorate()
3979 wasm::Decoder* decoder_;
3983 NodeOriginTable* node_origins, wasm::Decoder* decoder) { in AddBytecodePositionDecorator()
4020 WasmWrapperGraphBuilder(Zone* zone, wasm::ModuleEnv* env, JSGraph* jsgraph, in WasmWrapperGraphBuilder()
4021 wasm::FunctionSig* sig, in WasmWrapperGraphBuilder()
4034 wasm::WasmCode::kWasmAllocateHeapNumber, in BuildAllocateHeapNumberWithValue()
4196 wasm::FunctionSig* sig) { in AddArgumentNodes()
4197 // Convert wasm numbers to JS values. in AddArgumentNodes()
4213 wasm::WasmCode::kWasmToNumber, RelocInfo::WASM_STUB_CALL) in BuildJavaScriptToNumber()
4274 Node* ToJS(Node* node, wasm::ValueType type) { in ToJS()
4276 case wasm::kWasmI32: in ToJS()
4278 case wasm::kWasmS128: in ToJS()
4279 case wasm::kWasmI64: in ToJS()
4281 case wasm::kWasmF32: in ToJS()
4285 case wasm::kWasmF64: in ToJS()
4287 case wasm::kWasmAnyRef: in ToJS()
4294 Node* FromJS(Node* node, Node* js_context, wasm::ValueType type) { in FromJS()
4295 DCHECK_NE(wasm::kWasmStmt, type); in FromJS()
4298 if (type == wasm::kWasmAnyRef) { in FromJS()
4309 case wasm::kWasmI32: { in FromJS()
4314 case wasm::kWasmS128: in FromJS()
4315 case wasm::kWasmI64: in FromJS()
4317 case wasm::kWasmF32: in FromJS()
4321 case wasm::kWasmF64: in FromJS()
4411 if (!wasm::IsJSCompatibleSignature(sig_)) { in BuildJSToWasmWrapper()
4425 // Convert JS parameters to wasm numbers. in BuildJSToWasmWrapper()
4440 BuildImportWasmCall(sig_, args, &rets, wasm::kNoCodePosition, in BuildJSToWasmWrapper()
4443 // Call to a wasm function defined in this module. in BuildJSToWasmWrapper()
4453 BuildWasmCall(sig_, args, &rets, wasm::kNoCodePosition, nullptr, in BuildJSToWasmWrapper()
4474 instance_node_.set(Param(wasm::kWasmInstanceParameterIndex)); in BuildWasmToJSWrapper()
4484 if (!wasm::IsJSCompatibleSignature(sig_)) { in BuildWasmToJSWrapper()
4527 // Convert wasm numbers to JS values. in BuildWasmToJSWrapper()
4541 wasm::WasmCode::kWasmArgumentsAdaptor, RelocInfo::WASM_STUB_CALL); in BuildWasmToJSWrapper()
4562 // Convert wasm numbers to JS values. in BuildWasmToJSWrapper()
4577 wasm::WasmCode::kWasmCallJavaScript, RelocInfo::WASM_STUB_CALL); in BuildWasmToJSWrapper()
4587 // Convert wasm numbers to JS values. in BuildWasmToJSWrapper()
4624 instance_node_.set(Param(wasm::kWasmInstanceParameterIndex)); in BuildWasmInterpreterEntry()
4628 for (wasm::ValueType type : sig_->parameters()) { in BuildWasmInterpreterEntry()
4629 args_size_bytes += wasm::ValueTypes::ElementSizeInBytes(type); in BuildWasmInterpreterEntry()
4633 DCHECK_GE(wasm::kV8MaxWasmFunctionReturns, sig_->return_count()); in BuildWasmInterpreterEntry()
4634 // TODO(wasm): Handle multi-value returns. in BuildWasmInterpreterEntry()
4635 DCHECK_EQ(1, wasm::kV8MaxWasmFunctionReturns); in BuildWasmInterpreterEntry()
4639 : wasm::ValueTypes::ElementSizeInBytes(sig_->GetReturn()); in BuildWasmInterpreterEntry()
4652 wasm::ValueType type = sig_->GetParam(i); in BuildWasmInterpreterEntry()
4657 offset += wasm::ValueTypes::ElementSizeInBytes(type); in BuildWasmInterpreterEntry()
4674 // TODO(wasm): Implement multi-return. in BuildWasmInterpreterEntry()
4677 wasm::ValueTypes::MachineTypeFor(sig_->GetReturn()); in BuildWasmInterpreterEntry()
4710 for (wasm::ValueType type : sig_->parameters()) { in BuildCWasmEntry()
4715 offset += wasm::ValueTypes::ElementSizeInBytes(type); in BuildCWasmEntry()
4722 // Call the wasm code. in BuildCWasmEntry()
4732 wasm::ValueTypes::MachineRepresentationFor(sig_->GetReturn()), in BuildCWasmEntry()
4765 Isolate* isolate, const wasm::NativeModule* native_module, in CompileJSToWasmWrapper()
4766 wasm::FunctionSig* sig, bool is_import, in CompileJSToWasmWrapper()
4767 wasm::UseTrapHandler use_trap_handler) { in CompileJSToWasmWrapper()
4768 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"), in CompileJSToWasmWrapper()
4770 const wasm::WasmModule* module = native_module->module(); in CompileJSToWasmWrapper()
4787 wasm::ModuleEnv env(module, use_trap_handler, wasm::kRuntimeExceptionSupport); in CompileJSToWasmWrapper()
4800 func_name.Truncate(SNPrintF(func_name, "js-to-wasm#%d", id++)); in CompileJSToWasmWrapper()
4802 Vector<const char> func_name = CStrVector("js-to-wasm"); in CompileJSToWasmWrapper()
4840 Isolate* isolate, Handle<JSReceiver> target, wasm::FunctionSig* sig, in CompileWasmToJSWrapper()
4841 uint32_t index, wasm::ModuleOrigin origin, in CompileWasmToJSWrapper()
4842 wasm::UseTrapHandler use_trap_handler) { in CompileWasmToJSWrapper()
4843 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"), in CompileWasmToJSWrapper()
4861 origin == wasm::kAsmJsOrigin ? new (&zone) SourcePositionTable(&graph) in CompileWasmToJSWrapper()
4864 wasm::ModuleEnv env(nullptr, use_trap_handler, in CompileWasmToJSWrapper()
4865 wasm::kRuntimeExceptionSupport); in CompileWasmToJSWrapper()
4877 func_name.Truncate(SNPrintF(func_name, "wasm-to-js#%d", id++)); in CompileWasmToJSWrapper()
4879 Vector<const char> func_name = CStrVector("wasm-to-js"); in CompileWasmToJSWrapper()
4919 wasm::FunctionSig* sig) { in CompileWasmInterpreterEntry()
4949 SNPrintF(func_name, "wasm-interpreter-entry#%d", func_index)); in CompileWasmInterpreterEntry()
4951 Vector<const char> func_name = CStrVector("wasm-interpreter-entry"); in CompileWasmInterpreterEntry()
4957 StdoutStream{} << "-- Wasm interpreter entry graph -- " << std::endl in CompileWasmInterpreterEntry()
4984 MaybeHandle<Code> CompileCWasmEntry(Isolate* isolate, wasm::FunctionSig* sig) { in CompileCWasmEntry()
5008 // Build a name in the form "c-wasm-entry:<params>:<returns>". in CompileCWasmEntry()
5010 char debug_name[kMaxNameLen] = "c-wasm-entry:"; in CompileCWasmEntry()
5015 for (wasm::ValueType t : sig->parameters()) { in CompileCWasmEntry()
5016 append_name_char(wasm::ValueTypes::ShortNameOf(t)); in CompileCWasmEntry()
5019 for (wasm::ValueType t : sig->returns()) { in CompileCWasmEntry()
5020 append_name_char(wasm::ValueTypes::ShortNameOf(t)); in CompileCWasmEntry()
5028 StdoutStream{} << "-- C Wasm entry graph -- " << std::endl << AsRPO(graph); in CompileCWasmEntry()
5049 wasm::WasmCompilationUnit* wasm_unit) in TurbofanWasmCompilationUnit()
5056 wasm::WasmFeatures* detected, double* decode_ms, MachineGraph* mcgraph, in BuildGraphForWasmFunction()
5068 graph_construction_result_ = wasm::BuildTFGraph( in BuildGraphForWasmFunction()
5094 wasm::kPrintLocals); in BuildGraphForWasmFunction()
5103 Vector<const char> GetDebugName(Zone* zone, wasm::WasmName name, int index) { in GetDebugName()
5111 int name_len = SNPrintF(name_vector, "wasm#%d", index); in GetDebugName()
5125 wasm::WasmFeatures* detected) { in ExecuteCompilation()
5126 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"), in ExecuteCompilation()
5186 const_cast<wasm::WasmModule*>(wasm_unit_->env_->module), in ExecuteCompilation()
5197 "wasm-compilation phase 1 ok: %u bytes, %0.3f ms decode, %zu nodes, " in ExecuteCompilation()
5208 wasm::WasmCode* TurbofanWasmCompilationUnit::FinishCompilation( in FinishCompilation()
5209 wasm::ErrorThrower* thrower) { in FinishCompilation()
5215 SNPrintF(message, "Compiling wasm function #%d failed", in FinishCompilation()
5218 wasm::TruncatedUserString<> trunc_name(wasm_unit_->func_name_); in FinishCompilation()
5219 SNPrintF(message, "Compiling wasm function #%d:%.*s failed", in FinishCompilation()
5238 : allocator_(wasm::LinkageAllocator(gp, fp)) {} in LinkageLocationAllocator()
5260 wasm::LinkageAllocator allocator_;
5266 Zone* zone, wasm::FunctionSig* fsig, in GetWasmCallDescriptor()
5273 LinkageLocationAllocator params(wasm::kGpParamRegisters, in GetWasmCallDescriptor()
5274 wasm::kFpParamRegisters); in GetWasmCallDescriptor()
5282 wasm::ValueTypes::MachineRepresentationFor(fsig->GetParam(i)); in GetWasmCallDescriptor()
5288 LinkageLocationAllocator rets(wasm::kGpReturnRegisters, in GetWasmCallDescriptor()
5289 wasm::kFpReturnRegisters); in GetWasmCallDescriptor()
5299 wasm::ValueTypes::MachineRepresentationFor(fsig->GetReturn(i)); in GetWasmCallDescriptor()
5307 // The target for wasm calls is always a code object. in GetWasmCallDescriptor()
5325 "wasm-call", // debug name in GetWasmCallDescriptor()
5353 LinkageLocationAllocator params(wasm::kGpParamRegisters, in ReplaceTypeInCallDescriptorWith()
5354 wasm::kFpParamRegisters); in ReplaceTypeInCallDescriptorWith()
5366 LinkageLocationAllocator rets(wasm::kGpReturnRegisters, in ReplaceTypeInCallDescriptorWith()
5367 wasm::kFpReturnRegisters); in ReplaceTypeInCallDescriptorWith()