This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Ticket #3708: Bug_1280648_Mod.diff

File Bug_1280648_Mod.diff, 2.6 KB (added by Yves, 8 years ago)
  • js/src/vm/TraceLogging.cpp

    # HG changeset patch
    # User Hannes Verschore <hv1989@gmail.com>
    # Date 1466509931 -7200
    # Node ID 7a942a2707771886d8fd76a5dfe07adb0d7f5667
    # Parent  01bfa6d7d56176ac9adda98040b7a66b38dfebef
    Bug 1280648 - Tracelogger: Don't cache based on pointers to movable gc things, r=bbouvier
    
    diff --git a/js/src/vm/TraceLogging.cpp b/js/src/vm/TraceLogging.cpp
    a b TraceLoggerThread::getOrCreateEventPaylo  
    402402        filename = "<unknown>";
    403403
    404404    // Only log scripts when enabled otherwise return the global Scripts textId,
    405405    // which will get filtered out.
    406406    MOZ_ASSERT(traceLoggerState);
    407407    if (!traceLoggerState->isTextIdEnabled(type))
    408408        return getOrCreateEventPayload(type);
    409409
    410     PointerHashMap::AddPtr p = pointerMap.lookupForAdd(ptr);
    411     if (p) {
    412         MOZ_ASSERT(p->value()->textId() < nextTextId); // Sanity check.
    413         return p->value();
     410    PointerHashMap::AddPtr p;
     411    if (ptr) {
     412        p = pointerMap.lookupForAdd(ptr);
     413        if (p) {
     414            MOZ_ASSERT(p->value()->textId() < nextTextId); // Sanity check.
     415            return p->value();
     416        }
    414417    }
    415418
    416419    // Compute the length of the string to create.
    417420    size_t lenFilename = strlen(filename);
    418421    size_t lenLineno = 1;
    419422    for (size_t i = lineno; i /= 10; lenLineno++);
    420423    size_t lenColno = 1;
    421424    for (size_t i = colno; i /= 10; lenColno++);
    TraceLoggerThread::getOrCreateEventPaylo  
    444447        return nullptr;
    445448    }
    446449
    447450    if (graph.get())
    448451        graph->addTextId(textId, str);
    449452
    450453    nextTextId++;
    451454
    452     if (!pointerMap.add(p, ptr, payload))
    453         return nullptr;
     455    if (ptr) {
     456        if (!pointerMap.add(p, ptr, payload))
     457            return nullptr;
     458    }
    454459
    455460    return payload;
    456461}
    457462
    458463TraceLoggerEventPayload*
    459464TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type, JSScript* script)
    460465{
    461466    return getOrCreateEventPayload(type, script->filename(), script->lineno(), script->column(),
    462                                    script);
     467                                   nullptr);
    463468}
    464469
    465470TraceLoggerEventPayload*
    466471TraceLoggerThread::getOrCreateEventPayload(TraceLoggerTextId type,
    467472                                           const JS::ReadOnlyCompileOptions& script)
    468473{
    469     return getOrCreateEventPayload(type, script.filename(), script.lineno, script.column, &script);
     474    return getOrCreateEventPayload(type, script.filename(), script.lineno, script.column, nullptr);
    470475}
    471476
    472477void
    473478TraceLoggerThread::startEvent(TraceLoggerTextId id) {
    474479    startEvent(uint32_t(id));
    475480}
    476481
    477482void