本文整理汇总了C++中PROBE_STACK函数的典型用法代码示例。如果您正苦于以下问题:C++ PROBE_STACK函数的具体用法?C++ PROBE_STACK怎么用?C++ PROBE_STACK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PROBE_STACK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PROBE_STACK
Var JavascriptGeneratorFunction::NewInstance(RecyclableObject* function, CallInfo callInfo, ...)
{
// Get called when creating a new generator function through the constructor (e.g. gf.__proto__.constructor) and sets EntryGeneratorFunctionImplementation as the entrypoint
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
return JavascriptFunction::NewInstanceHelper(function->GetScriptContext(), function, callInfo, args, FunctionKind::Generator);
}
示例2: PROBE_STACK
Var JavascriptError::NewWinRTErrorInstance(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
JavascriptError* pError = scriptContext->GetHostScriptContext()->CreateWinRTError(nullptr, nullptr);
return JavascriptError::NewInstance(function, pError, callInfo, args);
}
示例3: PROBE_STACK
Var JavascriptWeakSet::NewInstance(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
JavascriptLibrary* library = scriptContext->GetLibrary();
Var newTarget = callInfo.Flags & CallFlags_NewTarget ? args.Values[args.Info.Count] : args[0];
bool isCtorSuperCall = (callInfo.Flags & CallFlags_New) && newTarget != nullptr && !JavascriptOperators::IsUndefined(newTarget);
Assert(isCtorSuperCall || !(callInfo.Flags & CallFlags_New) || args[0] == nullptr);
CHAKRATEL_LANGSTATS_INC_BUILTINCOUNT(WeakSetCount);
JavascriptWeakSet* weakSetObject = nullptr;
if (callInfo.Flags & CallFlags_New)
{
weakSetObject = library->CreateWeakSet();
}
else
{
JavascriptError::ThrowTypeErrorVar(scriptContext, JSERR_NeedObjectOfType, _u("WeakSet"), _u("WeakSet"));
}
Assert(weakSetObject != nullptr);
Var iterable = (args.Info.Count > 1) ? args[1] : library->GetUndefined();
RecyclableObject* iter = nullptr;
RecyclableObject* adder = nullptr;
if (JavascriptConversion::CheckObjectCoercible(iterable, scriptContext))
{
iter = JavascriptOperators::GetIterator(iterable, scriptContext);
Var adderVar = JavascriptOperators::GetProperty(weakSetObject, PropertyIds::add, scriptContext);
if (!JavascriptConversion::IsCallable(adderVar))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_NeedFunction);
}
adder = RecyclableObject::FromVar(adderVar);
}
if (iter != nullptr)
{
Var nextItem;
while (JavascriptOperators::IteratorStepAndValue(iter, scriptContext, &nextItem))
{
CALL_FUNCTION(adder, CallInfo(CallFlags_Value, 2), weakSetObject, nextItem);
}
}
return isCtorSuperCall ?
JavascriptOperators::OrdinaryCreateFromConstructor(RecyclableObject::FromVar(newTarget), weakSetObject, nullptr, scriptContext) :
weakSetObject;
}
示例4: PROBE_STACK
Var JavascriptStringIterator::EntryNext(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
JavascriptLibrary* library = scriptContext->GetLibrary();
Assert(!(callInfo.Flags & CallFlags_New));
Var thisObj = args[0];
if (!JavascriptStringIterator::Is(thisObj))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_This_NeedStringIterator, L"String Iterator.prototype.next");
}
JavascriptStringIterator* iterator = JavascriptStringIterator::FromVar(thisObj);
JavascriptString* string = iterator->m_string;
if (string == nullptr)
{
return library->CreateIteratorResultObjectUndefinedTrue();
}
charcount_t length = string->GetLength();
charcount_t index = iterator->m_nextIndex;
if (index >= length)
{
// Nulling out the m_string field is important so that the iterator
// does not keep the string alive after iteration is completed.
iterator->m_string = nullptr;
return library->CreateIteratorResultObjectUndefinedTrue();
}
wchar_t chFirst = string->GetItem(index);
Var result;
if (index + 1 == string->GetLength() ||
!NumberUtilities::IsSurrogateLowerPart(chFirst) ||
!NumberUtilities::IsSurrogateUpperPart(string->GetItem(index + 1)))
{
result = scriptContext->GetLibrary()->GetCharStringCache().GetStringForChar(chFirst);
iterator->m_nextIndex += 1;
}
else
{
result = JavascriptString::SubstringCore(string, index, 2, scriptContext);
iterator->m_nextIndex += 2;
}
return library->CreateIteratorResultObjectValueFalse(result);
}
示例5: PROBE_STACK
Var JavascriptGeneratorFunction::NewInstanceRestrictedMode(RecyclableObject* function, CallInfo callInfo, ...)
{
ScriptContext* scriptContext = function->GetScriptContext();
scriptContext->CheckEvalRestriction();
PROBE_STACK(scriptContext, Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
return JavascriptFunction::NewInstanceHelper(scriptContext, function, callInfo, args, FunctionKind::Generator);
}
示例6: PROBE_STACK
Var JavascriptError::NewWinRTErrorInstance(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
JavascriptError* pError = scriptContext->GetHostScriptContext()->CreateWinRTError(nullptr, nullptr);
Var newTarget = callInfo.Flags & CallFlags_NewTarget ? args.Values[args.Info.Count] : args[0];
Var message = args.Info.Count > 1 ? args[1] : scriptContext->GetLibrary()->GetUndefined();
return JavascriptError::NewInstance(function, pError, callInfo, newTarget, message);
}
示例7: PROBE_STACK
Var SIMDUint16x8Lib::EntryLoad(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
Assert(!(callInfo.Flags & CallFlags_New));
return SIMD128TypedArrayLoad<JavascriptSIMDUint16x8>(args[1], args[2], 8 * INT16_SIZE, scriptContext);
}
示例8: PROBE_STACK
Var SIMDFloat64x2Lib::EntryZero(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
Assert(!(callInfo.Flags & CallFlags_New));
SIMDValue lanes = SIMDFloat64x2Operation::OpZero();
return JavascriptSIMDFloat64x2::New(&lanes, scriptContext);
}
示例9: PROBE_STACK
Var SIMDInt8x16Lib::EntryCheck(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
if (args.Info.Count >= 2 && JavascriptSIMDInt8x16::Is(args[1]))
{
return args[1];
}
JavascriptError::ThrowTypeError(scriptContext, JSERR_SimdInt8x16TypeMismatch, L"Int8x16");
}
示例10: PROBE_STACK
Var JavascriptMapIterator::EntryNext(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
JavascriptLibrary* library = scriptContext->GetLibrary();
Assert(!(callInfo.Flags & CallFlags_New));
Var thisObj = args[0];
if (!JavascriptMapIterator::Is(thisObj))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_This_NeedMapIterator, L"Map Iterator.prototype.next");
}
JavascriptMapIterator* iterator = JavascriptMapIterator::FromVar(thisObj);
JavascriptMap* map = iterator->m_map;
auto& mapIterator = iterator->m_mapIterator;
if (map == nullptr || !mapIterator.Next())
{
iterator->m_map = nullptr;
return library->CreateIteratorResultObjectUndefinedTrue();
}
auto entry = mapIterator.Current();
Var result;
if (iterator->m_kind == JavascriptMapIteratorKind::KeyAndValue)
{
JavascriptArray* keyValueTuple = library->CreateArray(2);
keyValueTuple->SetItem(0, entry.Key(), PropertyOperation_None);
keyValueTuple->SetItem(1, entry.Value(), PropertyOperation_None);
result = keyValueTuple;
}
else if (iterator->m_kind == JavascriptMapIteratorKind::Key)
{
result = entry.Key();
}
else
{
Assert(iterator->m_kind == JavascriptMapIteratorKind::Value);
result = entry.Value();
}
return library->CreateIteratorResultObjectValueFalse(result);
}
示例11: PROBE_STACK
Var SIMDInt32x4Lib::EntryCheck(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
Assert(!(callInfo.Flags & CallFlags_New)); //comment out due to -ls -stress run
if (args.Info.Count >= 2 && JavascriptSIMDInt32x4::Is(args[1]))
{
return args[1];
}
JavascriptError::ThrowTypeError(scriptContext, JSERR_SimdInt32x4TypeMismatch, _u("int32x4"));
}
示例12: PROBE_STACK
Var JavascriptMap::EntryValues(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
if (!JavascriptMap::Is(args[0]))
{
JavascriptError::ThrowTypeErrorVar(scriptContext, JSERR_NeedObjectOfType, _u("Map.prototype.values"), _u("Map"));
}
JavascriptMap* map = JavascriptMap::FromVar(args[0]);
return scriptContext->GetLibrary()->CreateMapIterator(map, JavascriptMapIteratorKind::Value);
}
示例13: PROBE_STACK
Var JavascriptReflect::EntryConstruct(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
Var undefinedValue = scriptContext->GetLibrary()->GetUndefined();
AUTO_TAG_NATIVE_LIBRARY_ENTRY(function, callInfo, _u("Reflect.construct"));
AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
if (args.Info.Flags & CallFlags_New)
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_ErrorOnNew, _u("Reflect.construct"));
}
Var target = args.Info.Count > 1 ? args[1] : undefinedValue;
if (!JavascriptOperators::IsConstructor(target))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_NeedConstructor, _u("target"));
}
Var newTarget = nullptr;
if (scriptContext->GetConfig()->IsES6ClassAndExtendsEnabled())
{
if (args.Info.Count > 3)
{
newTarget = args[3];
if (!JavascriptOperators::IsConstructor(newTarget))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_NeedConstructor, _u("newTarget"));
}
}
else
{
newTarget = target;
}
}
RecyclableObject* thisArg = RecyclableObject::FromVar(undefinedValue);
if (newTarget != nullptr)
{
thisArg = JavascriptOperators::CreateFromConstructor(RecyclableObject::FromVar(newTarget), scriptContext);
}
Var argArray = args.Info.Count > 2 ? args[2] : undefinedValue;
return JavascriptFunction::ConstructHelper(RecyclableObject::FromVar(target), thisArg, newTarget, argArray, scriptContext);
}
示例14: PROBE_STACK
Var SIMDInt8x16Lib::EntryFromUint8x16Bits(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
AssertMsg(args.Info.Count > 0, "Should always have implicit 'this'");
Assert(!(callInfo.Flags & CallFlags_New));
if (args.Info.Count >= 2 && JavascriptSIMDUint8x16::Is(args[1]))
{
JavascriptSIMDUint8x16 *instance = JavascriptSIMDUint8x16::FromVar(args[1]);
return SIMDConvertTypeFromBits<JavascriptSIMDUint8x16, JavascriptSIMDInt8x16>(instance, scriptContext);
}
JavascriptError::ThrowTypeError(scriptContext, JSERR_SimdInt8x16TypeMismatch, L"fromUint8x16Bits");
}
示例15: PROBE_STACK
// SharedArrayBuffer.prototype.byteLength
Var SharedArrayBuffer::EntryGetterByteLength(RecyclableObject* function, CallInfo callInfo, ...)
{
PROBE_STACK(function->GetScriptContext(), Js::Constants::MinStackDefault);
ARGUMENTS(args, callInfo);
ScriptContext* scriptContext = function->GetScriptContext();
Assert(!(callInfo.Flags & CallFlags_New));
if (args.Info.Count == 0 || !SharedArrayBuffer::Is(args[0]))
{
JavascriptError::ThrowTypeError(scriptContext, JSERR_NeedSharedArrayBufferObject);
}
SharedArrayBuffer* sharedArrayBuffer = SharedArrayBuffer::FromVar(args[0]);
return JavascriptNumber::ToVar(sharedArrayBuffer->GetByteLength(), scriptContext);
}