js/src/jit/EdgeCaseAnalysis.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  * vim: set ts=8 sts=4 et sw=4 tw=99:
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #include "jit/EdgeCaseAnalysis.h"
     9 #include "jit/MIR.h"
    10 #include "jit/MIRGraph.h"
    12 using namespace js;
    13 using namespace js::jit;
    15 EdgeCaseAnalysis::EdgeCaseAnalysis(MIRGenerator *mir, MIRGraph &graph)
    16   : mir(mir), graph(graph)
    17 {
    18 }
    20 bool
    21 EdgeCaseAnalysis::analyzeLate()
    22 {
    23     // Renumber definitions for NeedNegativeZeroCheck under analyzeEdgeCasesBackward.
    24     uint32_t nextId = 1;
    26     for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); block++) {
    27         if (mir->shouldCancel("Analyze Late (first loop)"))
    28             return false;
    29         for (MDefinitionIterator iter(*block); iter; iter++) {
    30             iter->setId(nextId++);
    31             iter->analyzeEdgeCasesForward();
    32         }
    33         block->lastIns()->setId(nextId++);
    34     }
    36     for (PostorderIterator block(graph.poBegin()); block != graph.poEnd(); block++) {
    37         if (mir->shouldCancel("Analyze Late (second loop)"))
    38             return false;
    39         for (MInstructionReverseIterator riter(block->rbegin()); riter != block->rend(); riter++)
    40             riter->analyzeEdgeCasesBackward();
    41     }
    43     return true;
    44 }

mercurial