summaryrefslogtreecommitdiffstats
path: root/js/src/jit/BaselineCacheIR.h
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/src/jit/BaselineCacheIR.h
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/jit/BaselineCacheIR.h')
-rw-r--r--js/src/jit/BaselineCacheIR.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/js/src/jit/BaselineCacheIR.h b/js/src/jit/BaselineCacheIR.h
new file mode 100644
index 000000000..187d18e3a
--- /dev/null
+++ b/js/src/jit/BaselineCacheIR.h
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef jit_BaselineCacheIR_h
+#define jit_BaselineCacheIR_h
+
+#include "gc/Barrier.h"
+#include "jit/CacheIR.h"
+
+namespace js {
+namespace jit {
+
+class ICFallbackStub;
+class ICStub;
+
+// See the 'Sharing Baseline stub code' comment in CacheIR.h for a description
+// of this class.
+class CacheIRStubInfo
+{
+ CacheKind kind_;
+ uint8_t stubDataOffset_;
+ const uint8_t* code_;
+ uint32_t length_;
+ const uint8_t* gcTypes_;
+
+ CacheIRStubInfo(CacheKind kind, uint32_t stubDataOffset, const uint8_t* code, uint32_t codeLength,
+ const uint8_t* gcTypes)
+ : kind_(kind),
+ stubDataOffset_(stubDataOffset),
+ code_(code),
+ length_(codeLength),
+ gcTypes_(gcTypes)
+ {
+ MOZ_ASSERT(stubDataOffset_ == stubDataOffset, "stubDataOffset must fit in uint8_t");
+ }
+
+ CacheIRStubInfo(const CacheIRStubInfo&) = delete;
+ CacheIRStubInfo& operator=(const CacheIRStubInfo&) = delete;
+
+ public:
+ CacheKind kind() const { return kind_; }
+
+ const uint8_t* code() const { return code_; }
+ uint32_t codeLength() const { return length_; }
+ uint32_t stubDataOffset() const { return stubDataOffset_; }
+
+ StubField::GCType gcType(uint32_t i) const { return (StubField::GCType)gcTypes_[i]; }
+
+ static CacheIRStubInfo* New(CacheKind kind, uint32_t stubDataOffset,
+ const CacheIRWriter& writer);
+
+ template <class T>
+ js::GCPtr<T>& getStubField(ICStub* stub, uint32_t field) const;
+};
+
+void TraceBaselineCacheIRStub(JSTracer* trc, ICStub* stub, const CacheIRStubInfo* stubInfo);
+
+ICStub* AttachBaselineCacheIRStub(JSContext* cx, const CacheIRWriter& writer, CacheKind kind,
+ ICFallbackStub* stub);
+
+} // namespace jit
+} // namespace js
+
+#endif /* jit_BaselineCacheIR_h */