[wasm] Refactor and fix ErrorThrower

The error thrower did allocate the exception at the moment the error was
detected. For async compilation, this meant in another step than when
it was actually thrown. Since the HandleScope of the exception already
died at that point, this would have lead to memory errors.

With this refactoring, we only store the information needed to generate
the exception in the ErrorThrower, and only generate the exception
object once it is actually needed.

With regression test.

R=ahaas@chromium.org, mtrofin@chromium.org
Also-by: ahaas@chromium.org

Change-Id: Iffcab1f8d1cf5925e3643fcf0729ba9a84c7d277
Reviewed-on: https://chromium-review.googlesource.com/490085
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Mircea Trofin <mtrofin@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45000}
4 files changed
tree: 63c26fc1dcd8a7e1a2a1a9f174f7f2216e8fe7b3
  1. .clang-format
  2. .gitignore
  3. .gn
  4. .ycm_extra_conf.py
  5. AUTHORS
  6. BUILD.gn
  7. CODE_OF_CONDUCT.md
  8. ChangeLog
  9. DEPS
  10. LICENSE
  11. LICENSE.fdlibm
  12. LICENSE.strongtalk
  13. LICENSE.v8
  14. LICENSE.valgrind
  15. Makefile
  16. Makefile.android
  17. OWNERS
  18. PRESUBMIT.py
  19. README.md
  20. WATCHLISTS
  21. benchmarks/
  22. build_overrides/
  23. codereview.settings
  24. docs/
  25. gni/
  26. gypfiles/
  27. include/
  28. infra/
  29. samples/
  30. snapshot_toolchain.gni
  31. src/
  32. test/
  33. testing/
  34. third_party/
  35. tools/
README.md

V8 JavaScript Engine

V8 is Google's open source JavaScript engine.

V8 implements ECMAScript as specified in ECMA-262.

V8 is written in C++ and is used in Google Chrome, the open source browser from Google.

V8 can run standalone, or can be embedded into any C++ application.

V8 Project page: https://github.com/v8/v8/wiki

Getting the Code

Checkout depot tools, and run

    fetch v8

This will checkout V8 into the directory v8 and fetch all of its dependencies. To stay up to date, run

    git pull origin
    gclient sync

For fetching all branches, add the following into your remote configuration in .git/config:

    fetch = +refs/branch-heads/*:refs/remotes/branch-heads/*
    fetch = +refs/tags/*:refs/tags/*

Contributing

Please follow the instructions mentioned on the V8 wiki.