Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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 #ifndef jit_ParallelSafetyAnalysis_h
8 #define jit_ParallelSafetyAnalysis_h
10 #include "jit/MIR.h"
12 namespace js {
14 class InterpreterFrame;
16 namespace jit {
18 class MIRGraph;
19 class AutoDestroyAllocator;
21 // Determines whether a function is compatible for parallel execution.
22 // Removes basic blocks containing unsafe MIR operations from the
23 // graph and replaces them with MAbortPar blocks.
24 class ParallelSafetyAnalysis
25 {
26 MIRGenerator *mir_;
27 MIRGraph &graph_;
29 bool removeResumePointOperands();
30 void replaceOperandsOnResumePoint(MResumePoint *resumePoint, MDefinition *withDef);
32 public:
33 ParallelSafetyAnalysis(MIRGenerator *mir,
34 MIRGraph &graph)
35 : mir_(mir),
36 graph_(graph)
37 {}
39 bool analyze();
40 };
42 // Code to collect list of possible call targets by scraping through
43 // TI and baseline data. Used to permit speculative transitive
44 // compilation in vm/ForkJoin.
45 //
46 // This code may clone scripts and thus may invoke the GC. Hence only
47 // run from the link phase, which executes on the main thread.
48 typedef Vector<JSScript *, 4, IonAllocPolicy> CallTargetVector;
49 bool AddPossibleCallees(JSContext *cx, MIRGraph &graph, CallTargetVector &targets);
51 } // namespace jit
52 } // namespace js
54 #endif /* jit_ParallelSafetyAnalysis_h */