forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtomicsObject.h
More file actions
50 lines (46 loc) · 2.49 KB
/
Copy pathAtomicsObject.h
File metadata and controls
50 lines (46 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// Implements Atomics according to http://tc39.github.io/ecmascript_sharedmem/shmem.html
//----------------------------------------------------------------------------
#pragma once
namespace Js
{
class AtomicsObject
{
public:
class EntryInfo
{
public:
static FunctionInfo Add;
static FunctionInfo And;
static FunctionInfo CompareExchange;
static FunctionInfo Exchange;
static FunctionInfo IsLockFree;
static FunctionInfo Load;
static FunctionInfo Or;
static FunctionInfo Store;
static FunctionInfo Sub;
static FunctionInfo Wait;
static FunctionInfo Notify;
static FunctionInfo Xor;
};
static Var EntryAdd(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryAnd(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryCompareExchange(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryExchange(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryIsLockFree(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryLoad(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryOr(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryStore(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntrySub(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryWait(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryNotify(RecyclableObject* function, CallInfo callInfo, ...);
static Var EntryXor(RecyclableObject* function, CallInfo callInfo, ...);
private:
static Var ValidateSharedIntegerTypedArray(Var typedArray, ScriptContext *scriptContext, bool onlyInt32);
static uint32 ValidateAtomicAccess(Var typedArray, Var index, ScriptContext *scriptContext);
static TypedArrayBase * ValidateAndGetTypedArray(Var typedArray, Var index, __out uint32 *accessIndex, ScriptContext *scriptContext, bool onlyInt32 = false);
};
}