TurboFan 解码器 v8-native-prototype

码农软件 · 软件分类 · 常用工具包 · 2019-08-17 15:29:17

软件介绍

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;
  }
}

本文地址:https://www.codercto.com/soft/d/12570.html

像程序员一样思考

像程序员一样思考

V. Anton Spraul / 徐波 / 人民邮电出版社 / 2013-6 / 49.00元

编程的真正挑战不是学习一种语言的语法,而是学习创造性地解决问题,从而构建美妙的应用。《像程序员一样思考》分析了程序员解决问题的方法,并且教授你其他图书所忽略的一种能力,即如何像程序员一样思考。全书分为8章。第1章通对几个经典的算法问题切入,概括了问题解决的基本技巧和步骤。第2章通过实际编写C++代码来解决几个简单的问题,从而让读者进一步体会到问题解决的思路和应用。第3到7章是书中的主体部分,分别探......一起来看看 《像程序员一样思考》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试