Commit b422b173 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[wasm-c-api] Move most things to v8::internal:: API

Peeling away layers of indirection. More to follow.

Change-Id: Ide15b9ece926f51d957de8fdc37829f02d86ca49
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1573700
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61035}
parent 34554ec0
This diff is collapsed.
...@@ -30,7 +30,7 @@ import shutil ...@@ -30,7 +30,7 @@ import shutil
import subprocess import subprocess
import sys import sys
CFLAGS = "-DDEBUG -Wall -Werror -O0 -fsanitize=address" CFLAGS = "-DDEBUG -Wall -Werror -O0 -ggdb -fsanitize=address"
CHECKOUT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) CHECKOUT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
WASM_PATH = os.path.join(CHECKOUT_PATH, "third_party", "wasm-api") WASM_PATH = os.path.join(CHECKOUT_PATH, "third_party", "wasm-api")
...@@ -87,12 +87,12 @@ class Runner(object): ...@@ -87,12 +87,12 @@ class Runner(object):
dst_wasm_file = self.dst_file_basename + ".wasm" dst_wasm_file = self.dst_file_basename + ".wasm"
shutil.copyfile(src_wasm_file, dst_wasm_file) shutil.copyfile(src_wasm_file, dst_wasm_file)
def _Error(self, step, lang, compiler): def _Error(self, step, lang, compiler, code):
print("Error: %s failed. To repro: tools/run-wasm-api-tests.py " print("Error: %s failed. To repro: tools/run-wasm-api-tests.py "
"%s %s %s %s %s" % "%s %s %s %s %s" %
(step, self.outdir, self.tempdir, self.name, lang, (step, self.outdir, self.tempdir, self.name, lang,
compiler["name"].lower())) compiler["name"].lower()))
return code
def CompileAndRun(self, compiler, language): def CompileAndRun(self, compiler, language):
print("==== %s %s/%s ====" % print("==== %s %s/%s ====" %
...@@ -104,15 +104,15 @@ class Runner(object): ...@@ -104,15 +104,15 @@ class Runner(object):
# Compile. # Compile.
c = _Call([compiler[lang], "-c", language["cflags"], CFLAGS, c = _Call([compiler[lang], "-c", language["cflags"], CFLAGS,
"-I", WASM_PATH, "-o", obj_file, src_file]) "-I", WASM_PATH, "-o", obj_file, src_file])
if c: return self._Error("compilation", lang, compiler) if c: return self._Error("compilation", lang, compiler, c)
# Link. # Link.
c = _Call([compiler["cc"], CFLAGS, compiler["ldflags"], obj_file, c = _Call([compiler["cc"], CFLAGS, compiler["ldflags"], obj_file,
"-o", exe_file, self.lib_file, "-ldl -pthread"]) "-o", exe_file, self.lib_file, "-ldl -pthread"])
if c: return self._Error("linking", lang, compiler) if c: return self._Error("linking", lang, compiler, c)
# Execute. # Execute.
exe_file = "./%s-%s" % (self.name, lang) exe_file = "./%s-%s" % (self.name, lang)
c = _Call(["cd", self.tempdir, ";", exe_file]) c = _Call(["cd", self.tempdir, ";", exe_file])
if c: return self._Error("execution", lang, compiler) if c: return self._Error("execution", lang, compiler, c)
return 0 return 0
def Main(args): def Main(args):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment