js/src/jit/ParallelFunctions.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

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_ParallelFunctions_h
     8 #define jit_ParallelFunctions_h
    10 #include "gc/Heap.h"
    11 #include "vm/ForkJoin.h"
    13 namespace js {
    15 class TypedObject; // subclass of JSObject* defined in builtin/TypedObject.h
    17 namespace jit {
    19 ForkJoinContext *ForkJoinContextPar();
    20 JSObject *NewGCThingPar(ForkJoinContext *cx, gc::AllocKind allocKind);
    21 bool ParallelWriteGuard(ForkJoinContext *cx, JSObject *object);
    22 bool IsInTargetRegion(ForkJoinContext *cx, TypedObject *object);
    23 bool CheckOverRecursedPar(ForkJoinContext *cx);
    24 bool InterruptCheckPar(ForkJoinContext *cx);
    26 // Extends the given array with `length` new holes.  Returns nullptr on
    27 // failure or else `array`, which is convenient during code
    28 // generation.
    29 JSObject *ExtendArrayPar(ForkJoinContext *cx, JSObject *array, uint32_t length);
    31 // Set properties and elements on thread local objects.
    32 bool SetPropertyPar(ForkJoinContext *cx, HandleObject obj, HandlePropertyName name,
    33                     HandleValue value, bool strict, jsbytecode *pc);
    34 bool SetElementPar(ForkJoinContext *cx, HandleObject obj, HandleValue index,
    35                    HandleValue value, bool strict);
    36 bool SetDenseElementPar(ForkJoinContext *cx, HandleObject obj, int32_t index,
    37                         HandleValue value, bool strict);
    39 // String related parallel functions. These tend to call existing VM functions
    40 // that take a ThreadSafeContext.
    41 JSString *ConcatStringsPar(ForkJoinContext *cx, HandleString left, HandleString right);
    42 JSFlatString *IntToStringPar(ForkJoinContext *cx, int i);
    43 JSString *DoubleToStringPar(ForkJoinContext *cx, double d);
    44 JSString *PrimitiveToStringPar(ForkJoinContext *cx, HandleValue input);
    45 bool StringToNumberPar(ForkJoinContext *cx, JSString *str, double *out);
    47 // Binary and unary operator functions on values. These tend to return
    48 // RETRY_SEQUENTIALLY if the values are objects.
    49 bool StrictlyEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    50 bool StrictlyUnequalPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    51 bool LooselyEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    52 bool LooselyUnequalPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    53 bool LessThanPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    54 bool LessThanOrEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    55 bool GreaterThanPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    56 bool GreaterThanOrEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
    58 bool StringsEqualPar(ForkJoinContext *cx, HandleString v1, HandleString v2, bool *);
    59 bool StringsUnequalPar(ForkJoinContext *cx, HandleString v1, HandleString v2, bool *);
    61 bool BitNotPar(ForkJoinContext *cx, HandleValue in, int32_t *out);
    62 bool BitXorPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
    63 bool BitOrPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
    64 bool BitAndPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
    65 bool BitLshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
    66 bool BitRshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
    68 bool UrshValuesPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue out);
    70 // Make a new rest parameter in parallel.
    71 JSObject *InitRestParameterPar(ForkJoinContext *cx, uint32_t length, Value *rest,
    72                                HandleObject templateObj, HandleObject res);
    74 // Abort and debug tracing functions.
    75 void AbortPar(ParallelBailoutCause cause, JSScript *outermostScript, JSScript *currentScript,
    76               jsbytecode *bytecode);
    77 void PropagateAbortPar(JSScript *outermostScript, JSScript *currentScript);
    79 void TraceLIR(IonLIRTraceData *current);
    81 void CallToUncompiledScriptPar(JSObject *obj);
    83 } // namespace jit
    84 } // namespace js
    86 #endif /* jit_ParallelFunctions_h */

mercurial