本文整理汇总了C++中JumpList类的典型用法代码示例。如果您正苦于以下问题:C++ JumpList类的具体用法?C++ JumpList怎么用?C++ JumpList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JumpList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void Initialize()
{
if (base::win::get_version() < base::win::VERSION_WIN7)
{
return ;
}
const wchar_t* currentAppID = 0;
HRESULT hr = windows7::GetCurrentProcessExplicitAppUserModelID((wchar_t**)¤tAppID);
if (FAILED(hr) || !currentAppID)
{
currentAppID = getCurrentAppID();
windows7::SetCurrentProcessExplicitAppUserModelID(currentAppID);
}
JumpList jumpList;
jumpList.SetAppID(currentAppID);
if (jumpList.InitializeList())
{
fs::path ydweDirectory = base::path::get(base::path::DIR_MODULE).remove_filename().remove_filename();
jumpList.AddTaskSeparator();
jumpList.AddTask(L"YDWEÅäÖÃ", [&](CComPtr<IShellLinkW>& shellLinkPtr)
{
shellLinkPtr->SetPath((ydweDirectory / L"bin" / L"YDWEConfig.exe").c_str());
shellLinkPtr->SetDescription(L"´ò¿ªYDWEÅäÖóÌÐò¡£");
shellLinkPtr->SetIconLocation((ydweDirectory / L"bin" / L"logo.ico").c_str(), 0);
});
}
}
示例2: terminateAlternative
void Generator::terminateAlternative(JumpList& successes, JumpList& failures)
{
successes.append(jump());
failures.link(this);
peek(index);
}
示例3: compileLoadVarargs
void JIT::compileLoadVarargs(Instruction* instruction)
{
int thisValue = instruction[3].u.operand;
int arguments = instruction[4].u.operand;
int firstFreeRegister = instruction[5].u.operand;
JumpList slowCase;
JumpList end;
bool canOptimize = m_codeBlock->usesArguments()
&& arguments == m_codeBlock->argumentsRegister().offset()
&& !m_codeBlock->symbolTable()->slowArguments();
if (canOptimize) {
emitGetVirtualRegister(arguments, regT0);
slowCase.append(branch64(NotEqual, regT0, TrustedImm64(JSValue::encode(JSValue()))));
emitGetFromCallFrameHeader32(JSStack::ArgumentCount, regT0);
slowCase.append(branch32(Above, regT0, TrustedImm32(Arguments::MaxArguments + 1)));
// regT0: argumentCountIncludingThis
move(regT0, regT1);
neg64(regT1);
add64(TrustedImm32(firstFreeRegister - JSStack::CallFrameHeaderSize), regT1);
lshift64(TrustedImm32(3), regT1);
addPtr(callFrameRegister, regT1);
// regT1: newCallFrame
slowCase.append(branchPtr(Above, AbsoluteAddress(m_vm->addressOfJSStackLimit()), regT1));
// Initialize ArgumentCount.
store32(regT0, Address(regT1, JSStack::ArgumentCount * static_cast<int>(sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));
// Initialize 'this'.
emitGetVirtualRegister(thisValue, regT2);
store64(regT2, Address(regT1, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));
// Copy arguments.
signExtend32ToPtr(regT0, regT0);
end.append(branchSub64(Zero, TrustedImm32(1), regT0));
// regT0: argumentCount
Label copyLoop = label();
load64(BaseIndex(callFrameRegister, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))), regT2);
store64(regT2, BaseIndex(regT1, regT0, TimesEight, CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register))));
branchSub64(NonZero, TrustedImm32(1), regT0).linkTo(copyLoop, this);
end.append(jump());
}
if (canOptimize)
slowCase.link(this);
emitGetVirtualRegister(thisValue, regT0);
emitGetVirtualRegister(arguments, regT1);
callOperation(operationLoadVarargs, regT0, regT1, firstFreeRegister);
move(returnValueGPR, regT1);
if (canOptimize)
end.link(this);
}
示例4: compileLoadVarargs
void JIT::compileLoadVarargs(Instruction* instruction)
{
int thisValue = instruction[2].u.operand;
int arguments = instruction[3].u.operand;
int firstFreeRegister = instruction[4].u.operand;
JumpList slowCase;
JumpList end;
if (m_codeBlock->usesArguments() && arguments == m_codeBlock->argumentsRegister()) {
emitLoadTag(arguments, regT1);
slowCase.append(branch32(NotEqual, regT1, TrustedImm32(JSValue::EmptyValueTag)));
load32(payloadFor(RegisterFile::ArgumentCount), regT2);
slowCase.append(branch32(Above, regT2, TrustedImm32(Arguments::MaxArguments + 1)));
// regT2: argumentCountIncludingThis
move(regT2, regT3);
add32(TrustedImm32(firstFreeRegister + RegisterFile::CallFrameHeaderSize), regT3);
lshift32(TrustedImm32(3), regT3);
addPtr(callFrameRegister, regT3);
// regT3: newCallFrame
slowCase.append(branchPtr(Below, AbsoluteAddress(m_globalData->interpreter->registerFile().addressOfEnd()), regT3));
// Initialize ArgumentCount.
store32(regT2, payloadFor(RegisterFile::ArgumentCount, regT3));
// Initialize 'this'.
emitLoad(thisValue, regT1, regT0);
store32(regT0, Address(regT3, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));
store32(regT1, Address(regT3, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + (CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));
// Copy arguments.
neg32(regT2);
end.append(branchAdd32(Zero, TrustedImm32(1), regT2));
// regT2: -argumentCount;
Label copyLoop = label();
load32(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))), regT0);
load32(BaseIndex(callFrameRegister, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))), regT1);
store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));
store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) +(CallFrame::thisArgumentOffset() * static_cast<int>(sizeof(Register)))));
branchAdd32(NonZero, TrustedImm32(1), regT2).linkTo(copyLoop, this);
end.append(jump());
}
if (m_codeBlock->usesArguments() && arguments == m_codeBlock->argumentsRegister())
slowCase.link(this);
JITStubCall stubCall(this, cti_op_load_varargs);
stubCall.addArgument(thisValue);
stubCall.addArgument(arguments);
stubCall.addArgument(Imm32(firstFreeRegister));
stubCall.call(regT3);
if (m_codeBlock->usesArguments() && arguments == m_codeBlock->argumentsRegister())
end.link(this);
}
示例5: generateAssertionEOL
void Generator::generateAssertionEOL(JumpList& failures)
{
if (m_parser.multiline()) {
JumpList nextIsNewline;
generateLoadCharacter(nextIsNewline); // end of input == success
generateCharacterClassInverted(nextIsNewline, CharacterClass::newline());
failures.append(jump());
nextIsNewline.link(this);
} else {
failures.append(jne32(length, index));
}
}
示例6: generateParenthesesInvertedAssertion
void Generator::generateParenthesesInvertedAssertion(JumpList& failures)
{
JumpList disjunctionFailed;
push(index);
m_parser.parseDisjunction(disjunctionFailed);
// If the disjunction succeeded, the inverted assertion failed.
pop(index);
failures.append(jump());
// If the disjunction failed, the inverted assertion succeeded.
disjunctionFailed.link(this);
pop(index);
}
示例7: generateParenthesesAssertion
void Generator::generateParenthesesAssertion(JumpList& failures)
{
JumpList disjunctionFailed;
push(index);
m_parser.parseDisjunction(disjunctionFailed);
Jump success = jump();
disjunctionFailed.link(this);
pop(index);
failures.append(jump());
success.link(this);
pop(index);
}
示例8: generateLoadCharacter
void Generator::generateCharacterClass(JumpList& failures, const CharacterClass& charClass, bool invert)
{
generateLoadCharacter(failures);
if (invert)
generateCharacterClassInverted(failures, charClass);
else {
JumpList successes;
generateCharacterClassInverted(successes, charClass);
failures.append(jump());
successes.link(this);
}
add32(Imm32(1), index);
}
示例9: je32
void Generator::generateAssertionWordBoundary(JumpList& failures, bool invert)
{
JumpList wordBoundary;
JumpList notWordBoundary;
// (1) Check if the previous value was a word char
// (1.1) check for begin of input
Jump atBegin = je32(index, Imm32(0));
// (1.2) load the last char, and chck if is word character
load16(BaseIndex(input, index, TimesTwo, -2), character);
JumpList previousIsWord;
generateCharacterClassInverted(previousIsWord, CharacterClass::wordchar());
// (1.3) if we get here, previous is not a word char
atBegin.link(this);
// (2) Handle situation where previous was NOT a \w
generateLoadCharacter(notWordBoundary);
generateCharacterClassInverted(wordBoundary, CharacterClass::wordchar());
// (2.1) If we get here, neither chars are word chars
notWordBoundary.append(jump());
// (3) Handle situation where previous was a \w
// (3.0) link success in first match to here
previousIsWord.link(this);
generateLoadCharacter(wordBoundary);
generateCharacterClassInverted(notWordBoundary, CharacterClass::wordchar());
// (3.1) If we get here, this is an end of a word, within the input.
// (4) Link everything up
if (invert) {
// handle the fall through case
wordBoundary.append(jump());
// looking for non word boundaries, so link boundary fails to here.
notWordBoundary.link(this);
failures.append(wordBoundary);
} else {
// looking for word boundaries, so link successes here.
wordBoundary.link(this);
failures.append(notWordBoundary);
}
}
示例10: InitMainWindowInstance
//
// FUNCTION: InitMainWindowInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
HWND InitMainWindowInstance(
HINSTANCE hInstance,
int nCmdShow,
PTCHAR szWindowClass,
PTCHAR szTitle)
{
hInst = hInstance; // Store instance handle in our global variable
beginMainWindowCreationTime.Now();
// Should make window size be data driven
mainWindowHandle = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE,
szWindowClass, szTitle,
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT,
// WS_POPUP, CW_USEDEFAULT, 0,
DEFAULT_WIN_WIDTH, DEFAULT_WIN_HEIGHT,
NULL, NULL,
hInstance, NULL);
if (mainWindowHandle)
{
if (!devMode)
{
jumpList.SetUpJumpList(hInst);
}
}
return mainWindowHandle;
}
示例11: generatePatternCharacter
void Generator::generatePatternCharacter(JumpList& failures, int ch)
{
generateLoadCharacter(failures);
// used for unicode case insensitive
bool hasUpper = false;
Jump isUpper;
// if case insensitive match
if (m_parser.ignoreCase()) {
UChar lower, upper;
// check for ascii case sensitive characters
if (isASCIIAlpha(ch)) {
or32(Imm32(32), character);
ch |= 32;
} else if (!isASCII(ch) && ((lower = Unicode::toLower(ch)) != (upper = Unicode::toUpper(ch)))) {
// handle unicode case sentitive characters - branch to success on upper
isUpper = je32(character, Imm32(upper));
hasUpper = true;
ch = lower;
}
}
// checks for ch, or lower case version of ch, if insensitive
failures.append(jne32(character, Imm32((unsigned short)ch)));
if (m_parser.ignoreCase() && hasUpper) {
// for unicode case insensitive matches, branch here if upper matches.
isUpper.link(this);
}
// on success consume the char
add32(Imm32(1), index);
}
示例12: generateCharacterClassInvertedRange
void Generator::generateCharacterClassInvertedRange(JumpList& failures, JumpList& matchDest, const CharacterRange* ranges, unsigned count, unsigned* matchIndex, const UChar* matches, unsigned matchCount)
{
do {
// pick which range we're going to generate
int which = count >> 1;
char lo = ranges[which].begin;
char hi = ranges[which].end;
// check if there are any ranges or matches below lo. If not, just jl to failure -
// if there is anything else to check, check that first, if it falls through jmp to failure.
if ((*matchIndex < matchCount) && (matches[*matchIndex] < lo)) {
Jump loOrAbove = jge32(character, Imm32((unsigned short)lo));
// generate code for all ranges before this one
if (which)
generateCharacterClassInvertedRange(failures, matchDest, ranges, which, matchIndex, matches, matchCount);
do {
matchDest.append(je32(character, Imm32((unsigned short)matches[*matchIndex])));
++*matchIndex;
} while ((*matchIndex < matchCount) && (matches[*matchIndex] < lo));
failures.append(jump());
loOrAbove.link(this);
} else if (which) {
Jump loOrAbove = jge32(character, Imm32((unsigned short)lo));
generateCharacterClassInvertedRange(failures, matchDest, ranges, which, matchIndex, matches, matchCount);
failures.append(jump());
loOrAbove.link(this);
} else
failures.append(jl32(character, Imm32((unsigned short)lo)));
while ((*matchIndex < matchCount) && (matches[*matchIndex] <= hi))
++*matchIndex;
matchDest.append(jle32(character, Imm32((unsigned short)hi)));
// fall through to here, the value is above hi.
// shuffle along & loop around if there are any more matches to handle.
unsigned next = which + 1;
ranges += next;
count -= next;
} while (count);
}
示例13: generatePatternCharacterPair
bool Generator::generatePatternCharacterPair(JumpList& failures, int ch1, int ch2)
{
if (m_parser.ignoreCase()) {
// Non-trivial case folding requires more than one test, so we can't
// test as a pair with an adjacent character.
if (!isASCII(ch1) && Unicode::toLower(ch1) != Unicode::toUpper(ch1))
return false;
if (!isASCII(ch2) && Unicode::toLower(ch2) != Unicode::toUpper(ch2))
return false;
}
// Optimistically consume 2 characters.
add32(Imm32(2), index);
failures.append(jg32(index, length));
// Load the characters we just consumed, offset -2 characters from index.
load32(BaseIndex(input, index, TimesTwo, -2 * 2), character);
if (m_parser.ignoreCase()) {
// Convert ASCII alphabet characters to upper case before testing for
// equality. (ASCII non-alphabet characters don't require upper-casing
// because they have no uppercase equivalents. Unicode characters don't
// require upper-casing because we only handle Unicode characters whose
// upper and lower cases are equal.)
int ch1Mask = 0;
if (isASCIIAlpha(ch1)) {
ch1 |= 32;
ch1Mask = 32;
}
int ch2Mask = 0;
if (isASCIIAlpha(ch2)) {
ch2 |= 32;
ch2Mask = 32;
}
int mask = ch1Mask | (ch2Mask << 16);
if (mask)
or32(Imm32(mask), character);
}
int pair = ch1 | (ch2 << 16);
failures.append(jne32(character, Imm32(pair)));
return true;
}
示例14: generateAssertionBOL
void Generator::generateAssertionBOL(JumpList& failures)
{
if (m_parser.multiline()) {
JumpList previousIsNewline;
// begin of input == success
previousIsNewline.append(je32(index, Imm32(0)));
// now check prev char against newline characters.
load16(BaseIndex(input, index, TimesTwo, -2), character);
generateCharacterClassInverted(previousIsNewline, CharacterClass::newline());
failures.append(jump());
previousIsNewline.link(this);
} else
failures.append(jne32(index, Imm32(0)));
}
示例15: generateNonGreedyQuantifier
void Generator::generateNonGreedyQuantifier(JumpList& failures, GenerateAtomFunctor& functor, unsigned min, unsigned max)
{
JumpList atomFailedList;
JumpList alternativeFailedList;
// (0) Setup: Save, then init repeatCount.
push(repeatCount);
move(Imm32(0), repeatCount);
Jump start = jump();
// (4) Quantifier failed: No more atom reading possible.
Label quantifierFailed(this);
pop(repeatCount);
failures.append(jump());
// (3) Alternative failed: If we can, read another atom, then fall through to (2) to try again.
Label alternativeFailed(this);
pop(index);
if (max != Quantifier::Infinity)
je32(repeatCount, Imm32(max), quantifierFailed);
// (1) Read an atom.
if (min)
start.link(this);
Label readAtom(this);
functor.generateAtom(this, atomFailedList);
atomFailedList.linkTo(quantifierFailed, this);
add32(Imm32(1), repeatCount);
// (2) Keep reading if we're under the minimum.
if (min > 1)
jl32(repeatCount, Imm32(min), readAtom);
// (3) Test the rest of the alternative.
if (!min)
start.link(this);
push(index);
m_parser.parseAlternative(alternativeFailedList);
alternativeFailedList.linkTo(alternativeFailed, this);
pop();
pop(repeatCount);
}