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