
No functional changes - we can still very easily get to the global object via `Realm::global_object()`. This is in preparation of moving the intrinsics to the realm and no longer having to pass a global object when allocating any object. In a few (now, and many more in subsequent commits) places we get a realm using `GlobalObject::associated_realm()`, this is intended to be temporary. For example, create() functions will later receive the same treatment and are passed a realm instead of a global object.
34 lines
818 B
C++
34 lines
818 B
C++
/*
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Runtime/Object.h>
|
|
|
|
namespace JS {
|
|
|
|
class AtomicsObject : public Object {
|
|
JS_OBJECT(AtomicsObject, Object);
|
|
|
|
public:
|
|
explicit AtomicsObject(Realm&);
|
|
virtual void initialize(GlobalObject&) override;
|
|
virtual ~AtomicsObject() override = default;
|
|
|
|
private:
|
|
JS_DECLARE_NATIVE_FUNCTION(add);
|
|
JS_DECLARE_NATIVE_FUNCTION(and_);
|
|
JS_DECLARE_NATIVE_FUNCTION(compare_exchange);
|
|
JS_DECLARE_NATIVE_FUNCTION(exchange);
|
|
JS_DECLARE_NATIVE_FUNCTION(is_lock_free);
|
|
JS_DECLARE_NATIVE_FUNCTION(load);
|
|
JS_DECLARE_NATIVE_FUNCTION(or_);
|
|
JS_DECLARE_NATIVE_FUNCTION(store);
|
|
JS_DECLARE_NATIVE_FUNCTION(sub);
|
|
JS_DECLARE_NATIVE_FUNCTION(xor_);
|
|
};
|
|
|
|
}
|