Bug 1292190 - Baldr: fix include dependencies (r=bbouvier)

MozReview-Commit-ID: BAte5sedqaS

--HG--
extra : rebase_source : 182416a9af4551fd2caca589f2e154be1ec288fc
This commit is contained in:
Luke Wagner 2016-08-04 11:27:24 -05:00
parent 3896afd101
commit b9fee3a322
7 changed files with 51 additions and 45 deletions

View File

@ -66,7 +66,7 @@ class Instance
public:
Instance(JSContext* cx,
Handle<WasmInstanceObject*> object,
HandleWasmInstanceObject object,
UniqueCode code,
HandleWasmMemoryObject memory,
SharedTableVector&& tables,

View File

@ -19,25 +19,16 @@
#ifndef wasm_js_h
#define wasm_js_h
#include "asmjs/WasmTypes.h"
#include "gc/Policy.h"
#include "js/UniquePtr.h"
#include "vm/NativeObject.h"
namespace js {
class TypedArrayObject;
class WasmInstanceObject;
namespace wasm {
// This is a widespread header, so keep out core wasm impl definitions.
class Module;
class Instance;
class Table;
typedef UniquePtr<Instance> UniqueInstance;
// Return whether WebAssembly can be compiled on this platform.
// This must be checked and must be true to call any of the top-level wasm
// eval/compile methods.
@ -54,7 +45,7 @@ IsI64Implemented();
MOZ_MUST_USE bool
Eval(JSContext* cx, Handle<TypedArrayObject*> code, HandleObject importObj,
MutableHandle<WasmInstanceObject*> instanceObj);
MutableHandleWasmInstanceObject instanceObj);
// The field name of the export object on the instance object.
@ -117,10 +108,6 @@ class WasmModuleObject : public NativeObject
wasm::Module& module() const;
};
typedef Rooted<WasmModuleObject*> RootedWasmModuleObject;
typedef Handle<WasmModuleObject*> HandleWasmModuleObject;
typedef MutableHandle<WasmModuleObject*> MutableHandleWasmModuleObject;
// The class of WebAssembly.Instance. Each WasmInstanceObject owns a
// wasm::Instance. These objects are used both as content-facing JS objects and
// as internal implementation details of asm.js.
@ -152,20 +139,15 @@ class WasmInstanceObject : public NativeObject
static bool construct(JSContext*, unsigned, Value*);
static WasmInstanceObject* create(JSContext* cx, HandleObject proto);
void init(wasm::UniqueInstance instance);
void init(UniquePtr<wasm::Instance> instance);
wasm::Instance& instance() const;
static bool getExportedFunction(JSContext* cx,
Handle<WasmInstanceObject*> instanceObj,
HandleWasmInstanceObject instanceObj,
uint32_t funcIndex,
MutableHandleFunction fun);
};
typedef GCVector<WasmInstanceObject*> WasmInstanceObjectVector;
typedef Rooted<WasmInstanceObject*> RootedWasmInstanceObject;
typedef Handle<WasmInstanceObject*> HandleWasmInstanceObject;
typedef MutableHandle<WasmInstanceObject*> MutableHandleWasmInstanceObject;
// The class of WebAssembly.Memory. A WasmMemoryObject references an ArrayBuffer
// or SharedArrayBuffer object which owns the actual memory.
@ -186,11 +168,6 @@ class WasmMemoryObject : public NativeObject
ArrayBufferObjectMaybeShared& buffer() const;
};
typedef GCPtr<WasmMemoryObject*> GCPtrWasmMemoryObject;
typedef Rooted<WasmMemoryObject*> RootedWasmMemoryObject;
typedef Handle<WasmMemoryObject*> HandleWasmMemoryObject;
typedef MutableHandle<WasmMemoryObject*> MutableHandleWasmMemoryObject;
// The class of WebAssembly.Table. A WasmTableObject holds a refcount on a
// wasm::Table, allowing a Table to be shared between multiple Instances
// (eventually between multiple threads).
@ -234,10 +211,6 @@ class WasmTableObject : public NativeObject
bool setInstance(JSContext* cx, uint32_t index, HandleWasmInstanceObject instanceObj);
};
typedef Rooted<WasmTableObject*> RootedWasmTableObject;
typedef Handle<WasmTableObject*> HandleWasmTableObject;
typedef MutableHandle<WasmTableObject*> MutableHandleWasmTableObject;
} // namespace js
#endif // wasm_js_h

