Bug 1325771 - js:jit: Make sure JitCode has at least 4 bytes alignment. r?jandem
--- a/js/src/jit/IonCode.h
+++ b/js/src/jit/IonCode.h
@@ -17,16 +17,20 @@
#include "jit/ExecutableAllocator.h"
#include "jit/ICStubSpace.h"
#include "jit/IonOptimizationLevels.h"
#include "jit/IonTypes.h"
#include "js/UbiNode.h"
#include "vm/TraceLogging.h"
#include "vm/TypeInference.h"
+#ifndef __GNUC__
+#define __attribute__(x)
+#endif
+
namespace js {
namespace jit {
class MacroAssembler;
class PatchableBackedge;
class IonBuilder;
class IonICEntry;
@@ -156,17 +160,18 @@ class JitCode : public gc::TenuredCell
// object can be allocated, nullptr is returned. On failure, |pool| is
// automatically released, so the code may be freed.
template <AllowGC allowGC>
static JitCode* New(JSContext* cx, uint8_t* code, uint32_t bufferSize, uint32_t headerSize,
ExecutablePool* pool, CodeKind kind);
public:
static const JS::TraceKind TraceKind = JS::TraceKind::JitCode;
-};
+
+} __attribute__ ((aligned(4))); /* ensure alignment is at least 4 bytes */
class SnapshotWriter;
class RecoverWriter;
class SafepointWriter;
class SafepointIndex;
class OsiIndex;
class IonCache;
class IonIC;