michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef jit_ParallelSafetyAnalysis_h michael@0: #define jit_ParallelSafetyAnalysis_h michael@0: michael@0: #include "jit/MIR.h" michael@0: michael@0: namespace js { michael@0: michael@0: class InterpreterFrame; michael@0: michael@0: namespace jit { michael@0: michael@0: class MIRGraph; michael@0: class AutoDestroyAllocator; michael@0: michael@0: // Determines whether a function is compatible for parallel execution. michael@0: // Removes basic blocks containing unsafe MIR operations from the michael@0: // graph and replaces them with MAbortPar blocks. michael@0: class ParallelSafetyAnalysis michael@0: { michael@0: MIRGenerator *mir_; michael@0: MIRGraph &graph_; michael@0: michael@0: bool removeResumePointOperands(); michael@0: void replaceOperandsOnResumePoint(MResumePoint *resumePoint, MDefinition *withDef); michael@0: michael@0: public: michael@0: ParallelSafetyAnalysis(MIRGenerator *mir, michael@0: MIRGraph &graph) michael@0: : mir_(mir), michael@0: graph_(graph) michael@0: {} michael@0: michael@0: bool analyze(); michael@0: }; michael@0: michael@0: // Code to collect list of possible call targets by scraping through michael@0: // TI and baseline data. Used to permit speculative transitive michael@0: // compilation in vm/ForkJoin. michael@0: // michael@0: // This code may clone scripts and thus may invoke the GC. Hence only michael@0: // run from the link phase, which executes on the main thread. michael@0: typedef Vector CallTargetVector; michael@0: bool AddPossibleCallees(JSContext *cx, MIRGraph &graph, CallTargetVector &targets); michael@0: michael@0: } // namespace jit michael@0: } // namespace js michael@0: michael@0: #endif /* jit_ParallelSafetyAnalysis_h */