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

Side by Side Diff: src/WasmTranslator.cpp

Issue 1890283002: Subzero, Wasm: Link and run torture tests; bug fixes. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review feedback Created 4 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/IceCfgNode.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/WasmTranslator.cpp - WASM to Subzero Translation -------===// 1 //===- subzero/src/WasmTranslator.cpp - WASM to Subzero Translation -------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 using namespace Ice; 51 using namespace Ice;
52 using namespace v8; 52 using namespace v8;
53 using namespace v8::internal; 53 using namespace v8::internal;
54 using namespace v8::internal::wasm; 54 using namespace v8::internal::wasm;
55 using v8::internal::wasm::DecodeWasmModule; 55 using v8::internal::wasm::DecodeWasmModule;
56 56
57 #undef LOG 57 #undef LOG
58 #define LOG(Expr) log([&](Ostream & out) { Expr; }) 58 #define LOG(Expr) log([&](Ostream & out) { Expr; })
59 59
60 namespace { 60 namespace {
61 // 64KB
62 const uint32_t WASM_PAGE_SIZE = 64 << 10;
61 63
62 std::string toStdString(WasmName Name) { 64 std::string toStdString(WasmName Name) {
63 return std::string(Name.name, Name.length); 65 return std::string(Name.name, Name.length);
64 } 66 }
65 67
66 Ice::Type toIceType(wasm::LocalType Type) { 68 Ice::Type toIceType(wasm::LocalType Type) {
67 switch (Type) { 69 switch (Type) {
68 case MachineRepresentation::kNone: 70 case MachineRepresentation::kNone:
69 llvm::report_fatal_error("kNone type not supported"); 71 llvm::report_fatal_error("kNone type not supported");
70 case MachineRepresentation::kBit: 72 case MachineRepresentation::kBit:
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 case kExprI64And: 461 case kExprI64And:
460 Control()->appendInst( 462 Control()->appendInst(
461 InstArithmetic::create(Func, InstArithmetic::And, Dest, Left, Right)); 463 InstArithmetic::create(Func, InstArithmetic::And, Dest, Left, Right));
462 break; 464 break;
463 case kExprI32Ne: 465 case kExprI32Ne:
464 case kExprI64Ne: { 466 case kExprI64Ne: {
465 auto *TmpDest = makeVariable(IceType_i1); 467 auto *TmpDest = makeVariable(IceType_i1);
466 Control()->appendInst( 468 Control()->appendInst(
467 InstIcmp::create(Func, InstIcmp::Ne, TmpDest, Left, Right)); 469 InstIcmp::create(Func, InstIcmp::Ne, TmpDest, Left, Right));
468 Control()->appendInst( 470 Control()->appendInst(
469 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 471 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
470 break; 472 break;
471 } 473 }
472 case kExprI32Eq: 474 case kExprI32Eq:
473 case kExprI64Eq: { 475 case kExprI64Eq: {
474 auto *TmpDest = makeVariable(IceType_i1); 476 auto *TmpDest = makeVariable(IceType_i1);
475 Control()->appendInst( 477 Control()->appendInst(
476 InstIcmp::create(Func, InstIcmp::Eq, TmpDest, Left, Right)); 478 InstIcmp::create(Func, InstIcmp::Eq, TmpDest, Left, Right));
477 Control()->appendInst( 479 Control()->appendInst(
478 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 480 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
479 break; 481 break;
480 } 482 }
481 case kExprI32LtS: 483 case kExprI32LtS:
482 case kExprI64LtS: { 484 case kExprI64LtS: {
483 auto *TmpDest = makeVariable(IceType_i1); 485 auto *TmpDest = makeVariable(IceType_i1);
484 Control()->appendInst( 486 Control()->appendInst(
485 InstIcmp::create(Func, InstIcmp::Slt, TmpDest, Left, Right)); 487 InstIcmp::create(Func, InstIcmp::Slt, TmpDest, Left, Right));
486 Control()->appendInst( 488 Control()->appendInst(
487 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 489 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
488 break; 490 break;
489 } 491 }
490 case kExprI32LeS: 492 case kExprI32LeS:
491 case kExprI64LeS: { 493 case kExprI64LeS: {
492 auto *TmpDest = makeVariable(IceType_i1); 494 auto *TmpDest = makeVariable(IceType_i1);
493 Control()->appendInst( 495 Control()->appendInst(
494 InstIcmp::create(Func, InstIcmp::Sle, TmpDest, Left, Right)); 496 InstIcmp::create(Func, InstIcmp::Sle, TmpDest, Left, Right));
495 Control()->appendInst( 497 Control()->appendInst(
496 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 498 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
497 break; 499 break;
498 } 500 }
499 case kExprI32GeU: 501 case kExprI32GeU:
500 case kExprI64GeU: { 502 case kExprI64GeU: {
501 auto *TmpDest = makeVariable(IceType_i1); 503 auto *TmpDest = makeVariable(IceType_i1);
502 Control()->appendInst( 504 Control()->appendInst(
503 InstIcmp::create(Func, InstIcmp::Uge, TmpDest, Left, Right)); 505 InstIcmp::create(Func, InstIcmp::Uge, TmpDest, Left, Right));
504 Control()->appendInst( 506 Control()->appendInst(
505 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 507 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
506 break; 508 break;
507 } 509 }
508 case kExprI32LeU: 510 case kExprI32LeU:
509 case kExprI64LeU: { 511 case kExprI64LeU: {
510 auto *TmpDest = makeVariable(IceType_i1); 512 auto *TmpDest = makeVariable(IceType_i1);
511 Control()->appendInst( 513 Control()->appendInst(
512 InstIcmp::create(Func, InstIcmp::Ule, TmpDest, Left, Right)); 514 InstIcmp::create(Func, InstIcmp::Ule, TmpDest, Left, Right));
513 Control()->appendInst( 515 Control()->appendInst(
514 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 516 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
515 break; 517 break;
516 } 518 }
517 case kExprI32LtU: 519 case kExprI32LtU:
518 case kExprI64LtU: { 520 case kExprI64LtU: {
519 auto *TmpDest = makeVariable(IceType_i1); 521 auto *TmpDest = makeVariable(IceType_i1);
520 Control()->appendInst( 522 Control()->appendInst(
521 InstIcmp::create(Func, InstIcmp::Ult, TmpDest, Left, Right)); 523 InstIcmp::create(Func, InstIcmp::Ult, TmpDest, Left, Right));
522 Control()->appendInst( 524 Control()->appendInst(
523 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 525 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
524 break; 526 break;
525 } 527 }
526 case kExprI32GeS: 528 case kExprI32GeS:
527 case kExprI64GeS: { 529 case kExprI64GeS: {
528 auto *TmpDest = makeVariable(IceType_i1); 530 auto *TmpDest = makeVariable(IceType_i1);
529 Control()->appendInst( 531 Control()->appendInst(
530 InstIcmp::create(Func, InstIcmp::Sge, TmpDest, Left, Right)); 532 InstIcmp::create(Func, InstIcmp::Sge, TmpDest, Left, Right));
531 Control()->appendInst( 533 Control()->appendInst(
532 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 534 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
533 } 535 }
534 case kExprI32GtS: 536 case kExprI32GtS:
535 case kExprI64GtS: { 537 case kExprI64GtS: {
536 auto *TmpDest = makeVariable(IceType_i1); 538 auto *TmpDest = makeVariable(IceType_i1);
537 Control()->appendInst( 539 Control()->appendInst(
538 InstIcmp::create(Func, InstIcmp::Sgt, TmpDest, Left, Right)); 540 InstIcmp::create(Func, InstIcmp::Sgt, TmpDest, Left, Right));
539 Control()->appendInst( 541 Control()->appendInst(
540 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 542 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
541 break; 543 break;
542 } 544 }
543 case kExprI32GtU: 545 case kExprI32GtU:
544 case kExprI64GtU: { 546 case kExprI64GtU: {
545 auto *TmpDest = makeVariable(IceType_i1); 547 auto *TmpDest = makeVariable(IceType_i1);
546 Control()->appendInst( 548 Control()->appendInst(
547 InstIcmp::create(Func, InstIcmp::Ugt, TmpDest, Left, Right)); 549 InstIcmp::create(Func, InstIcmp::Ugt, TmpDest, Left, Right));
548 Control()->appendInst( 550 Control()->appendInst(
549 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 551 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
550 break; 552 break;
551 } 553 }
552 case kExprF32Ne: 554 case kExprF32Ne:
553 case kExprF64Ne: { 555 case kExprF64Ne: {
554 auto *TmpDest = makeVariable(IceType_i1); 556 auto *TmpDest = makeVariable(IceType_i1);
555 Control()->appendInst( 557 Control()->appendInst(
556 InstFcmp::create(Func, InstFcmp::Une, TmpDest, Left, Right)); 558 InstFcmp::create(Func, InstFcmp::Une, TmpDest, Left, Right));
557 Control()->appendInst( 559 Control()->appendInst(
558 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 560 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
559 break; 561 break;
560 } 562 }
561 case kExprF32Le: 563 case kExprF32Le:
562 case kExprF64Le: { 564 case kExprF64Le: {
563 auto *TmpDest = makeVariable(IceType_i1); 565 auto *TmpDest = makeVariable(IceType_i1);
564 Control()->appendInst( 566 Control()->appendInst(
565 InstFcmp::create(Func, InstFcmp::Ule, TmpDest, Left, Right)); 567 InstFcmp::create(Func, InstFcmp::Ule, TmpDest, Left, Right));
566 Control()->appendInst( 568 Control()->appendInst(
567 InstCast::create(Func, InstCast::Sext, Dest, TmpDest)); 569 InstCast::create(Func, InstCast::Zext, Dest, TmpDest));
568 break; 570 break;
569 } 571 }
570 default: 572 default:
571 LOG(out << "Unknown binop: " << WasmOpcodes::OpcodeName(Opcode) << "\n"); 573 LOG(out << "Unknown binop: " << WasmOpcodes::OpcodeName(Opcode) << "\n");
572 llvm::report_fatal_error("Uncovered or invalid binop."); 574 llvm::report_fatal_error("Uncovered or invalid binop.");
573 return OperandNode(nullptr); 575 return OperandNode(nullptr);
574 } 576 }
575 LOG(out << Dest << "\n"); 577 LOG(out << Dest << "\n");
576 return OperandNode(Dest); 578 return OperandNode(Dest);
577 } 579 }
578 Node Unop(wasm::WasmOpcode Opcode, Node Input) { 580 Node Unop(wasm::WasmOpcode Opcode, Node Input) {
579 LOG(out << "Unop(" << WasmOpcodes::OpcodeName(Opcode) << ", " << Input 581 LOG(out << "Unop(" << WasmOpcodes::OpcodeName(Opcode) << ", " << Input
580 << ") = "); 582 << ") = ");
581 Ice::Variable *Dest = nullptr; 583 Ice::Variable *Dest = nullptr;
582 switch (Opcode) { 584 switch (Opcode) {
583 case kExprI32Eqz: { 585 case kExprI32Eqz: {
584 Dest = makeVariable(IceType_i32); 586 Dest = makeVariable(IceType_i32);
585 auto *Tmp = makeVariable(IceType_i1); 587 auto *Tmp = makeVariable(IceType_i1);
586 Control()->appendInst(InstIcmp::create(Func, InstIcmp::Eq, Tmp, Input, 588 Control()->appendInst(InstIcmp::create(Func, InstIcmp::Eq, Tmp, Input,
587 Ctx->getConstantInt32(0))); 589 Ctx->getConstantInt32(0)));
588 Control()->appendInst(InstCast::create(Func, InstCast::Sext, Dest, Tmp)); 590 Control()->appendInst(InstCast::create(Func, InstCast::Zext, Dest, Tmp));
591 break;
592 }
593 case kExprI64Eqz: {
594 Dest = makeVariable(IceType_i32);
595 auto *Tmp = makeVariable(IceType_i1);
596 Control()->appendInst(InstIcmp::create(Func, InstIcmp::Eq, Tmp, Input,
597 Ctx->getConstantInt64(0)));
598 Control()->appendInst(InstCast::create(Func, InstCast::Zext, Dest, Tmp));
589 break; 599 break;
590 } 600 }
591 case kExprF32Neg: { 601 case kExprF32Neg: {
592 Dest = makeVariable(IceType_f32); 602 Dest = makeVariable(IceType_f32);
593 Control()->appendInst(InstArithmetic::create( 603 Control()->appendInst(InstArithmetic::create(
594 Func, InstArithmetic::Fsub, Dest, Ctx->getConstantFloat(0), Input)); 604 Func, InstArithmetic::Fsub, Dest, Ctx->getConstantFloat(0), Input));
595 break; 605 break;
596 } 606 }
597 case kExprF64Neg: { 607 case kExprF64Neg: {
598 Dest = makeVariable(IceType_f64); 608 Dest = makeVariable(IceType_f64);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // save control here because true_node appears to alias control. 676 // save control here because true_node appears to alias control.
667 auto *Ctrl = Control(); 677 auto *Ctrl = Control();
668 678
669 *TrueNode = OperandNode(Func->makeNode()); 679 *TrueNode = OperandNode(Func->makeNode());
670 *FalseNode = OperandNode(Func->makeNode()); 680 *FalseNode = OperandNode(Func->makeNode());
671 681
672 LOG(out << *TrueNode << ", " << *FalseNode << ")" 682 LOG(out << *TrueNode << ", " << *FalseNode << ")"
673 << "\n"); 683 << "\n");
674 684
675 auto *CondBool = makeVariable(IceType_i1); 685 auto *CondBool = makeVariable(IceType_i1);
676 Ctrl->appendInst(InstCast::create(Func, InstCast::Trunc, CondBool, Cond)); 686 Ctrl->appendInst(InstIcmp::create(Func, InstIcmp::Ne, CondBool, Cond,
687 Ctx->getConstantInt32(0)));
677 688
678 Ctrl->appendInst(InstBr::create(Func, CondBool, *TrueNode, *FalseNode)); 689 Ctrl->appendInst(InstBr::create(Func, CondBool, *TrueNode, *FalseNode));
679 return OperandNode(nullptr); 690 return OperandNode(nullptr);
680 } 691 }
681 InstSwitch *CurrentSwitch = nullptr; 692 InstSwitch *CurrentSwitch = nullptr;
682 CfgNode *SwitchNode = nullptr; 693 CfgNode *SwitchNode = nullptr;
683 SizeT SwitchIndex = 0; 694 SizeT SwitchIndex = 0;
684 Node Switch(uint32_t Count, Node Key) { 695 Node Switch(uint32_t Count, Node Key) {
685 LOG(out << "Switch(" << Count << ", " << Key << ")\n"); 696 LOG(out << "Switch(" << Count << ", " << Key << ")\n");
686 697
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 (void)Index; 902 (void)Index;
892 llvm::report_fatal_error("LoadGlobal"); 903 llvm::report_fatal_error("LoadGlobal");
893 } 904 }
894 Node StoreGlobal(uint32_t Index, Node Val) { 905 Node StoreGlobal(uint32_t Index, Node Val) {
895 (void)Index; 906 (void)Index;
896 (void)Val; 907 (void)Val;
897 llvm::report_fatal_error("StoreGlobal"); 908 llvm::report_fatal_error("StoreGlobal");
898 } 909 }
899 910
900 Operand *sanitizeAddress(Operand *Base, uint32_t Offset) { 911 Operand *sanitizeAddress(Operand *Base, uint32_t Offset) {
912 SizeT MemSize = Module->module->min_mem_pages * WASM_PAGE_SIZE;
913 SizeT MemMask = MemSize - 1;
914
915 bool ConstZeroBase = false;
916
901 // first, add the index and the offset together. 917 // first, add the index and the offset together.
902 if (0 != Offset) { 918 if (auto *ConstBase = llvm::dyn_cast<ConstantInteger32>(Base)) {
903 auto *Addr = makeVariable(IceType_i32); 919 uint32_t RealOffset = Offset + ConstBase->getValue();
920 RealOffset &= MemMask;
921 Base = Ctx->getConstantInt32(RealOffset);
922 ConstZeroBase = (0 == RealOffset);
923 } else if (0 != Offset) {
924 auto *Addr = makeVariable(Ice::getPointerType());
904 auto *OffsetConstant = Ctx->getConstantInt32(Offset); 925 auto *OffsetConstant = Ctx->getConstantInt32(Offset);
905 Control()->appendInst(InstArithmetic::create(Func, InstArithmetic::Add, 926 Control()->appendInst(InstArithmetic::create(Func, InstArithmetic::Add,
906 Addr, Base, OffsetConstant)); 927 Addr, Base, OffsetConstant));
928
907 Base = Addr; 929 Base = Addr;
908 } 930 }
909 931
910 SizeT MemSize = Module->module->min_mem_pages * (16 << 10); 932 if (!llvm::dyn_cast<ConstantInteger32>(Base)) {
911 auto *WrappedAddr = makeVariable(IceType_i32); 933 auto *ClampedAddr = makeVariable(Ice::getPointerType());
912 Control()->appendInst( 934 Control()->appendInst(
913 InstArithmetic::create(Func, InstArithmetic::Add, WrappedAddr, Base, 935 InstArithmetic::create(Func, InstArithmetic::And, ClampedAddr, Base,
914 Ctx->getConstantInt32(MemSize))); 936 Ctx->getConstantInt32(MemSize - 1)));
937 Base = ClampedAddr;
938 }
915 939
916 auto ClampedAddr = makeVariable(IceType_i32); 940 Ice::Operand *RealAddr = nullptr;
917 Control()->appendInst( 941 auto MemBase = Ctx->getConstantSym(0, Ctx->getGlobalString("WASM_MEMORY"));
918 InstArithmetic::create(Func, InstArithmetic::And, ClampedAddr, Base, 942 if (!ConstZeroBase) {
919 Ctx->getConstantInt32(MemSize - 1))); 943 auto RealAddrV = Func->makeVariable(Ice::getPointerType());
944 Control()->appendInst(InstArithmetic::create(
945 Func, InstArithmetic::Add, RealAddrV, Base, MemBase));
920 946
921 auto RealAddr = Func->makeVariable(IceType_i32); 947 RealAddr = RealAddrV;
922 auto MemBase = Ctx->getConstantSym(0, Ctx->getGlobalString("WASM_MEMORY")); 948 } else {
923 Control()->appendInst(InstArithmetic::create( 949 RealAddr = MemBase;
924 Func, InstArithmetic::Add, RealAddr, ClampedAddr, MemBase)); 950 }
925 return RealAddr; 951 return RealAddr;
926 } 952 }
927 953
928 Node LoadMem(wasm::LocalType Type, MachineType MemType, Node Index, 954 Node LoadMem(wasm::LocalType Type, MachineType MemType, Node Index,
929 uint32_t Offset) { 955 uint32_t Offset) {
930 LOG(out << "LoadMem(" << Index << "[" << Offset << "]) = "); 956 LOG(out << "LoadMem(" << Index << "[" << Offset << "]) = ");
931 957
932 auto *RealAddr = sanitizeAddress(Index, Offset); 958 auto *RealAddr = sanitizeAddress(Index, Offset);
933 959
934 auto *LoadResult = makeVariable(toIceType(MemType)); 960 auto *LoadResult = makeVariable(toIceType(MemType));
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 // Add the data 1232 // Add the data
1207 WasmMemory->addInitializer(VariableDeclaration::DataInitializer::create( 1233 WasmMemory->addInitializer(VariableDeclaration::DataInitializer::create(
1208 Globals.get(), reinterpret_cast<const char *>(Module->module_start) + 1234 Globals.get(), reinterpret_cast<const char *>(Module->module_start) +
1209 Seg.source_offset, 1235 Seg.source_offset,
1210 Seg.source_size)); 1236 Seg.source_size));
1211 1237
1212 WritePtr += Seg.source_size; 1238 WritePtr += Seg.source_size;
1213 } 1239 }
1214 1240
1215 // Pad the rest with zeros 1241 // Pad the rest with zeros
1216 SizeT DataSize = Module->min_mem_pages * (64 << 10); 1242 SizeT DataSize = Module->min_mem_pages * WASM_PAGE_SIZE;
1217 if (WritePtr < DataSize) { 1243 if (WritePtr < DataSize) {
1218 WasmMemory->addInitializer(VariableDeclaration::ZeroInitializer::create( 1244 WasmMemory->addInitializer(VariableDeclaration::ZeroInitializer::create(
1219 Globals.get(), DataSize - WritePtr)); 1245 Globals.get(), DataSize - WritePtr));
1220 } 1246 }
1221 1247
1222 WasmMemory->addInitializer(VariableDeclaration::ZeroInitializer::create(
1223 Globals.get(), Module->min_mem_pages * (64 << 10)));
1224
1225 Globals->push_back(WasmMemory); 1248 Globals->push_back(WasmMemory);
1226 1249
1227 lowerGlobals(std::move(Globals)); 1250 lowerGlobals(std::move(Globals));
1228 } 1251 }
1229 1252
1230 // Translate each function. 1253 // Translate each function.
1231 for (const auto Fn : Module->functions) { 1254 for (const auto Fn : Module->functions) {
1232 const auto FnName = getFunctionName(Module, Fn.func_index); 1255 const auto FnName = getFunctionName(Module, Fn.func_index);
1233 1256
1234 LOG(out << " " << Fn.func_index << ": " << FnName << "..."); 1257 LOG(out << " " << Fn.func_index << ": " << FnName << "...");
1235 1258
1236 Body.sig = Fn.sig; 1259 Body.sig = Fn.sig;
1237 Body.base = Buffer.get(); 1260 Body.base = Buffer.get();
1238 Body.start = Buffer.get() + Fn.code_start_offset; 1261 Body.start = Buffer.get() + Fn.code_start_offset;
1239 Body.end = Buffer.get() + Fn.code_end_offset; 1262 Body.end = Buffer.get() + Fn.code_end_offset;
1240 1263
1241 auto Func = translateFunction(&Zone, Body); 1264 auto Func = translateFunction(&Zone, Body);
1242 Func->setFunctionName(Ctx->getGlobalString(FnName)); 1265 Func->setFunctionName(Ctx->getGlobalString(FnName));
1243 1266
1244 Ctx->optQueueBlockingPush(makeUnique<CfgOptWorkItem>(std::move(Func))); 1267 Ctx->optQueueBlockingPush(makeUnique<CfgOptWorkItem>(std::move(Func)));
1245 LOG(out << "done.\n"); 1268 LOG(out << "done.\n");
1246 } 1269 }
1247 1270
1248 return; 1271 return;
1249 } 1272 }
1250 1273
1251 #endif // ALLOW_WASM 1274 #endif // ALLOW_WASM
OLDNEW
« no previous file with comments | « src/IceCfgNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698