Lines Matching defs:result
35 #define CHECK_TO_NUMBER(env, context, result, src) \
36 CHECK_TO_TYPE((env), Number, (context), (result), (src), JSVM_NUMBER_EXPECTED)
42 #define CHECK_NEW_FROM_UTF8_LEN(env, result, str, len) \
45 "Casting JSVM_AUTO_LENGTH to int must result in -1"); \
54 (result) = str_maybe.ToLocalChecked(); \
57 #define CHECK_NEW_FROM_UTF8(env, result, str) \
58 CHECK_NEW_FROM_UTF8_LEN((env), (result), (str), JSVM_AUTO_LENGTH)
60 #define CHECK_NEW_STRING_ARGS(env, str, length, result) \
64 CHECK_ARG((env), (result)); \
264 JSVM_Value* result,
266 CHECK_NEW_STRING_ARGS(env, str, length, result);
271 *result = v8impl::JsValueFromV8LocalValue(str_maybe.ToLocalChecked());
281 JSVM_Value* result,
285 CHECK_NEW_STRING_ARGS(env, str, length, result);
288 status = create_api(env, str, length, result);
299 status = NewString(env, str, length, result, string_maker);
387 v8::Local<v8::Name>* result) {
389 CHECK_NEW_FROM_UTF8(env, *result, p->utf8name);
395 *result = property_value.As<v8::Name>();
484 JSVM_Value result,
487 CHECK_ARG(env, result);
499 context, v8impl::V8LocalValueFromJsValue(result))
501 context, v8impl::V8LocalValueFromJsValue(result));
514 void** result,
519 CHECK_ARG(env, result);
534 if (result) {
535 *result = reference->Data();
621 JSVM_Value result = nullptr;
623 env->CallIntoModule([&](JSVM_Env env) { result = cb(env, cbinfo_wrapper); },
632 if (!exceptionOccurred && (result != nullptr)) {
633 this->SetReturnValue(result);
650 v8::Local<v8::Function>* result) {
658 *result = maybe_function.ToLocalChecked();
665 v8::Local<v8::FunctionTemplate>* result,
670 *result = v8::FunctionTemplate::New(env->isolate, Invoke, cbdata, sig);
735 JSVM_Value result = nullptr;
741 result = setterCb(env, name, value, thisArg, innerData);
751 if (!exceptionOccurred && (result != nullptr)) {
752 this->SetReturnValue(result);
767 JSVM_Value result = nullptr;
772 result = getterCb(env, name, thisArg, innerData);
782 if (!exceptionOccurred && (result != nullptr)) {
783 this->SetReturnValue(result);
799 JSVM_Value result = nullptr;
804 result = deleterCb(env, name, thisArg, innerData);
814 if (!exceptionOccurred && (result != nullptr)) {
815 if (v8impl::V8LocalValueFromJsValue(result)->IsBoolean()) {
816 this->SetReturnValue(result);
833 JSVM_Value result = nullptr;
837 result = enumeratorCb(env, thisArg, innerData);
847 if (!exceptionOccurred && (result != nullptr)) {
848 if (v8impl::V8LocalValueFromJsValue(result)->IsArray()) {
849 this->SetReturnValue(result);
866 JSVM_Value result = nullptr;
872 result = indexSetterCb(env, index, value, thisArg, innerData);
882 if (!exceptionOccurred && (result != nullptr)) {
883 this->SetReturnValue(result);
898 JSVM_Value result = nullptr;
904 result = indexGetterCb(env, index, thisArg, innerData);
914 if (!exceptionOccurred && (result != nullptr)) {
915 this->SetReturnValue(result);
931 JSVM_Value result = nullptr;
936 result = indexDeleterCb(env, index, thisArg, innerData);
946 if (!exceptionOccurred && (result != nullptr)) {
947 if (v8impl::V8LocalValueFromJsValue(result)->IsBoolean()) {
948 this->SetReturnValue(result);
965 JSVM_Value result = nullptr;
969 result = enumeratorCb(env, thisArg, innerData);
979 if (!exceptionOccurred && (result != nullptr)) {
980 if (v8impl::V8LocalValueFromJsValue(result)->IsArray()) {
981 this->SetReturnValue(result);
1061 JSVM_Ref* result) {
1078 if (result != nullptr) {
1091 *result = reinterpret_cast<JSVM_Ref>(reference);
1442 JSVM_VM* result) {
1443 *result = reinterpret_cast<JSVM_VM>(env->isolate);
1448 OH_JSVM_CreateVM(const JSVM_CreateVMOptions* options, JSVM_VM* result) {
1482 *result = reinterpret_cast<JSVM_VM>(isolate);
1508 JSVM_Status JSVM_CDECL OH_JSVM_OpenVMScope(JSVM_VM vm, JSVM_VMScope* result) {
1511 *result = reinterpret_cast<JSVM_VMScope>(scope);
1526 JSVM_Env* result) {
1576 *result = env;
1581 OH_JSVM_CreateEnvFromSnapshot(JSVM_VM vm, size_t index, JSVM_Env* result) {
1587 *result = nullptr;
1596 *result = env;
1608 OH_JSVM_OpenEnvScope(JSVM_Env env, JSVM_EnvScope* result) {
1610 *result = reinterpret_cast<JSVM_EnvScope>(v8scope);
1628 JSVM_Script* result) {
1631 CHECK_ARG(env, result);
1657 *result = reinterpret_cast<JSVM_Script>(env->NewJsvmData(compiled_script));
1688 auto result = script->Run(moduleContext).ToLocalChecked();
1689 auto resultFunc = v8::Local<v8::Function>::Cast(result);
1723 JSVM_Script* result) {
1726 CHECK_ARG(env, result);
1765 *result = reinterpret_cast<JSVM_Script>(env->NewJsvmData(compiled_script));
1846 JSVM_Script* result) {
1849 CHECK_ARG(env, result);
1866 *result = reinterpret_cast<JSVM_Script>(*compiled_script);
1898 OH_JSVM_RunScript(JSVM_Env env, JSVM_Script script, JSVM_Value* result) {
1901 CHECK_ARG(env, result);
1907 *result = v8impl::JsValueFromV8LocalValue(script_result.ToLocalChecked());
1913 OH_JSVM_JsonParse(JSVM_Env env, JSVM_Value json_string, JSVM_Value* result) {
1922 *result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked());
1928 OH_JSVM_JsonStringify(JSVM_Env env, JSVM_Value json_object, JSVM_Value* result) {
1936 *result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked());
1976 JSVM_EXTERN JSVM_Status JSVM_CDECL OH_JSVM_GetVMInfo(JSVM_VMInfo* result) {
1977 result->apiVersion = 1;
1978 result->engine = "v8";
1979 result->version = V8_VERSION_STRING;
1980 result->cachedDataVersionTag = v8::ScriptCompiler::CachedDataVersionTag();
1993 OH_JSVM_GetHeapStatistics(JSVM_VM vm, JSVM_HeapStatistics* result) {
1997 result->totalHeapSize = stats.total_heap_size();
1998 result->totalHeapSizeExecutable = stats.total_heap_size_executable();
1999 result->totalPhysicalSize = stats.total_physical_size();
2000 result->totalAvailableSize = stats.total_available_size();
2001 result->usedHeapSize = stats.used_heap_size();
2002 result->heapSizeLimit = stats.heap_size_limit();
2003 result->mallocedMemory = stats.malloced_memory();
2004 result->externalMemory = stats.external_memory();
2005 result->peakMallocedMemory = stats.peak_malloced_memory();
2006 result->numberOfNativeContexts = stats.number_of_native_contexts();
2007 result->numberOfDetachedContexts = stats.number_of_detached_contexts();
2008 result->totalGlobalHandlesSize = stats.total_global_handles_size();
2009 result->usedGlobalHandlesSize = stats.used_global_handles_size();
2014 OH_JSVM_StartCpuProfiler(JSVM_VM vm, JSVM_CpuProfiler* result) {
2020 *result = reinterpret_cast<JSVM_CpuProfiler>(profiler);
2085 JSVM_EXTERN JSVM_Status JSVM_CDECL OH_JSVM_PumpMessageLoop(JSVM_VM vm, bool* result) {
2087 *result = v8::platform::PumpMessageLoop(v8impl::g_platform.get(), isolate);
2126 JSVM_Env env, const JSVM_ExtendedErrorInfo** result) {
2128 CHECK_ARG(env, result);
2132 // We don't have a jsvm_status_last as this would result in an ABI
2146 *result = &(env->last_error);
2154 JSVM_Value* result) {
2156 CHECK_ARG(env, result);
2172 *result = v8impl::JsValueFromV8LocalValue(return_value);
2183 JSVM_Value* result) {
2186 CHECK_ARG(env, result);
2217 *result =
2230 JSVM_Value* result) {
2232 CHECK_ARG(env, result);
2305 *result = v8impl::JsValueFromV8LocalValue(
2320 env, *result, static_descriptors.size(), static_descriptors.data()));
2328 JSVM_Value* result) {
2335 result);
2344 JSVM_Value* result) {
2346 CHECK_ARG(env, result);
2408 *result =
2438 bool* result) {
2440 CHECK_ARG(env, result);
2453 *result = has_maybe.FromMaybe(false);
2460 JSVM_Value* result) {
2463 CHECK_ARG(env, result);
2476 *result = v8impl::JsValueFromV8LocalValue(val);
2483 bool* result) {
2495 if (result != nullptr) *result = delete_maybe.FromMaybe(false);
2503 bool* result) {
2506 CHECK_ARG(env, result);
2516 *result = has_maybe.FromMaybe(false);
2547 bool* result) {
2549 CHECK_ARG(env, result);
2563 *result = has_maybe.FromMaybe(false);
2570 JSVM_Value* result) {
2572 CHECK_ARG(env, result);
2588 *result = v8impl::JsValueFromV8LocalValue(val);
2615 bool* result) {
2617 CHECK_ARG(env, result);
2628 *result = has_maybe.FromMaybe(false);
2635 JSVM_Value* result) {
2637 CHECK_ARG(env, result);
2648 *result = v8impl::JsValueFromV8LocalValue(get_maybe.ToLocalChecked());
2655 bool* result) {
2665 if (result != nullptr) *result = delete_maybe.FromMaybe(false);
2796 bool* result) {
2799 CHECK_ARG(env, result);
2803 *result = val->IsArray();
2809 bool* result) {
2812 CHECK_ARG(env, result);
2816 *result = val->IsRegExp();
2822 uint32_t* result) {
2825 CHECK_ARG(env, result);
2831 *result = arr->Length();
2839 bool* result) {
2843 CHECK_ARG(env, result);
2848 *result = a->StrictEquals(b);
2855 bool* result) {
2859 CHECK_ARG(env, result);
2865 *result = a->Equals(context, b).FromJust();
2871 JSVM_Value* result) {
2873 CHECK_ARG(env, result);
2881 *result = v8impl::JsValueFromV8LocalValue(val);
2885 JSVM_Status JSVM_CDECL OH_JSVM_CreateObject(JSVM_Env env, JSVM_Value* result) {
2887 CHECK_ARG(env, result);
2889 *result = v8impl::JsValueFromV8LocalValue(v8::Object::New(env->isolate));
2894 JSVM_Status JSVM_CDECL OH_JSVM_CreateArray(JSVM_Env env, JSVM_Value* result) {
2896 CHECK_ARG(env, result);
2898 *result = v8impl::JsValueFromV8LocalValue(v8::Array::New(env->isolate));
2905 JSVM_Value* result) {
2907 CHECK_ARG(env, result);
2909 *result =
2918 JSVM_Value* result) {
2919 return v8impl::NewString(env, str, length, result, [&](v8::Isolate* isolate) {
2930 JSVM_Value* result) {
2931 return v8impl::NewString(env, str, length, result, [&](v8::Isolate* isolate) {
2940 JSVM_Value* result) {
2941 return v8impl::NewString(env, str, length, result, [&](v8::Isolate* isolate) {
2951 JSVM_Value* result) {
2953 CHECK_ARG(env, result);
2955 *result =
2963 JSVM_Value* result) {
2965 CHECK_ARG(env, result);
2967 *result =
2975 JSVM_Value* result) {
2977 CHECK_ARG(env, result);
2979 *result = v8impl::JsValueFromV8LocalValue(
2987 JSVM_Value* result) {
2989 CHECK_ARG(env, result);
2991 *result = v8impl::JsValueFromV8LocalValue(
2999 JSVM_Value* result) {
3001 CHECK_ARG(env, result);
3003 *result =
3011 JSVM_Value* result) {
3013 CHECK_ARG(env, result);
3015 *result = v8impl::JsValueFromV8LocalValue(
3025 JSVM_Value* result) {
3028 CHECK_ARG(env, result);
3039 *result = v8impl::JsValueFromV8LocalValue(b.ToLocalChecked());
3045 JSVM_Value* result) {
3047 CHECK_ARG(env, result);
3052 *result = v8impl::JsValueFromV8LocalValue(v8::True(isolate));
3054 *result = v8impl::JsValueFromV8LocalValue(v8::False(isolate));
3062 JSVM_Value* result) {
3064 CHECK_ARG(env, result);
3069 *result = v8impl::JsValueFromV8LocalValue(v8::Symbol::New(isolate));
3074 *result = v8impl::JsValueFromV8LocalValue(
3084 JSVM_Value* result) {
3086 CHECK_ARG(env, result);
3094 *result = v8impl::JsValueFromV8LocalValue(
3129 JSVM_Value* result) {
3132 CHECK_ARG(env, result);
3141 *result = v8impl::JsValueFromV8LocalValue(error_obj);
3149 JSVM_Value* result) {
3152 CHECK_ARG(env, result);
3161 *result = v8impl::JsValueFromV8LocalValue(error_obj);
3169 JSVM_Value* result) {
3172 CHECK_ARG(env, result);
3181 *result = v8impl::JsValueFromV8LocalValue(error_obj);
3189 JSVM_Value* result) {
3192 CHECK_ARG(env, result);
3201 *result = v8impl::JsValueFromV8LocalValue(error_obj);
3208 JSVM_ValueType* result) {
3213 CHECK_ARG(env, result);
3218 *result = JSVM_NUMBER;
3220 *result = JSVM_BIGINT;
3222 *result = JSVM_STRING;
3226 *result = JSVM_FUNCTION;
3230 *result = JSVM_EXTERNAL;
3232 *result = JSVM_OBJECT;
3234 *result = JSVM_BOOLEAN;
3236 *result = JSVM_UNDEFINED;
3238 *result = JSVM_SYMBOL;
3240 *result = JSVM_NULL;
3249 JSVM_Status JSVM_CDECL OH_JSVM_GetUndefined(JSVM_Env env, JSVM_Value* result) {
3251 CHECK_ARG(env, result);
3253 *result = v8impl::JsValueFromV8LocalValue(v8::Undefined(env->isolate));
3258 JSVM_Status JSVM_CDECL OH_JSVM_GetNull(JSVM_Env env, JSVM_Value* result) {
3260 CHECK_ARG(env, result);
3262 *result = v8impl::JsValueFromV8LocalValue(v8::Null(env->isolate));
3301 JSVM_Value* result) {
3304 CHECK_ARG(env, result);
3309 *result = info->GetNewTarget();
3318 JSVM_Value* result) {
3341 if (result != nullptr) {
3343 *result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked());
3349 JSVM_Status JSVM_CDECL OH_JSVM_GetGlobal(JSVM_Env env, JSVM_Value* result) {
3351 CHECK_ARG(env, result);
3353 *result = v8impl::JsValueFromV8LocalValue(env->context()->Global());
3444 bool* result) {
3449 CHECK_ARG(env, result);
3452 *result = val->IsNativeError();
3459 double* result) {
3464 CHECK_ARG(env, result);
3469 *result = val.As<v8::Number>()->Value();
3476 int32_t* result) {
3481 CHECK_ARG(env, result);
3486 *result = val.As<v8::Int32>()->Value();
3492 *result = val->Int32Value(context).FromJust();
3500 uint32_t* result) {
3505 CHECK_ARG(env, result);
3510 *result = val.As<v8::Uint32>()->Value();
3516 *result = val->Uint32Value(context).FromJust();
3524 int64_t* result) {
3529 CHECK_ARG(env, result);
3535 *result = val.As<v8::Int32>()->Value();
3548 *result = val->IntegerValue(context).FromJust();
3550 *result = 0;
3558 int64_t* result,
3562 CHECK_ARG(env, result);
3569 *result = val.As<v8::BigInt>()->Int64Value(lossless);
3576 uint64_t* result,
3580 CHECK_ARG(env, result);
3587 *result = val.As<v8::BigInt>()->Uint64Value(lossless);
3624 bool* result) {
3629 CHECK_ARG(env, result);
3634 *result = val.As<v8::Boolean>()->Value();
3639 // Copies a JavaScript string into a LATIN-1 string buffer. The result is the
3645 // via the result parameter.
3646 // The result argument is optional unless buf is NULL.
3648 JSVM_Env env, JSVM_Value value, char* buf, size_t bufsize, size_t* result) {
3656 CHECK_ARG(env, result);
3657 *result = val.As<v8::String>()->Length();
3667 if (result != nullptr) {
3668 *result = copied;
3670 } else if (result != nullptr) {
3671 *result = 0;
3677 // Copies a JavaScript string into a UTF-8 string buffer. The result is the
3683 // via the result parameter.
3684 // The result argument is optional unless buf is NULL.
3686 JSVM_Env env, JSVM_Value value, char* buf, size_t bufsize, size_t* result) {
3694 CHECK_ARG(env, result);
3695 *result = val.As<v8::String>()->Utf8Length(env->isolate);
3705 if (result != nullptr) {
3706 *result = copied;
3708 } else if (result != nullptr) {
3709 *result = 0;
3715 // Copies a JavaScript string into a UTF-16 string buffer. The result is the
3721 // code units) via the result parameter.
3722 // The result argument is optional unless buf is NULL.
3727 size_t* result) {
3735 CHECK_ARG(env, result);
3737 *result = val.As<v8::String>()->Length();
3746 if (result != nullptr) {
3747 *result = copied;
3749 } else if (result != nullptr) {
3750 *result = 0;
3758 JSVM_Value* result) {
3761 CHECK_ARG(env, result);
3766 *result = v8impl::JsValueFromV8LocalValue(b);
3772 JSVM_Env env, JSVM_Value value, JSVM_Value* result) { \
3775 CHECK_ARG(env, result); \
3782 *result = v8impl::JsValueFromV8LocalValue(str); \
3798 JSVM_Ref* result) {
3800 env, jsObject, nativeObject, finalizeCb, finalizeHint, result);
3805 void** result) {
3806 return v8impl::Unwrap(env, obj, result, v8impl::KeepWrap);
3811 void** result) {
3812 return v8impl::Unwrap(env, obj, result, v8impl::RemoveWrap);
3819 JSVM_Value* result) {
3821 CHECK_ARG(env, result);
3839 *result = v8impl::JsValueFromV8LocalValue(external_value);
3874 bool* result) {
3880 CHECK_ARG_WITH_PREAMBLE(env, result);
3890 *result = false;
3899 *result =
3902 *result = (tag.lower == typeTag->lower && 0 == typeTag->upper);
3904 *result = (0 == typeTag->lower && 0 == typeTag->upper);
3914 void** result) {
3917 CHECK_ARG(env, result);
3923 *result = external_value->Value();
3932 JSVM_Ref* result) {
3937 CHECK_ARG(env, result);
3943 *result = reinterpret_cast<JSVM_Ref>(reference);
3967 uint32_t* result) {
3979 if (result != nullptr) {
3980 *result = count;
3987 // the result is 0 the reference is now weak and the object may be GC'd at any
3992 uint32_t* result) {
4006 if (result != nullptr) {
4007 *result = count;
4015 // result is NULL.
4018 JSVM_Value* result) {
4023 CHECK_ARG(env, result);
4026 *result = v8impl::JsValueFromV8LocalValue(reference->Get());
4032 JSVM_HandleScope* result) {
4036 CHECK_ARG(env, result);
4038 *result = v8impl::JsHandleScopeFromV8HandleScope(
4061 JSVM_Env env, JSVM_EscapableHandleScope* result) {
4065 CHECK_ARG(env, result);
4067 *result = v8impl::JsEscapableHandleScopeFromV8EscapableHandleScope(
4091 JSVM_Value* result) {
4097 CHECK_ARG(env, result);
4102 *result = v8impl::JsValueFromV8LocalValue(
4113 JSVM_Value* result) {
4119 CHECK_ARG(env, result);
4133 *result = v8impl::JsValueFromV8LocalValue(maybe.ToLocalChecked());
4140 bool* result) {
4143 CHECK_ARG(env, result);
4145 *result = false;
4164 *result = maybe_result.FromJust();
4169 JSVM_Status JSVM_CDECL OH_JSVM_IsExceptionPending(JSVM_Env env, bool* result) {
4173 CHECK_ARG(env, result);
4175 *result = !env->last_exception.IsEmpty();
4180 JSVM_Value* result) {
4184 CHECK_ARG(env, result);
4187 return OH_JSVM_GetUndefined(env, result);
4189 *result = v8impl::JsValueFromV8LocalValue(
4199 bool* result) {
4202 CHECK_ARG(env, result);
4205 *result = val->IsArrayBuffer();
4213 JSVM_Value* result) {
4215 CHECK_ARG(env, result);
4227 *result = v8impl::JsValueFromV8LocalValue(buffer);
4258 JSVM_Value *result) {
4262 CHECK_ARG(env, result);
4271 *result = v8impl::JsValueFromV8LocalValue(arrayBuffer);
4281 JSVM_Value* result) {
4289 env, buffer, nullptr, nullptr, nullptr, result, nullptr);
4317 bool* result) {
4320 CHECK_ARG(env, result);
4323 *result = val->IsTypedArray();
4333 JSVM_Value* result) {
4336 CHECK_ARG(env, result);
4393 *result = v8impl::JsValueFromV8LocalValue(typedArray);
4468 JSVM_Value* result) {
4471 CHECK_ARG(env, result);
4487 *result = v8impl::JsValueFromV8LocalValue(DataView);
4493 bool* result) {
4496 CHECK_ARG(env, result);
4499 *result = val->IsDataView();
4544 JSVM_Status JSVM_CDECL OH_JSVM_GetVersion(JSVM_Env env, uint32_t* result) {
4546 CHECK_ARG(env, result);
4547 *result = NAPI_VERSION;
4596 JSVM_Value* result) {
4598 CHECK_ARG(env, result);
4603 *result = v8impl::JsValueFromV8LocalValue(maybe_date.ToLocalChecked());
4622 double* result) {
4625 CHECK_ARG(env, result);
4631 *result = date->ValueOf();
4641 JSVM_Ref* result) {
4651 // Create a self-deleting reference if the optional out-param result is not
4653 v8impl::Ownership ownership = result == nullptr
4659 if (result != nullptr) {
4660 *result = reinterpret_cast<JSVM_Ref>(reference);
4727 bool* result) {
4730 CHECK_ARG(env, result);
4734 *result =
4749 JSVM_Value* result) {
4751 CHECK_ARG(env, result);
4870 *result = v8impl::JsValueFromV8LocalValue(
4873 v8impl::Reference::New(env, v8impl::V8LocalValueFromJsValue(*result), 0, v8impl::Ownership::kRuntime,
4888 env, *result, static_descriptors.size(), static_descriptors.data()));
5109 JSVM_Value* result) {
5111 CHECK_ARG(env, result);
5113 *result = v8impl::JsValueFromV8LocalValue(v8::Set::New(env->isolate));
5121 JSVM_Value* result) {
5124 CHECK_ARG(env, result);
5132 *result = v8impl::JsValueFromV8LocalValue(regExp.ToLocalChecked());
5137 JSVM_Status JSVM_CDECL OH_JSVM_CreateMap(JSVM_Env env, JSVM_Value* result) {
5139 CHECK_ARG(env, result);
5141 *result = v8impl::JsValueFromV8LocalValue(v8::Map::New(env->isolate));
5174 JSVM_Value* result) {
5176 CHECK_ARG(env, result);
5184 *result = v8impl::JsValueFromV8LocalValue(val);
5337 bool* result) {
5342 CHECK_ARG(env, result);
5345 *result = val->IsWasmModuleObject();