Commit 10190c45 authored by mark.lam@apple.com's avatar mark.lam@apple.com

Build failure when disabling JIT, YARR_JIT, and ASSEMBLER.

https://bugs.webkit.org/show_bug.cgi?id=123809.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Also fixed build when disabling the DISASSEMBLER.
Added some needed #if's and some comments.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::finalizeCodeWithDisassembly):
* dfg/DFGDisassembler.cpp:
* dfg/DFGDisassembler.h:
(JSC::DFG::Disassembler::Disassembler):
(JSC::DFG::Disassembler::setStartOfCode):
(JSC::DFG::Disassembler::setForBlockIndex):
(JSC::DFG::Disassembler::setForNode):
(JSC::DFG::Disassembler::setEndOfMainPath):
(JSC::DFG::Disassembler::setEndOfCode):
(JSC::DFG::Disassembler::dump):
(JSC::DFG::Disassembler::reportToProfiler):
* disassembler/Disassembler.cpp:
* disassembler/X86Disassembler.cpp:
* jit/FPRInfo.h:
* jit/GPRInfo.h:
* jit/JITDisassembler.cpp:
* jit/JITDisassembler.h:
(JSC::JITDisassembler::JITDisassembler):
(JSC::JITDisassembler::setStartOfCode):
(JSC::JITDisassembler::setForBytecodeMainPath):
(JSC::JITDisassembler::setForBytecodeSlowPath):
(JSC::JITDisassembler::setEndOfSlowPath):
(JSC::JITDisassembler::setEndOfCode):
(JSC::JITDisassembler::dump):
(JSC::JITDisassembler::reportToProfiler):

Source/WTF: 

