js/src/jit/ParallelFunctions.h

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.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 * vim: set ts=8 sts=4 et sw=4 tw=99:
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef jit_ParallelFunctions_h
michael@0 8 #define jit_ParallelFunctions_h
michael@0 9
michael@0 10 #include "gc/Heap.h"
michael@0 11 #include "vm/ForkJoin.h"
michael@0 12
michael@0 13 namespace js {
michael@0 14
michael@0 15 class TypedObject; // subclass of JSObject* defined in builtin/TypedObject.h
michael@0 16
michael@0 17 namespace jit {
michael@0 18
michael@0 19 ForkJoinContext *ForkJoinContextPar();
michael@0 20 JSObject *NewGCThingPar(ForkJoinContext *cx, gc::AllocKind allocKind);
michael@0 21 bool ParallelWriteGuard(ForkJoinContext *cx, JSObject *object);
michael@0 22 bool IsInTargetRegion(ForkJoinContext *cx, TypedObject *object);
michael@0 23 bool CheckOverRecursedPar(ForkJoinContext *cx);
michael@0 24 bool InterruptCheckPar(ForkJoinContext *cx);
michael@0 25
michael@0 26 // Extends the given array with `length` new holes. Returns nullptr on
michael@0 27 // failure or else `array`, which is convenient during code
michael@0 28 // generation.
michael@0 29 JSObject *ExtendArrayPar(ForkJoinContext *cx, JSObject *array, uint32_t length);
michael@0 30
michael@0 31 // Set properties and elements on thread local objects.
michael@0 32 bool SetPropertyPar(ForkJoinContext *cx, HandleObject obj, HandlePropertyName name,
michael@0 33 HandleValue value, bool strict, jsbytecode *pc);
michael@0 34 bool SetElementPar(ForkJoinContext *cx, HandleObject obj, HandleValue index,
michael@0 35 HandleValue value, bool strict);
michael@0 36 bool SetDenseElementPar(ForkJoinContext *cx, HandleObject obj, int32_t index,
michael@0 37 HandleValue value, bool strict);
michael@0 38
michael@0 39 // String related parallel functions. These tend to call existing VM functions
michael@0 40 // that take a ThreadSafeContext.
michael@0 41 JSString *ConcatStringsPar(ForkJoinContext *cx, HandleString left, HandleString right);
michael@0 42 JSFlatString *IntToStringPar(ForkJoinContext *cx, int i);
michael@0 43 JSString *DoubleToStringPar(ForkJoinContext *cx, double d);
michael@0 44 JSString *PrimitiveToStringPar(ForkJoinContext *cx, HandleValue input);
michael@0 45 bool StringToNumberPar(ForkJoinContext *cx, JSString *str, double *out);
michael@0 46
michael@0 47 // Binary and unary operator functions on values. These tend to return
michael@0 48 // RETRY_SEQUENTIALLY if the values are objects.
michael@0 49 bool StrictlyEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 50 bool StrictlyUnequalPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 51 bool LooselyEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 52 bool LooselyUnequalPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 53 bool LessThanPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 54 bool LessThanOrEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 55 bool GreaterThanPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 56 bool GreaterThanOrEqualPar(ForkJoinContext *cx, MutableHandleValue v1, MutableHandleValue v2, bool *);
michael@0 57
michael@0 58 bool StringsEqualPar(ForkJoinContext *cx, HandleString v1, HandleString v2, bool *);
michael@0 59 bool StringsUnequalPar(ForkJoinContext *cx, HandleString v1, HandleString v2, bool *);
michael@0 60
michael@0 61 bool BitNotPar(ForkJoinContext *cx, HandleValue in, int32_t *out);
michael@0 62 bool BitXorPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
michael@0 63 bool BitOrPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
michael@0 64 bool BitAndPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
michael@0 65 bool BitLshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
michael@0 66 bool BitRshPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, int32_t *out);
michael@0 67
michael@0 68 bool UrshValuesPar(ForkJoinContext *cx, HandleValue lhs, HandleValue rhs, MutableHandleValue out);
michael@0 69
michael@0 70 // Make a new rest parameter in parallel.
michael@0 71 JSObject *InitRestParameterPar(ForkJoinContext *cx, uint32_t length, Value *rest,
michael@0 72 HandleObject templateObj, HandleObject res);
michael@0 73
michael@0 74 // Abort and debug tracing functions.
michael@0 75 void AbortPar(ParallelBailoutCause cause, JSScript *outermostScript, JSScript *currentScript,
michael@0 76 jsbytecode *bytecode);
michael@0 77 void PropagateAbortPar(JSScript *outermostScript, JSScript *currentScript);
michael@0 78
michael@0 79 void TraceLIR(IonLIRTraceData *current);
michael@0 80
michael@0 81 void CallToUncompiledScriptPar(JSObject *obj);
michael@0 82
michael@0 83 } // namespace jit
michael@0 84 } // namespace js
michael@0 85
michael@0 86 #endif /* jit_ParallelFunctions_h */

mercurial