Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1125)

Unified Diff: src/wasm/wasm-js.cc

Issue 2724053002: [wasm] Better error message for exceeding module size limits. (Closed)
Patch Set: [wasm] Better error message for exceeding module size limits. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index f16d8b298540297665e190f734e527742a2c3079..56def4e76d2ab66150838ac600b99c8654b8d27d 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -32,10 +32,6 @@ namespace v8 {
namespace {
-#define RANGE_ERROR_MSG \
- "Wasm compilation exceeds internal limits in this context for the provided " \
- "arguments"
-
// TODO(wasm): move brand check to the respective types, and don't throw
// in it, rather, use a provided ErrorThrower, or let caller handle it.
static bool HasBrand(i::Handle<i::Object> value, i::Handle<i::Symbol> sym) {
@@ -88,7 +84,10 @@ bool IsCompilationAllowed(i::Isolate* isolate, ErrorThrower* thrower,
AllowWasmCompileCallback callback = isolate->allow_wasm_compile_callback();
if (callback != nullptr &&
!callback(reinterpret_cast<v8::Isolate*>(isolate), source, is_async)) {
- thrower->RangeError(RANGE_ERROR_MSG);
+ thrower->RangeError(
+ "%ssynchronous compilation disallowed due to module size limit set by "
+ "embedder",
+ is_async ? "a" : "");
return false;
}
return true;
@@ -110,7 +109,10 @@ bool IsInstantiationAllowed(i::Isolate* isolate, ErrorThrower* thrower,
if (callback != nullptr &&
!callback(reinterpret_cast<v8::Isolate*>(isolate), module_or_bytes,
v8_ffi, is_async)) {
- thrower->RangeError(RANGE_ERROR_MSG);
+ thrower->RangeError(
+ "%ssynchronous instantiation disallowed due to module size limit set "
+ "by embedder",
+ is_async ? "a" : "");
return false;
}
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698