* wtf/Platform.h:
- Ensure that the ASSEMBLER is enabled when the DISASSEMBLER is enabled.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5f1ccd4b
2013-12-02 Mark Lam <mark.lam@apple.com>
Build failure when disabling JIT, YARR_JIT, and ASSEMBLER.
https://bugs.webkit.org/show_bug.cgi?id=123809.
Reviewed by Geoffrey Garen.
Also fixed build when disabling the DISASSEMBLER.
Added some needed #if's and some comments.
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::finalizeCodeWithDisassembly):
* dfg/DFGDisassembler.cpp:
* dfg/DFGDisassembler.h:
(JSC::DFG::Disassembler::Disassembler):
(JSC::DFG::Disassembler::setStartOfCode):
(JSC::DFG::Disassembler::setForBlockIndex):
(JSC::DFG::Disassembler::setForNode):
(JSC::DFG::Disassembler::setEndOfMainPath):
(JSC::DFG::Disassembler::setEndOfCode):
(JSC::DFG::Disassembler::dump):
(JSC::DFG::Disassembler::reportToProfiler):
* disassembler/Disassembler.cpp:
* disassembler/X86Disassembler.cpp:
* jit/FPRInfo.h:
* jit/GPRInfo.h:
* jit/JITDisassembler.cpp:
* jit/JITDisassembler.h:
(JSC::JITDisassembler::JITDisassembler):
(JSC::JITDisassembler::setStartOfCode):
(JSC::JITDisassembler::setForBytecodeMainPath):
(JSC::JITDisassembler::setForBytecodeSlowPath):
(JSC::JITDisassembler::setEndOfSlowPath):
(JSC::JITDisassembler::setEndOfCode):
(JSC::JITDisassembler::dump):
(JSC::JITDisassembler::reportToProfiler):
2013-12-02 Filip Pizlo <fpizlo@apple.com>
Baseline JIT calls to CommonSlowPaths shouldn't restore the last result
......
......@@ -49,7 +49,8 @@ LinkBuffer::CodeRef LinkBuffer::finalizeCodeWithDisassembly(const char* format,
ASSERT(Options::showDisassembly() || Options::showDFGDisassembly());
CodeRef result = finalizeCodeWithoutDisassembly();
#if ENABLE(DISASSEMBLER)
dataLogF("Generated JIT code for ");
va_list argList;
va_start(argList, format);
......@@ -59,6 +60,9 @@ LinkBuffer::CodeRef LinkBuffer::finalizeCodeWithDisassembly(const char* format,
dataLogF(" Code at [%p, %p):\n", result.code().executableAddress(), static_cast<char*>(result.code().executableAddress()) + result.size());
disassemble(result.code(), m_size, " ", WTF::dataFile());
#else
UNUSED_PARAM(format);
#endif // ENABLE(DISASSEMBLER)
return result;
}
......
......@@ -26,7 +26,7 @@
#include "config.h"
#include "DFGDisassembler.h"
#if ENABLE(DFG_JIT)
#if ENABLE(DFG_JIT) && ENABLE(DISASSEMBLER)
#include "CodeBlockWithJITType.h"
#include "DFGGraph.h"
......@@ -172,4 +172,4 @@ void Disassembler::dumpDisassembly(PrintStream& out, const char* prefix, LinkBuf
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
#endif // ENABLE(DFG_JIT) && ENABLE(DISASSEMBLER)
......@@ -42,6 +42,8 @@ namespace JSC { namespace DFG {
class Graph;
#if ENABLE(DISASSEMBLER)
class Disassembler {
WTF_MAKE_FAST_ALLOCATED;
public:
......@@ -97,6 +99,25 @@ private:
MacroAssembler::Label m_endOfCode;
};
#else // ENABLE(DISASSEMBLER)
class Disassembler {
WTF_MAKE_FAST_ALLOCATED;
public:
Disassembler(Graph&) { }
void setStartOfCode(MacroAssembler::Label) { }
void setForBlockIndex(BlockIndex, MacroAssembler::Label) { }
void setForNode(Node*, MacroAssembler::Label) { }
void setEndOfMainPath(MacroAssembler::Label) { }
void setEndOfCode(MacroAssembler::Label) { }
void dump(LinkBuffer&) { }
void reportToProfiler(Profiler::Compilation*, LinkBuffer&) { }
};
#endif // ENABLE(DISASSEMBLER)
} } // namespace JSC::DFG
#endif // ENABLE(DFG_JIT)
......
......@@ -26,6 +26,8 @@
#include "config.h"
#include "Disassembler.h"
#if ENABLE(DISASSEMBLER)
#include "MacroAssemblerCodeRef.h"
#include <wtf/DataLog.h>
......@@ -41,3 +43,4 @@ void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char*
} // namespace JSC
#endif // ENABLE(DISASSEMBLER)
......@@ -26,6 +26,7 @@
#include "config.h"
#include "Disassembler.h"
#if ENABLE(DISASSEMBLER)
#if USE(UDIS86) || USE(LLVM_DISASSEMBLER)
#include "MacroAssemblerCodeRef.h"
......@@ -70,4 +71,4 @@ bool tryToDisassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const c
} // namespace JSC
#endif // USE(UDIS86) || USE(LLVM_DISASSEMBLER)
#endif // ENABLE(DISASSEMBLER)
......@@ -34,6 +34,8 @@ namespace JSC {
typedef MacroAssembler::FPRegisterID FPRReg;
#define InvalidFPRReg ((::JSC::FPRReg)-1)
#if ENABLE(JIT)
#if CPU(X86) || CPU(X86_64)
class FPRInfo {
......@@ -108,7 +110,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(X86) || CPU(X86_64)
#if CPU(ARM)
......@@ -172,7 +174,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(ARM)
#if CPU(ARM64)
......@@ -260,7 +262,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(ARM64)
#if CPU(MIPS)
......@@ -327,7 +329,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(MIPS)
#if CPU(SH4)
......@@ -389,7 +391,9 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(SH4)
#endif // ENABLE(JIT)
} // namespace JSC
......
......@@ -34,6 +34,8 @@ namespace JSC {
typedef MacroAssembler::RegisterID GPRReg;
#define InvalidGPRReg ((::JSC::GPRReg)-1)
#if ENABLE(JIT)
#if USE(JSVALUE64)
class JSValueRegs {
public:
......@@ -125,7 +127,7 @@ private:
int32_t m_offset;
GPRReg m_base;
};
#endif
#endif // USE(JSVALUE64)
#if USE(JSVALUE32_64)
class JSValueRegs {
......@@ -276,7 +278,7 @@ private:
int8_t m_payload;
int8_t m_tagType; // Contains the low bits of the tag.
};
#endif
#endif // USE(JSVALUE32_64)
// The baseline JIT requires that regT3 be callee-preserved.
......@@ -343,7 +345,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(X86)
#if CPU(X86_64)
#if !OS(WINDOWS)
......@@ -440,7 +442,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(X86_64)
#if CPU(ARM)
#define NUMBER_OF_ARGUMENT_REGISTERS 4u
......@@ -521,7 +523,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(ARM)
#if CPU(ARM64)
#define NUMBER_OF_ARGUMENT_REGISTERS 8u
......@@ -619,7 +621,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(ARM64)
#if CPU(MIPS)
#define NUMBER_OF_ARGUMENT_REGISTERS 4u
......@@ -695,7 +697,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(MIPS)
#if CPU(SH4)
#define NUMBER_OF_ARGUMENT_REGISTERS 4u
......@@ -765,7 +767,7 @@ public:
static const unsigned InvalidIndex = 0xffffffff;
};
#endif
#endif // CPU(SH4)
// The baseline JIT uses "accumulator" style execution with regT0 (for 64-bit)
// and regT0 + regT1 (for 32-bit) serving as the accumulator register(s) for
......@@ -775,6 +777,8 @@ COMPILE_ASSERT(GPRInfo::regT0 == GPRInfo::returnValueGPR, regT0_must_equal_retur
COMPILE_ASSERT(GPRInfo::regT1 == GPRInfo::returnValueGPR2, regT1_must_equal_returnValueGPR2);
#endif
#endif // ENABLE(JIT)
} // namespace JSC
namespace WTF {
......
/*
* Copyright (C) 2012 Apple Inc. All rights reserved.
* Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -26,7 +26,7 @@
#include "config.h"
#include "JITDisassembler.h"
#if ENABLE(JIT)
#if ENABLE(JIT) && ENABLE(DISASSEMBLER)
#include "CodeBlock.h"
#include "CodeBlockWithJITType.h"
......@@ -164,5 +164,5 @@ void JITDisassembler::dumpDisassembly(PrintStream& out, LinkBuffer& linkBuffer,
} // namespace JSC
#endif // ENABLE(JIT)
#endif // ENABLE(JIT) && ENABLE(DISASSEMBLER)
......@@ -39,6 +39,8 @@ namespace JSC {
class CodeBlock;
#if ENABLE(DISASSEMBLER)
class JITDisassembler {
WTF_MAKE_FAST_ALLOCATED;
public:
......@@ -84,6 +86,25 @@ private:
MacroAssembler::Label m_endOfCode;
};
#else // ENABLE(DISASSEMBLER)
class JITDisassembler {
WTF_MAKE_FAST_ALLOCATED;
public:
JITDisassembler(CodeBlock*) { }
void setStartOfCode(MacroAssembler::Label) { }
void setForBytecodeMainPath(unsigned, MacroAssembler::Label) { }
void setForBytecodeSlowPath(unsigned, MacroAssembler::Label) { }
void setEndOfSlowPath(MacroAssembler::Label) { }
void setEndOfCode(MacroAssembler::Label) { }
void dump(LinkBuffer&) { }
void reportToProfiler(Profiler::Compilation*, LinkBuffer&) { }
};
#endif // ENABLE(DISASSEMBLER)
} // namespace JSC
#endif // ENABLE(JIT)
......
2013-12-02 Mark Lam <mark.lam@apple.com>
Build failure when disabling JIT, YARR_JIT, and ASSEMBLER.
https://bugs.webkit.org/show_bug.cgi?id=123809.
Reviewed by Geoffrey Garen.
* wtf/Platform.h:
- Ensure that the ASSEMBLER is enabled when the DISASSEMBLER is enabled.
2013-11-30 peavo@outlook.com <peavo@outlook.com>
[Win] Some JavaScript date tests are failing.
......
......@@ -851,6 +851,16 @@
#endif
#endif
/* If the Disassembler is enabled, then the Assembler must be enabled as well: */
#if ENABLE(DISASSEMBLER)
#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
#error "Cannot enable the Disassembler without enabling the Assembler"
#else
#undef ENABLE_ASSEMBLER
#define ENABLE_ASSEMBLER 1
#endif
#endif
/* FIXME: We currently unconditionally use spearate stacks. When we switch to using the
C stack for JS frames, we'll need to make the following conditional on ENABLE(LLINT_CLOOP)
only.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment