<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          v8-native-prototypeTurboFan 解碼器

          聯(lián)合創(chuàng)作 · 2023-09-28 14:21

          v8-native-prototype 是用于 TurboFan 的原型本地解碼器。

          示例代碼:

          void TestWasmDecodingSpeed() {
            byte code[] = {kStmtSetLocal, 0, kExprInt32Add, kExprGetLocal, 0,
                           kExprInt8Const, 5};
            Zone zone;
            LR_WasmDecoder decoder(&zone, nullptr);
            FunctionSig::Builder builder(&zone, 1, 1);
            builder.AddReturn(kAstInt32);
            builder.AddParam(kAstInt32);
            FunctionEnv env = {nullptr, builder.Build(), 0, 0, 0, 0};
            // Make COUNT copies of the above code.
            const int TRIALS = 10;
            const int COUNT = (4 * 1024) / sizeof(code);
            const int TOTAL = COUNT * sizeof(code);
            byte* big_code = reinterpret_cast<byte*>(zone.New(TOTAL));
            for (int i = 0; i < COUNT; i++) {
              memcpy(big_code + i * sizeof(code), code, sizeof(code));
            }
            for (int i = 0; i < TRIALS; i++) {
              base::ElapsedTimer timer;
              timer.Start();
              Result result = decoder.Decode(&env, big_code, big_code + TOTAL);
              int64_t us = timer.Elapsed().InMicroseconds();
              OFStream os(stdout);
              double rate = ((TOTAL * 1000000.0) / us) / 1048576;
              os << result << TOTAL << " bytes, us: " << us << " (" << rate << " MB/sec)"
                 << std::endl;
            }
          }
          瀏覽 17
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  亚洲最新中文字幕 | 奇米影视狠狠干 | A片视频免费看 | 樱桃香蕉午夜视频在线观看 | 欧美大屌免费看 |