View File

@ -18,6 +18,8 @@
#include "asmjs/WasmTable.h"
#include "jscntxt.h"
using namespace js;
using namespace js::wasm;

View File

@ -34,12 +34,37 @@
#include "js/UniquePtr.h"
#include "js/Utility.h"
#include "js/Vector.h"
#include "vm/MallocProvider.h"
namespace js {
class PropertyName;
namespace jit { struct BaselineScript; }
// This is a widespread header, so lets keep out the core wasm impl types.
class WasmMemoryObject;
typedef GCPtr<WasmMemoryObject*> GCPtrWasmMemoryObject;
typedef Rooted<WasmMemoryObject*> RootedWasmMemoryObject;
typedef Handle<WasmMemoryObject*> HandleWasmMemoryObject;
typedef MutableHandle<WasmMemoryObject*> MutableHandleWasmMemoryObject;
class WasmModuleObject;
typedef Rooted<WasmModuleObject*> RootedWasmModuleObject;
typedef Handle<WasmModuleObject*> HandleWasmModuleObject;
typedef MutableHandle<WasmModuleObject*> MutableHandleWasmModuleObject;
class WasmInstanceObject;
typedef GCVector<WasmInstanceObject*> WasmInstanceObjectVector;
typedef Rooted<WasmInstanceObject*> RootedWasmInstanceObject;
typedef Handle<WasmInstanceObject*> HandleWasmInstanceObject;
typedef MutableHandle<WasmInstanceObject*> MutableHandleWasmInstanceObject;
class WasmTableObject;
typedef Rooted<WasmTableObject*> RootedWasmTableObject;
typedef Handle<WasmTableObject*> HandleWasmTableObject;
typedef MutableHandle<WasmTableObject*> MutableHandleWasmTableObject;
namespace wasm {
using mozilla::DebugOnly;
@ -56,6 +81,11 @@ using mozilla::Some;
typedef Vector<uint32_t, 0, SystemAllocPolicy> Uint32Vector;
class Memory;
class Module;
class Instance;
class Table;
// To call Vector::podResizeToFit, a type must specialize mozilla::IsPod
// which is pretty verbose to do within js::wasm, so factor that process out
// into a macro.

View File

@ -8,11 +8,11 @@
#define builtin_SIMD_h
#include "jsapi.h"
#include "jsobj.h"
#include "NamespaceImports.h"
#include "builtin/TypedObject.h"
#include "builtin/TypedObjectConstants.h"
#include "jit/IonTypes.h"
#include "js/Conversions.h"
#include "vm/GlobalObject.h"
/*
* JS SIMD functions.
@ -945,15 +945,6 @@ enum class SimdOperation {
Last = Fn_fromFloat64x2Bits
};
class SimdObject : public JSObject
{
public:
static const Class class_;
static MOZ_MUST_USE bool toString(JSContext* cx, unsigned int argc, Value* vp);
static MOZ_MUST_USE bool resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId,
bool* resolved);
};
// These classes implement the concept containing the following constraints:
// - requires typename Elem: this is the scalar lane type, stored in each lane
// of the SIMD vector.

View File

@ -724,6 +724,16 @@ class InlineOpaqueTypedObject : public InlineTypedObject
static const Class class_;
};
// Class for the global SIMD object.
class SimdObject : public JSObject
{
public:
static const Class class_;
static MOZ_MUST_USE bool toString(JSContext* cx, unsigned int argc, Value* vp);
static MOZ_MUST_USE bool resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId,
bool* resolved);
};
/*
* Usage: NewOpaqueTypedObject(typeObj)
*

View File

@ -11,7 +11,7 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/MemoryReporting.h"
#include "builtin/SIMD.h"
#include "builtin/TypedObject.h"
#include "jit/CompileInfo.h"
#include "jit/ICStubSpace.h"
#include "jit/IonCode.h"