当前位置: 首页>>代码示例>>C++>>正文


C++ StringPrintStream::toCString方法代码示例

本文整理汇总了C++中StringPrintStream::toCString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringPrintStream::toCString方法的具体用法?C++ StringPrintStream::toCString怎么用?C++ StringPrintStream::toCString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringPrintStream的用法示例。


在下文中一共展示了StringPrintStream::toCString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:32,代码来源:JITDisassembler.cpp

示例2: fire

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);
}
开发者ID:EQ4,项目名称:webkit-mips,代码行数:28,代码来源:DFGAdaptiveInferredPropertyValueWatchpoint.cpp

示例3: disassembly

CString MacroAssemblerCodeRef::disassembly() const
{
    StringPrintStream out;
    if (!tryToDisassemble(out, ""))
        return CString();
    return out.toCString();
}
开发者ID:mjparme,项目名称:openjdk-jfx,代码行数:7,代码来源:MacroAssemblerCodeRef.cpp

示例4: finalizeCodeWithDisassembly

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;
}
开发者ID:rodrigo-speller,项目名称:webkit,代码行数:29,代码来源:LinkBuffer.cpp

示例5: 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));
    }
}
开发者ID:ollie314,项目名称:webkit,代码行数:26,代码来源:ProfilerBytecodeSequence.cpp

示例6: deepDump

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(")");
}
开发者ID:happyyang,项目名称:webkit,代码行数:28,代码来源:B3Value.cpp

示例7: briefDescription

CString ArrayProfile::briefDescription(CodeBlock* codeBlock)
{
    computeUpdatedPrediction(codeBlock);
    
    StringPrintStream out;
    
    bool hasPrinted = false;
    
    if (m_observedArrayModes) {
        if (hasPrinted)
            out.print(", ");
        out.print(ArrayModesDump(m_observedArrayModes));
        hasPrinted = true;
    }
    
    if (structureIsPolymorphic()) {
        if (hasPrinted)
            out.print(", ");
        out.print("struct = TOP");
        hasPrinted = true;
    } else if (m_expectedStructure) {
        if (hasPrinted)
            out.print(", ");
        out.print("struct = ", RawPointer(m_expectedStructure));
        hasPrinted = true;
    }
    
    if (m_mayStoreToHole) {
        if (hasPrinted)
            out.print(", ");
        out.print("Hole");
        hasPrinted = true;
    }
    
    if (m_outOfBounds) {
        if (hasPrinted)
            out.print(", ");
        out.print("OutOfBounds");
        hasPrinted = true;
    }
    
    if (m_mayInterceptIndexedAccesses) {
        if (hasPrinted)
            out.print(", ");
        out.print("Intercept");
        hasPrinted = true;
    }
    
    if (m_usesOriginalArrayStructures) {
        if (hasPrinted)
            out.print(", ");
        out.print("Original");
        hasPrinted = true;
    }
    
    UNUSED_PARAM(hasPrinted);
    
    return out.toCString();
}
开发者ID:Anthony-Biget,项目名称:openjfx,代码行数:59,代码来源:ArrayProfile.cpp

示例8: handleFire

void ObjectToStringAdaptiveInferredPropertyValueWatchpoint::handleFire(const FireDetail& detail)
{
    StringPrintStream out;
    out.print("Adaptation of ", key(), " failed: ", detail);
    
    StringFireDetail stringDetail(out.toCString().data());
    
    m_structureRareData->clearObjectToStringValue();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:9,代码来源:StructureRareData.cpp

示例9: 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()));
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:18,代码来源:JITDisassembler.cpp

示例10: fireInternal

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();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:14,代码来源:StructureRareData.cpp

示例11: 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();
}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:15,代码来源:DFGPhase.cpp

示例12: 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();
}
开发者ID:mjparme,项目名称:openjdk-jfx,代码行数:16,代码来源:ExceptionScope.cpp

示例13: briefDescriptionWithoutUpdating

CString ArrayProfile::briefDescriptionWithoutUpdating(const ConcurrentJITLocker&)
{
    StringPrintStream out;
    
    bool hasPrinted = false;
    
    if (m_observedArrayModes) {
        if (hasPrinted)
            out.print(", ");
        out.print(ArrayModesDump(m_observedArrayModes));
        hasPrinted = true;
    }
    
    if (m_mayStoreToHole) {
        if (hasPrinted)
            out.print(", ");
        out.print("Hole");
        hasPrinted = true;
    }
    
    if (m_outOfBounds) {
        if (hasPrinted)
            out.print(", ");
        out.print("OutOfBounds");
        hasPrinted = true;
    }
    
    if (m_mayInterceptIndexedAccesses) {
        if (hasPrinted)
            out.print(", ");
        out.print("Intercept");
        hasPrinted = true;
    }
    
    if (m_usesOriginalArrayStructures) {
        if (hasPrinted)
            out.print(", ");
        out.print("Original");
        hasPrinted = true;
    }
    
    UNUSED_PARAM(hasPrinted);
    
    return out.toCString();
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:45,代码来源:ArrayProfile.cpp

示例14: fireInternal

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);
}
开发者ID:LuXiong,项目名称:webkit,代码行数:20,代码来源:DFGAdaptiveStructureWatchpoint.cpp

示例15: dumpSpeculation


//.........这里部分代码省略.........
                myOut.print("Uint8clampedarray");
            else
                isTop = false;
    
            if (value & SpecUint16Array)
                myOut.print("Uint16array");
            else
                isTop = false;
    
            if (value & SpecUint32Array)
                myOut.print("Uint32array");
            else
                isTop = false;
    
            if (value & SpecFloat32Array)
                myOut.print("Float32array");
            else
                isTop = false;
    
            if (value & SpecFloat64Array)
                myOut.print("Float64array");
            else
                isTop = false;
    
            if (value & SpecFunction)
                myOut.print("Function");
            else
                isTop = false;
    
            if (value & SpecArguments)
                myOut.print("Arguments");
            else
                isTop = false;
    
            if (value & SpecStringObject)
                myOut.print("Stringobject");
            else
                isTop = false;
        }

        if ((value & SpecString) == SpecString)
            myOut.print("String");
        else {
            if (value & SpecStringIdent)
                myOut.print("Stringident");
            else
                isTop = false;
            
            if (value & SpecStringVar)
                myOut.print("Stringvar");
            else
                isTop = false;
        }
    }
    
    if (value & SpecInt32)
        myOut.print("Int32");
    else
        isTop = false;
    
    if (value & SpecInt52)
        myOut.print("Int52");
        
    if ((value & SpecDouble) == SpecDouble)
        myOut.print("Double");
    else {
        if (value & SpecInt52AsDouble)
            myOut.print("Int52asdouble");
        else
            isTop = false;
        
        if (value & SpecNonIntAsDouble)
            myOut.print("Nonintasdouble");
        else
            isTop = false;
        
        if (value & SpecDoubleNaN)
            myOut.print("Doublenan");
        else
            isTop = false;
    }
    
    if (value & SpecBoolean)
        myOut.print("Bool");
    else
        isTop = false;
    
    if (value & SpecOther)
        myOut.print("Other");
    else
        isTop = false;
    
    if (isTop)
        out.print("Top");
    else
        out.print(myOut.toCString());
    
    if (value & SpecEmpty)
        out.print("Empty");
}
开发者ID:boska,项目名称:webkit,代码行数:101,代码来源:SpeculatedType.cpp


注:本文中的StringPrintStream::toCString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。