owned this note changed 7 years ago
Linked with GitHub

Web 可用的組合語言 - WebAssembly 自幹 WebAssembly 虛擬機器 - 徐朝逸

歡迎來到 https://hackmd.io/c/COSCUP2018 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

Slides

WebAssembly

Introduction

https://webassembly.org/

Origin of Wasm

  • JavaScript: 直譯語言,效能上受到挑戰

    • JS +
      • ActivX
      • Flash
      • Java
      • -> 安全性問題
      • (P)NaCL
        • Chrome 專屬
  • Asm.js -> JS + WA

Goals

  • Safe
  • Fast
  • Portable
  • Compact
    • 因爲要透過網路傳輸,需要可以縮減檔案大小

Runtime Structure

WASM Runtime = Module + Store + Stack

Module

  • Type
  • Function
  • Table
  • Memory
  • Global
  • Export

Store

  • Function
  • Table
  • Memory
  • Global

Stack

  • Value
  • Label
  • Frame

Feature

Linear Memory

  • Growable
  • Multiple memory is capable
    • 目前只有一塊但是切成不同的區段
    • 但是Spec是可以有很都多塊的
  • Secure

Stack based

  • No specific register
  • Simple

Stack

  • Value
  • Label
    • if, loop
  • Frame
    • function call
    • 建立基本運算

Structured Control Flow

  • jump 指令: 開新的 scope

Validation

  • Typing rule
  • Mathematical (formal verification)
    • Lambda calculus

WasmVM

Features

  • Standalone
    • browser 需要 javascript 做引入, Exception handling
  • System call - by unreachable
    • 產生 trap (類似 interrupt)
    • from WASM -> System

See Also

tags: COSCUP2018 kernel
Select a repo