Lines Matching defs:thrower
182 ErrorThrower* thrower) { \
185 thrower->TypeError("Argument 0 must be a WebAssembly." #Type); \
197 const v8::FunctionCallbackInfo<v8::Value>& args, ErrorThrower* thrower,
222 thrower->TypeError("Argument 0 must be a buffer source");
226 thrower->CompileError("BufferSource argument is empty");
230 thrower->RangeError("buffer source exceeds maximum size of %zu (is %zu)",
233 if (thrower->error()) return i::wasm::ModuleWireBytes(nullptr, nullptr);
238 const v8::FunctionCallbackInfo<v8::Value>& args, ErrorThrower* thrower) {
241 thrower->TypeError("Argument 0 must be a function");
248 ErrorThrower* thrower) {
252 thrower->TypeError("Argument 1 must be an object");
477 ErrorThrower* thrower, uint32_t* res) {
481 thrower->TypeError("%s must be convertible to a number",
486 thrower->TypeError("%s must be convertible to a valid number",
491 thrower->TypeError("%s must be non-negative",
496 thrower->TypeError("%s must be in the unsigned long range",
513 ScheduledErrorThrower thrower(i_isolate, kAPIMethodName);
516 thrower.CompileError("Wasm code generation disallowed by embedder");
529 auto bytes = GetFirstArgumentAsBytes(args, &thrower, &is_shared);
530 if (thrower.error()) {
531 resolver->OnCompilationFailed(thrower.Reify());
547 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.compile()");
554 GetFirstArgumentAsBytes(args, &thrower, &is_shared);
555 if (thrower.error()) {
556 streaming->Abort(Utils::ToLocal(thrower.Reify()));
561 CHECK(!thrower.error());
579 ScheduledErrorThrower thrower(i_isolate, kAPIMethodName);
593 thrower.CompileError("Wasm code generation disallowed by embedder");
594 resolver->OnCompilationFailed(thrower.Reify());
637 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.validate()");
640 auto bytes = GetFirstArgumentAsBytes(args, &thrower, &is_shared);
644 if (thrower.error()) {
645 if (thrower.wasm_error()) thrower.Reset(); // Clear error.
695 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Module()");
698 thrower.TypeError("WebAssembly.Module must be invoked with 'new'");
702 thrower.CompileError("Wasm code generation disallowed by embedder");
707 auto bytes = GetFirstArgumentAsBytes(args, &thrower, &is_shared);
709 if (thrower.error()) {
721 i_isolate, enabled_features, &thrower, bytes_copy);
725 i_isolate, enabled_features, &thrower, bytes);
752 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Module.imports()");
754 auto maybe_module = GetFirstArgumentAsModule(args, &thrower);
755 if (thrower.error()) return;
765 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Module.exports()");
767 auto maybe_module = GetFirstArgumentAsModule(args, &thrower);
768 if (thrower.error()) return;
779 ScheduledErrorThrower thrower(i_isolate,
782 auto maybe_module = GetFirstArgumentAsModule(args, &thrower);
783 if (thrower.error()) return;
786 thrower.TypeError("Argument 1 is required");
796 i::Handle<i::String>::cast(name), &thrower);
797 if (thrower.error()) return;
813 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Instance()");
815 thrower.TypeError("WebAssembly.Instance must be invoked with 'new'");
820 GetFirstArgumentAsModule(args, &thrower);
821 if (thrower.error()) return;
826 GetValueAsImports(args[1], &thrower);
827 if (thrower.error()) return;
830 i_isolate, &thrower, module_obj, maybe_imports,
868 ScheduledErrorThrower thrower(i_isolate, kAPIMethodName);
883 thrower.CompileError("Wasm code generation disallowed by embedder");
884 resolver->OnInstantiationFailed(thrower.Reify());
891 GetValueAsImports(ffi, &thrower);
893 if (thrower.error()) {
894 resolver->OnInstantiationFailed(thrower.Reify());
950 ScheduledErrorThrower thrower(i_isolate, kAPIMethodName);
967 thrower.TypeError(
969 resolver->OnInstantiationFailed(thrower.Reify());
976 GetValueAsImports(ffi, &thrower);
978 if (thrower.error()) {
979 resolver->OnInstantiationFailed(thrower.Reify());
993 auto bytes = GetFirstArgumentAsBytes(args, &thrower, &is_shared);
994 if (thrower.error()) {
995 resolver->OnInstantiationFailed(thrower.Reify());
1010 thrower.CompileError("Wasm code generation disallowed by embedder");
1011 compilation_resolver->OnCompilationFailed(thrower.Reify());
1022 bool GetIntegerProperty(v8::Isolate* isolate, ErrorThrower* thrower,
1027 if (!EnforceUint32(property_name, value, context, thrower, &number)) {
1031 thrower->RangeError("Property '%s': value %" PRIu32
1037 thrower->RangeError("Property '%s': value %" PRIu32
1047 bool GetOptionalIntegerProperty(v8::Isolate* isolate, ErrorThrower* thrower,
1068 return GetIntegerProperty(isolate, thrower, context, value, property_name,
1076 bool GetInitialOrMinimumProperty(v8::Isolate* isolate, ErrorThrower* thrower,
1081 if (!GetOptionalIntegerProperty(isolate, thrower, context, object,
1091 if (!GetOptionalIntegerProperty(isolate, thrower, context, object,
1097 thrower->TypeError(
1110 thrower->TypeError("Property 'initial' is required");
1134 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table()");
1136 thrower.TypeError("WebAssembly.Table must be invoked with 'new'");
1140 thrower.TypeError("Argument 0 must be a table descriptor");
1167 thrower.TypeError(
1174 if (!GetInitialOrMinimumProperty(isolate, &thrower, context, descriptor,
1182 if (!GetOptionalIntegerProperty(isolate, &thrower, context, descriptor,
1211 thrower.TypeError(
1233 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Memory()");
1235 thrower.TypeError("WebAssembly.Memory must be invoked with 'new'");
1239 thrower.TypeError("Argument 0 must be a memory descriptor");
1246 if (!GetInitialOrMinimumProperty(isolate, &thrower, context, descriptor,
1252 if (!GetOptionalIntegerProperty(isolate, &thrower, context, descriptor,
1276 thrower.TypeError(
1286 thrower.RangeError("could not allocate memory");
1309 thrower.TypeError(
1403 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Global()");
1405 thrower.TypeError("WebAssembly.Global must be invoked with 'new'");
1409 thrower.TypeError("Argument 0 must be a global descriptor");
1439 thrower.TypeError(
1454 thrower.RangeError("could not allocate memory");
1520 thrower.TypeError(
1574 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Tag()");
1576 thrower.TypeError("WebAssembly.Tag must be invoked with 'new'");
1580 thrower.TypeError("Argument 0 must be a tag type");
1595 thrower.TypeError("Argument 0 must be a tag type with 'parameters'");
1601 thrower.TypeError("Argument 0 contains parameters without 'length'");
1605 thrower.TypeError("Argument 0 contains too many parameters");
1617 thrower.TypeError(
1637 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Suspender()");
1639 thrower.TypeError("WebAssembly.Suspender must be invoked with 'new'");
1673 ScheduledErrorThrower* thrower,
1678 thrower->TypeError("Exception values must be an iterable object");
1749 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Exception()");
1751 thrower.TypeError("WebAssembly.Exception must be invoked with 'new'");
1755 thrower.TypeError("Argument 0 must be a WebAssembly tag");
1760 thrower.TypeError("Argument 0 must be a WebAssembly tag");
1776 EncodeExceptionValues(isolate, signature, args[1], &thrower, values);
1777 if (thrower.error()) return;
1787 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Function()");
1789 thrower.TypeError("WebAssembly.Function must be invoked with 'new'");
1793 thrower.TypeError("Argument 0 must be a function type");
1807 thrower.TypeError("Argument 0 must be a function type with 'parameters'");
1813 thrower.TypeError("Argument 0 contains parameters without 'length'");
1817 thrower.TypeError("Argument 0 contains too many parameters");
1828 thrower.TypeError("Argument 0 must be a function type with 'results'");
1834 thrower.TypeError("Argument 0 contains results without 'length'");
1838 thrower.TypeError("Argument 0 contains too many results");
1850 thrower.TypeError(
1861 thrower.TypeError(
1869 thrower.TypeError("Argument 1 must be a function");
1882 thrower.TypeError(
1894 thrower.TypeError(
1910 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Function.type()");
1936 thrower.TypeError("Argument 0 must be a WebAssembly.Function");
1957 thrower.TypeError("Receiver is not a %s", kName_##WasmType); \
1968 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Instance.exports()");
1979 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.length()");
1990 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.grow()");
1995 if (!EnforceUint32("Argument 0", args[0], context, &thrower, &grow_by)) {
2004 thrower.TypeError("Argument 1 must be a valid type for the table");
2023 thrower.RangeError("failed to grow table by %u", grow_by);
2035 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.get()");
2040 if (!EnforceUint32("Argument 0", args[0], context, &thrower, &index)) {
2044 thrower.RangeError("invalid index %u into function table", index);
2065 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.set()");
2071 if (!EnforceUint32("Argument 0", args[0], context, &thrower, &index)) {
2075 thrower.RangeError("invalid index %u into function table", index);
2085 thrower.TypeError("Argument 1 is invalid for table of type %s",
2103 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Table.type()");
2122 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Memory.grow()");
2127 if (!EnforceUint32("Argument 0", args[0], context, &thrower, &delta_pages)) {
2137 thrower.RangeError("Maximum memory size exceeded");
2143 thrower.RangeError("Unable to grow instance memory");
2156 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Memory.buffer");
2170 thrower.TypeError(
2183 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Memory.type()");
2206 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Tag.type()");
2209 if (thrower.error()) return;
2227 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Exception.getArg()");
2230 if (thrower.error()) return;
2233 GetFirstArgumentAsTag(args, &thrower);
2234 if (thrower.error()) return;
2238 if (!EnforceUint32("Index", args[1], context, &thrower, &index)) {
2247 thrower.TypeError("Expected a WebAssembly.Exception object");
2252 thrower.TypeError("First argument does not match the exception tag");
2260 thrower.RangeError("Index out of range");
2369 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Exception.is()");
2372 if (thrower.error()) return;
2376 thrower.TypeError("Expected a WebAssembly.Exception object");
2381 auto maybe_tag = GetFirstArgumentAsTag(args, &thrower);
2382 if (thrower.error()) {
2394 ScheduledErrorThrower thrower(i_isolate, name);
2415 thrower.TypeError("Can't get the value of s128 WebAssembly.Global");
2472 ScheduledErrorThrower thrower(i_isolate, "set WebAssembly.Global.value");
2476 thrower.TypeError("Can't set the value of an immutable global.");
2480 thrower.TypeError("Argument 0 is required");
2510 thrower.TypeError("Can't set the value of s128 WebAssembly.Global");
2520 thrower.TypeError(
2553 ScheduledErrorThrower thrower(i_isolate, "WebAssembly.Global.type()");
2568 ScheduledErrorThrower thrower(
2571 thrower.TypeError("Argument 0 is required");
2574 auto maybe_function = GetFirstArgumentAsJSFunction(args, &thrower);
2575 if (thrower.error()) return;
2579 thrower.TypeError("Argument 0 must be a wasm function");
2583 thrower.TypeError(
2609 ScheduledErrorThrower thrower(
2612 thrower.TypeError("Argument 0 must be a WebAssembly.Function");
2623 thrower.TypeError("Argument 0 must be a WebAssembly.Function");
2628 thrower.TypeError("Expected a WebAssembly.Function with return type %s",