本文整理汇总了C++中StringPrintStream类的典型用法代码示例。如果您正苦于以下问题:C++ StringPrintStream类的具体用法?C++ StringPrintStream怎么用?C++ StringPrintStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringPrintStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disassembly
CString MacroAssemblerCodeRef::disassembly() const
{
StringPrintStream out;
if (!tryToDisassemble(out, ""))
return CString();
return out.toCString();
}
示例2: pointerDump
void Value::deepDump(PrintStream& out) const
{
out.print(m_type, " ", *this, " = ", m_opcode);
out.print("(");
CommaPrinter comma;
for (Value* child : children())
out.print(comma, pointerDump(child));
if (m_origin)
out.print(comma, m_origin);
{
StringPrintStream stringOut;
dumpMeta(stringOut);
CString string = stringOut.toCString();
if (string.length())
out.print(comma, string);
}
{
CString string = toCString(effects());
if (string.length())
out.print(comma, string);
}
out.print(")");
}
示例3: dumpDisassembly
Vector<JITDisassembler::DumpedOp> JITDisassembler::dumpVectorForInstructions(LinkBuffer& linkBuffer, const char* prefix, Vector<MacroAssembler::Label>& labels, MacroAssembler::Label endLabel)
{
StringPrintStream out;
Vector<DumpedOp> result;
for (unsigned i = 0; i < labels.size();) {
if (!labels[i].isSet()) {
i++;
continue;
}
out.reset();
result.append(DumpedOp());
result.last().index = i;
out.print(prefix);
m_codeBlock->dumpBytecode(out, i);
for (unsigned nextIndex = i + 1; ; nextIndex++) {
if (nextIndex >= labels.size()) {
dumpDisassembly(out, linkBuffer, labels[i], endLabel);
result.last().disassembly = out.toCString();
return result;
}
if (labels[nextIndex].isSet()) {
dumpDisassembly(out, linkBuffer, labels[i], labels[nextIndex]);
result.last().disassembly = out.toCString();
i = nextIndex;
break;
}
}
}
return result;
}
示例4: locker
BytecodeSequence::BytecodeSequence(CodeBlock* codeBlock)
{
StringPrintStream out;
for (unsigned i = 0; i < codeBlock->numberOfArgumentValueProfiles(); ++i) {
ConcurrentJSLocker locker(codeBlock->m_lock);
CString description = codeBlock->valueProfileForArgument(i)->briefDescription(locker);
if (!description.length())
continue;
out.reset();
out.print("arg", i, ": ", description);
m_header.append(out.toCString());
}
StubInfoMap stubInfos;
codeBlock->getStubInfoMap(stubInfos);
for (unsigned bytecodeIndex = 0; bytecodeIndex < codeBlock->instructions().size();) {
out.reset();
codeBlock->dumpBytecode(out, bytecodeIndex, stubInfos);
m_sequence.append(Bytecode(bytecodeIndex, codeBlock->vm()->interpreter->getOpcodeID(codeBlock->instructions()[bytecodeIndex].u.opcode), out.toCString()));
bytecodeIndex += opcodeLength(
codeBlock->vm()->interpreter->getOpcodeID(
codeBlock->instructions()[bytecodeIndex].u.opcode));
}
}
示例5: install
void AdaptiveInferredPropertyValueWatchpoint::fire(const FireDetail& detail)
{
// One of the watchpoints fired, but the other one didn't. Make sure that neither of them are
// in any set anymore. This simplifies things by allowing us to reinstall the watchpoints
// wherever from scratch.
if (m_structureWatchpoint.isOnList())
m_structureWatchpoint.remove();
if (m_propertyWatchpoint.isOnList())
m_propertyWatchpoint.remove();
if (m_key.isWatchable(PropertyCondition::EnsureWatchability)) {
install();
return;
}
if (DFG::shouldShowDisassembly()) {
dataLog(
"Firing watchpoint ", RawPointer(this), " (", m_key, ") on ", *m_codeBlock, "\n");
}
StringPrintStream out;
out.print("Adaptation of ", m_key, " failed: ", detail);
StringFireDetail stringDetail(out.toCString().data());
m_codeBlock->jettison(
Profiler::JettisonDueToUnprofiledWatchpoint, CountReoptimization, &stringDetail);
}
示例6: handleFire
void ObjectToStringAdaptiveInferredPropertyValueWatchpoint::handleFire(const FireDetail& detail)
{
StringPrintStream out;
out.print("Adaptation of ", key(), " failed: ", detail);
StringFireDetail stringDetail(out.toCString().data());
m_structureRareData->clearObjectToStringValue();
}
示例7: install
void ObjectToStringAdaptiveStructureWatchpoint::fireInternal(const FireDetail& detail)
{
if (m_key.isWatchable(PropertyCondition::EnsureWatchability)) {
install();
return;
}
StringPrintStream out;
out.print("ObjectToStringValue Adaptation of ", m_key, " failed: ", detail);
StringFireDetail stringDetail(out.toCString().data());
m_structureRareData->clearObjectToStringValue();
}
示例8: beginPhase
void Phase::beginPhase()
{
if (Options::verboseValidationFailure()) {
StringPrintStream out;
m_graph.dump(out);
m_graphDumpBeforePhase = out.toCString();
}
if (!shouldDumpGraphAtEachPhase(m_graph.m_plan.mode()))
return;
dataLog("Beginning DFG phase ", m_name, ".\n");
dataLog("Before ", m_name, ":\n");
m_graph.dump();
}
示例9: unexpectedExceptionMessage
CString ExceptionScope::unexpectedExceptionMessage()
{
StringPrintStream out;
out.println("Unexpected exception observed on thread ", currentThread(), " at:");
auto currentStack = StackTrace::captureStackTrace(Options::unexpectedExceptionStackTraceLimit(), 1);
currentStack->dump(out, " ");
if (!m_vm.nativeStackTraceOfLastThrow())
return CString();
out.println("The exception was thrown from thread ", m_vm.throwingThread(), " at:");
m_vm.nativeStackTraceOfLastThrow()->dump(out, " ");
return out.toCString();
}
示例10: install
void AdaptiveStructureWatchpoint::fireInternal(const FireDetail& detail)
{
if (m_key.isWatchable(PropertyCondition::EnsureWatchability)) {
install();
return;
}
if (DFG::shouldDumpDisassembly()) {
dataLog(
"Firing watchpoint ", RawPointer(this), " (", m_key, ") on ", *m_codeBlock, "\n");
}
StringPrintStream out;
out.print("Adaptation of ", m_key, " failed: ", detail);
StringFireDetail stringDetail(out.toCString().data());
m_codeBlock->jettison(
Profiler::JettisonDueToUnprofiledWatchpoint, CountReoptimization, &stringDetail);
}
示例11: finalizeCodeWithoutDisassembly
LinkBuffer::CodeRef LinkBuffer::finalizeCodeWithDisassembly(const char* format, ...)
{
CodeRef result = finalizeCodeWithoutDisassembly();
if (m_alreadyDisassembled)
return result;
StringPrintStream out;
out.printf("Generated JIT code for ");
va_list argList;
va_start(argList, format);
out.vprintf(format, argList);
va_end(argList);
out.printf(":\n");
out.printf(" Code at [%p, %p):\n", result.code().executableAddress(), static_cast<char*>(result.code().executableAddress()) + result.size());
CString header = out.toCString();
if (Options::asyncDisassembly()) {
disassembleAsynchronously(header, result, m_size, " ");
return result;
}
dataLog(header);
disassemble(result.code(), m_size, " ", WTF::dataFile());
return result;
}
示例12: reportToProfiler
void JITDisassembler::reportToProfiler(Profiler::Compilation* compilation, LinkBuffer& linkBuffer)
{
StringPrintStream out;
dumpHeader(out, linkBuffer);
compilation->addDescription(Profiler::CompiledBytecode(Profiler::OriginStack(), out.toCString()));
out.reset();
dumpDisassembly(out, linkBuffer, m_startOfCode, m_labelForBytecodeIndexInMainPath[0]);
compilation->addDescription(Profiler::CompiledBytecode(Profiler::OriginStack(), out.toCString()));
reportInstructions(compilation, linkBuffer, " ", m_labelForBytecodeIndexInMainPath, firstSlowLabel());
compilation->addDescription(Profiler::CompiledBytecode(Profiler::OriginStack(), " (End Of Main Path)\n"));
reportInstructions(compilation, linkBuffer, " (S) ", m_labelForBytecodeIndexInSlowPath, m_endOfSlowPath);
compilation->addDescription(Profiler::CompiledBytecode(Profiler::OriginStack(), " (End Of Slow Path)\n"));
out.reset();
dumpDisassembly(out, linkBuffer, m_endOfSlowPath, m_endOfCode);
compilation->addDescription(Profiler::CompiledBytecode(Profiler::OriginStack(), out.toCString()));
}
示例13: m_apiLock
//.........这里部分代码省略.........
, keywords(adoptPtr(new Keywords(this)))
, interpreter(0)
, jsArrayClassInfo(&JSArray::s_info)
, jsFinalObjectClassInfo(&JSFinalObject::s_info)
#if ENABLE(DFG_JIT)
, sizeOfLastScratchBuffer(0)
#endif
, dynamicGlobalObject(0)
, cachedUTCOffset(QNaN)
, m_enabledProfiler(0)
, m_regExpCache(new RegExpCache(this))
#if ENABLE(REGEXP_TRACING)
, m_rtTraceList(new RTTraceList())
#endif
#ifndef NDEBUG
, exclusiveThread(0)
#endif
, m_newStringsSinceLastHashCons(0)
#if ENABLE(ASSEMBLER)
, m_canUseAssembler(enableAssembler(executableAllocator))
#endif
#if ENABLE(JIT)
, m_canUseJIT(m_canUseAssembler && Options::useJIT())
#endif
#if ENABLE(YARR_JIT)
, m_canUseRegExpJIT(m_canUseAssembler && Options::useRegExpJIT())
#endif
#if ENABLE(GC_VALIDATION)
, m_initializingObjectClass(0)
#endif
, m_inDefineOwnProperty(false)
, m_codeCache(CodeCache::create())
{
interpreter = new Interpreter(*this);
// Need to be careful to keep everything consistent here
JSLockHolder lock(this);
IdentifierTable* existingEntryIdentifierTable = wtfThreadData().setCurrentIdentifierTable(identifierTable);
structureStructure.set(*this, Structure::createStructure(*this));
structureRareDataStructure.set(*this, StructureRareData::createStructure(*this, 0, jsNull()));
debuggerActivationStructure.set(*this, DebuggerActivation::createStructure(*this, 0, jsNull()));
terminatedExecutionErrorStructure.set(*this, TerminatedExecutionError::createStructure(*this, 0, jsNull()));
stringStructure.set(*this, JSString::createStructure(*this, 0, jsNull()));
notAnObjectStructure.set(*this, JSNotAnObject::createStructure(*this, 0, jsNull()));
propertyNameIteratorStructure.set(*this, JSPropertyNameIterator::createStructure(*this, 0, jsNull()));
getterSetterStructure.set(*this, GetterSetter::createStructure(*this, 0, jsNull()));
apiWrapperStructure.set(*this, JSAPIValueWrapper::createStructure(*this, 0, jsNull()));
JSScopeStructure.set(*this, JSScope::createStructure(*this, 0, jsNull()));
executableStructure.set(*this, ExecutableBase::createStructure(*this, 0, jsNull()));
nativeExecutableStructure.set(*this, NativeExecutable::createStructure(*this, 0, jsNull()));
evalExecutableStructure.set(*this, EvalExecutable::createStructure(*this, 0, jsNull()));
programExecutableStructure.set(*this, ProgramExecutable::createStructure(*this, 0, jsNull()));
functionExecutableStructure.set(*this, FunctionExecutable::createStructure(*this, 0, jsNull()));
regExpStructure.set(*this, RegExp::createStructure(*this, 0, jsNull()));
sharedSymbolTableStructure.set(*this, SharedSymbolTable::createStructure(*this, 0, jsNull()));
structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull()));
sparseArrayValueMapStructure.set(*this, SparseArrayValueMap::createStructure(*this, 0, jsNull()));
withScopeStructure.set(*this, JSWithScope::createStructure(*this, 0, jsNull()));
unlinkedFunctionExecutableStructure.set(*this, UnlinkedFunctionExecutable::createStructure(*this, 0, jsNull()));
unlinkedProgramCodeBlockStructure.set(*this, UnlinkedProgramCodeBlock::createStructure(*this, 0, jsNull()));
unlinkedEvalCodeBlockStructure.set(*this, UnlinkedEvalCodeBlock::createStructure(*this, 0, jsNull()));
unlinkedFunctionCodeBlockStructure.set(*this, UnlinkedFunctionCodeBlock::createStructure(*this, 0, jsNull()));
propertyTableStructure.set(*this, PropertyTable::createStructure(*this, 0, jsNull()));
smallStrings.initializeCommonStrings(*this);
wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable);
#if ENABLE(JIT)
jitStubs = adoptPtr(new JITThunks());
performPlatformSpecificJITAssertions(this);
#endif
interpreter->initialize(this->canUseJIT());
#if ENABLE(JIT)
initializeHostCallReturnValue(); // This is needed to convince the linker not to drop host call return support.
#endif
heap.notifyIsSafeToCollect();
LLInt::Data::performAssertions(*this);
if (Options::enableProfiler()) {
m_perBytecodeProfiler = adoptPtr(new Profiler::Database(*this));
StringPrintStream pathOut;
#if !OS(WINCE)
const char* profilerPath = getenv("JSC_PROFILER_PATH");
if (profilerPath)
pathOut.print(profilerPath, "/");
#endif
pathOut.print("JSCProfile-", getCurrentProcessID(), "-", m_perBytecodeProfiler->databaseID(), ".json");
m_perBytecodeProfiler->registerToSaveAtExit(pathOut.toCString().data());
}
#if ENABLE(DFG_JIT)
if (canUseJIT())
m_dfgState = adoptPtr(new DFG::LongLivedState());
#endif
}
示例14: append
void Disassembler::append(Vector<Disassembler::DumpedOp>& result, StringPrintStream& out, CodeOrigin& previousOrigin)
{
result.append(DumpedOp(previousOrigin, out.toCString()));
previousOrigin = CodeOrigin();
out.reset();
}
示例15: m_apiLock
//.........这里部分代码省略.........
symbolStructure.set(*this, Symbol::createStructure(*this, 0, jsNull()));
symbolTableStructure.set(*this, SymbolTable::createStructure(*this, 0, jsNull()));
structureChainStructure.set(*this, StructureChain::createStructure(*this, 0, jsNull()));
sparseArrayValueMapStructure.set(*this, SparseArrayValueMap::createStructure(*this, 0, jsNull()));
templateRegistryKeyStructure.set(*this, JSTemplateRegistryKey::createStructure(*this, 0, jsNull()));
arrayBufferNeuteringWatchpointStructure.set(*this, ArrayBufferNeuteringWatchpoint::createStructure(*this));
unlinkedFunctionExecutableStructure.set(*this, UnlinkedFunctionExecutable::createStructure(*this, 0, jsNull()));
unlinkedProgramCodeBlockStructure.set(*this, UnlinkedProgramCodeBlock::createStructure(*this, 0, jsNull()));
unlinkedEvalCodeBlockStructure.set(*this, UnlinkedEvalCodeBlock::createStructure(*this, 0, jsNull()));
unlinkedFunctionCodeBlockStructure.set(*this, UnlinkedFunctionCodeBlock::createStructure(*this, 0, jsNull()));
unlinkedModuleProgramCodeBlockStructure.set(*this, UnlinkedModuleProgramCodeBlock::createStructure(*this, 0, jsNull()));
propertyTableStructure.set(*this, PropertyTable::createStructure(*this, 0, jsNull()));
weakMapDataStructure.set(*this, WeakMapData::createStructure(*this, 0, jsNull()));
inferredValueStructure.set(*this, InferredValue::createStructure(*this, 0, jsNull()));
inferredTypeStructure.set(*this, InferredType::createStructure(*this, 0, jsNull()));
inferredTypeTableStructure.set(*this, InferredTypeTable::createStructure(*this, 0, jsNull()));
functionRareDataStructure.set(*this, FunctionRareData::createStructure(*this, 0, jsNull()));
generatorFrameStructure.set(*this, GeneratorFrame::createStructure(*this, 0, jsNull()));
exceptionStructure.set(*this, Exception::createStructure(*this, 0, jsNull()));
promiseDeferredStructure.set(*this, JSPromiseDeferred::createStructure(*this, 0, jsNull()));
internalPromiseDeferredStructure.set(*this, JSInternalPromiseDeferred::createStructure(*this, 0, jsNull()));
programCodeBlockStructure.set(*this, ProgramCodeBlock::createStructure(*this, 0, jsNull()));
moduleProgramCodeBlockStructure.set(*this, ModuleProgramCodeBlock::createStructure(*this, 0, jsNull()));
evalCodeBlockStructure.set(*this, EvalCodeBlock::createStructure(*this, 0, jsNull()));
functionCodeBlockStructure.set(*this, FunctionCodeBlock::createStructure(*this, 0, jsNull()));
#if ENABLE(WEBASSEMBLY)
webAssemblyCodeBlockStructure.set(*this, WebAssemblyCodeBlock::createStructure(*this, 0, jsNull()));
#endif
iterationTerminator.set(*this, JSFinalObject::create(*this, JSFinalObject::createStructure(*this, 0, jsNull(), 1)));
nativeStdFunctionCellStructure.set(*this, NativeStdFunctionCell::createStructure(*this, 0, jsNull()));
smallStrings.initializeCommonStrings(*this);
wtfThreadData().setCurrentAtomicStringTable(existingEntryAtomicStringTable);
#if ENABLE(JIT)
jitStubs = std::make_unique<JITThunks>();
allCalleeSaveRegisterOffsets = std::make_unique<RegisterAtOffsetList>(RegisterSet::vmCalleeSaveRegisters(), RegisterAtOffsetList::ZeroBased);
#endif
arityCheckData = std::make_unique<CommonSlowPaths::ArityCheckData>();
#if ENABLE(FTL_JIT)
ftlThunks = std::make_unique<FTL::Thunks>();
#endif // ENABLE(FTL_JIT)
interpreter->initialize();
#if ENABLE(JIT)
initializeHostCallReturnValue(); // This is needed to convince the linker not to drop host call return support.
#endif
heap.notifyIsSafeToCollect();
LLInt::Data::performAssertions(*this);
if (Options::useProfiler()) {
m_perBytecodeProfiler = std::make_unique<Profiler::Database>(*this);
StringPrintStream pathOut;
const char* profilerPath = getenv("JSC_PROFILER_PATH");
if (profilerPath)
pathOut.print(profilerPath, "/");
pathOut.print("JSCProfile-", getCurrentProcessID(), "-", m_perBytecodeProfiler->databaseID(), ".json");
m_perBytecodeProfiler->registerToSaveAtExit(pathOut.toCString().data());
}
callFrameForCatch = nullptr;
#if ENABLE(DFG_JIT)
if (canUseJIT())
dfgState = std::make_unique<DFG::LongLivedState>();
#endif
// Initialize this last, as a free way of asserting that VM initialization itself
// won't use this.
m_typedArrayController = adoptRef(new SimpleTypedArrayController());
m_bytecodeIntrinsicRegistry = std::make_unique<BytecodeIntrinsicRegistry>(*this);
if (Options::useTypeProfiler())
enableTypeProfiler();
if (Options::useControlFlowProfiler())
enableControlFlowProfiler();
#if ENABLE(SAMPLING_PROFILER)
if (Options::useSamplingProfiler()) {
setShouldBuildPCToCodeOriginMapping();
m_samplingProfiler = adoptRef(new SamplingProfiler(*this, Stopwatch::create()));
m_samplingProfiler->start();
}
#endif // ENABLE(SAMPLING_PROFILER)
if (Options::alwaysGeneratePCToCodeOriginMap())
setShouldBuildPCToCodeOriginMapping();
if (Options::watchdog()) {
std::chrono::milliseconds timeoutMillis(Options::watchdog());
Watchdog& watchdog = ensureWatchdog();
watchdog.setTimeLimit(timeoutMillis);
}
}