Commit ea77149c authored by oliver@apple.com's avatar oliver@apple.com

fourthTier: Landing the initial FTL logic in a single commit to avoid spurious

broken builds.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b3956443
2013-04-03 Filip Pizlo <fpizlo@apple.com>
fourthTier: Just linking LLVM into JSC causes all plugin tests to fail
https://bugs.webkit.org/show_bug.cgi?id=113915
Reviewed by nobody.
This is pretty funny. I don't know, yet, what is going on, but I don't want it to block other work.
* platform/mac/TestExpectations:
2013-03-29 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL JIT should be able to compile the Marsaglia random number generator
https://bugs.webkit.org/show_bug.cgi?id=113635
Reviewed by Oliver Hunt.
* fast/js/regress/marsaglia-expected.txt: Added.
* fast/js/regress/marsaglia.html: Added.
* fast/js/regress/script-tests/marsaglia.js: Added.
(marsaglia):
2013-07-24 Daniel Bates <dabates@apple.com>
Add DRT test to ensure don't override z-index for overflow: scroll, -webkit-overflow-scrolling: touch
JSRegress/marsaglia
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS no exception thrown
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script src="resources/regress-pre.js"></script>
<script src="script-tests/marsaglia.js"></script>
<script src="resources/regress-post.js"></script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
function marsaglia(m_z, m_w, n) {
var result;
for (var i = 0; i < n; ++i) {
m_z = (36969 * (m_z & 65535) + (m_z >> 16)) | 0;
m_w = (18000 * (m_w & 65535) + (m_w >> 16)) | 0;
result = ((m_z << 16) + m_w) | 0;
}
return result;
}
var result = 0;
for (var i = 0; i < 100; ++i)
result += marsaglia(i, i + 1, 1000000);
print(result);
This diff is collapsed.
......@@ -102,11 +102,13 @@ set(JavaScriptCore_SOURCES
dfg/DFGNodeFlags.cpp
dfg/DFGOSREntry.cpp
dfg/DFGOSRExit.cpp
dfg/DFGOSRExitBase.cpp
dfg/DFGOSRExitCompiler.cpp
dfg/DFGOSRExitCompiler32_64.cpp
dfg/DFGOSRExitCompiler64.cpp
dfg/DFGOSRExitCompilerCommon.cpp
dfg/DFGOSRExitJumpPlaceholder.cpp
dfg/DFGOSRExitPreparation.cpp
dfg/DFGOperations.cpp
dfg/DFGPhase.cpp
dfg/DFGPredictionPropagationPhase.cpp
......
This diff is collapsed.
......@@ -184,4 +184,6 @@ ENABLE_WORKERS = ENABLE_WORKERS;
ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
ENABLE_XSLT = ENABLE_XSLT;
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_THREADED_HTML_PARSER) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
ENABLE_FTL_JIT = ;
FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_BLOB) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_TRANSFORMS_ANIMATIONS_UNPREFIXED) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PLUGIN_PROXY_FOR_VIDEO) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_THREADED_HTML_PARSER) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(FEATURE_DEFINES_$(PLATFORM_NAME));
......@@ -34,11 +34,18 @@ JSVALUE_MODEL_x86_64 = 64;
// Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
OTHER_LDFLAGS_HIDE_SYMBOLS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-all_load;
OTHER_LDFLAGS_LLVM = $(OTHER_LDFLAGS_LLVM_$(ENABLE_FTL_JIT));
OTHER_LDFLAGS_LLVM_ = ;
OTHER_LDFLAGS_LLVM_ENABLE_FTL_JIT = -lpthread -lm -lgtest_main -lgtest -lLLVMTableGen -lLLVMDebugInfo -lLLVMOption -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMIRReader -lLLVMAsmParser -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInstrumentation -lLLVMArchive -lLLVMBitReader -lLLVMInterpreter -lLLVMipo -lLLVMVectorize -lLLVMLinker -lLLVMBitWriter -lLLVMMCJIT -lLLVMJIT -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport;
OTHER_LDFLAGS_BASE = -lobjc -Wl,-Y,3 $(OTHER_LDFLAGS_HIDE_SYMBOLS);
OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(PLATFORM_NAME));
OTHER_LDFLAGS_iphoneos = $(OTHER_LDFLAGS_BASE);
OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_iphoneos);
OTHER_LDFLAGS_macosx = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -framework CoreServices;
OTHER_LDFLAGS_macosx = $(OTHER_LDFLAGS_BASE) $(OTHER_LDFLAGS_LLVM) -sub_library libobjc -framework CoreServices;
GCC_PREFIX_HEADER = JavaScriptCorePrefix.h;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" $(HEADER_SEARCH_PATHS);
......
......@@ -254,9 +254,13 @@ javascriptcore_sources += \
Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.h \
Source/JavaScriptCore/dfg/DFGOSRExit.h \
Source/JavaScriptCore/dfg/DFGOSRExit.cpp \
Source/JavaScriptCore/dfg/DFGOSRExitBase.h \
Source/JavaScriptCore/dfg/DFGOSRExitBase.cpp \
Source/JavaScriptCore/dfg/DFGOSRExitCompilationInfo.h \
Source/JavaScriptCore/dfg/DFGOSRExitJumpPlaceholder.cpp \
Source/JavaScriptCore/dfg/DFGOSRExitJumpPlaceholder.h \
Source/JavaScriptCore/dfg/DFGOSRExitPreparation.h \
Source/JavaScriptCore/dfg/DFGOSRExitPreparation.cpp \
Source/JavaScriptCore/dfg/DFGPhase.cpp \
Source/JavaScriptCore/dfg/DFGPhase.h \
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp \
......
......@@ -444,7 +444,7 @@
<ClCompile Include="..\runtime\JSCJSValue.cpp" />
<ClCompile Include="..\runtime\JSDateMath.cpp" />
<ClCompile Include="..\runtime\JSFunction.cpp" />
<ClCompile Include="..\runtime\VM.cpp" />
<ClCompile Include="..\runtime\JSGlobalData.cpp" />
<ClCompile Include="..\runtime\JSGlobalObject.cpp" />
<ClCompile Include="..\runtime\JSGlobalObjectFunctions.cpp" />
<ClCompile Include="..\runtime\JSLock.cpp" />
......@@ -812,7 +812,7 @@
<ClInclude Include="..\runtime\JSDestructibleObject.h" />
<ClInclude Include="..\runtime\JSExportMacros.h" />
<ClInclude Include="..\runtime\JSFunction.h" />
<ClInclude Include="..\runtime\VM.h" />
<ClInclude Include="..\runtime\JSGlobalData.h" />
<ClInclude Include="..\runtime\JSGlobalObject.h" />
<ClInclude Include="..\runtime\JSGlobalObjectFunctions.h" />
<ClInclude Include="..\runtime\JSLock.h" />
......
......@@ -141,11 +141,13 @@ SOURCES += \
dfg/DFGOperations.cpp \
dfg/DFGOSREntry.cpp \
dfg/DFGOSRExit.cpp \
dfg/DFGOSRExitBase.cpp \
dfg/DFGOSRExitCompiler.cpp \
dfg/DFGOSRExitCompiler64.cpp \
dfg/DFGOSRExitCompiler32_64.cpp \
dfg/DFGOSRExitCompilerCommon.cpp \
dfg/DFGOSRExitJumpPlaceholder.cpp \
dfg/DFGOSRExitPreparation.cpp \
dfg/DFGPhase.cpp \
dfg/DFGPredictionPropagationPhase.cpp \
dfg/DFGPredictionInjectionPhase.cpp \
......
......@@ -105,6 +105,11 @@ public:
, offset(offset)
{
}
Address withOffset(int32_t additionalOffset)
{
return Address(base, offset + additionalOffset);
}
RegisterID base;
int32_t offset;
......
......@@ -199,6 +199,11 @@ public:
return applyOffset(label.m_label).m_offset;
}
unsigned offsetOf(PatchableJump jump)
{
return applyOffset(jump.m_jump.m_label).m_offset;
}
// Upon completion of all patching 'FINALIZE_CODE()' should be called once to
// complete generation of the code. Alternatively, call
// finalizeCodeWithoutDisassembly() directly if you have your own way of
......
......@@ -94,6 +94,7 @@ public:
DoubleConditionBits_should_not_interfere_with_X86Assembler_Condition_codes);
static const RegisterID stackPointerRegister = X86Registers::esp;
static const RegisterID framePointerRegister = X86Registers::ebp;
#if ENABLE(JIT_CONSTANT_BLINDING)
static bool shouldBlindForSpecificArch(uint32_t value) { return value >= 0x00ffffff; }
......
......@@ -46,16 +46,22 @@ class RepatchBuffer {
public:
RepatchBuffer(CodeBlock* codeBlock)
{
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
RefPtr<JITCode> code = codeBlock->getJITCode();
m_start = code->start();
m_size = code->size();
ExecutableAllocator::makeWritable(m_start, m_size);
#else
UNUSED_PARAM(codeBlock);
#endif
}
~RepatchBuffer()
{
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
ExecutableAllocator::makeExecutable(m_start, m_size);
#endif
}
void relink(CodeLocationJump jump, CodeLocationLabel destination)
......@@ -170,8 +176,10 @@ public:
}
private:
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
void* m_start;
size_t m_size;
#endif
};
} // namespace JSC
......
......@@ -37,6 +37,7 @@
#include "DFGNode.h"
#include "DFGRepatch.h"
#include "Debugger.h"
#include "FTLJITCode.h"
#include "Interpreter.h"
#include "JIT.h"
#include "JITStubs.h"
......@@ -3231,16 +3232,45 @@ void CodeBlock::tallyFrequentExitSites()
CodeBlock* profiledBlock = alternative();
DFG::JITCode* jitCode = m_jitCode->dfg();
for (unsigned i = 0; i < jitCode->osrExit.size(); ++i) {
DFG::OSRExit& exit = jitCode->osrExit[i];
if (!exit.considerAddingAsFrequentExitSite(profiledBlock))
continue;
switch (getJITType()) {
case JITCode::DFGJIT: {
DFG::JITCode* jitCode = m_jitCode->dfg();
for (unsigned i = 0; i < jitCode->osrExit.size(); ++i) {
DFG::OSRExit& exit = jitCode->osrExit[i];
if (!exit.considerAddingAsFrequentExitSite(profiledBlock))
continue;
#if DFG_ENABLE(DEBUG_VERBOSE)
dataLog("OSR exit #", i, " (bc#", exit.m_codeOrigin.bytecodeIndex, ", ", exit.m_kind, ") for ", *this, " occurred frequently: counting as frequent exit site.\n");
#endif
}
break;
}
case JITCode::FTLJIT: {
// There is no easy way to avoid duplicating this code since the FTL::JITCode::osrExit
// vector contains a totally different type, that just so happens to behave like
// DFG::JITCode::osrExit.
#if ENABLE(FTL_JIT)
FTL::JITCode* jitCode = m_jitCode->ftl();
for (unsigned i = 0; i < jitCode->osrExit.size(); ++i) {
FTL::OSRExit& exit = jitCode->osrExit[i];
if (!exit.considerAddingAsFrequentExitSite(this, profiledBlock))
continue;
#if DFG_ENABLE(DEBUG_VERBOSE)
dataLog("OSR exit #", i, " (bc#", exit.m_codeOrigin.bytecodeIndex, ", ", exit.m_kind, ") for ", *this, " occurred frequently: counting as frequent exit site.\n");
dataLog("OSR exit #", i, " (bc#", exit.m_codeOrigin.bytecodeIndex, ", ", exit.m_kind, ") for ", *this, " occurred frequently: counting as frequent exit site.\n");
#endif
}
#endif
break;
}
default:
RELEASE_ASSERT_NOT_REACHED();
break;
}
}
#endif // ENABLE(DFG_JIT)
......
This diff is collapsed.
......@@ -48,6 +48,8 @@ struct OperandValueTraits {
enum OperandKind { ArgumentOperand, LocalOperand };
enum OperandsLikeTag { OperandsLike };
template<typename T, typename Traits = OperandValueTraits<T> >
class Operands {
public:
......@@ -59,6 +61,13 @@ public:
m_locals.fill(Traits::defaultValue(), numLocals);
}
template<typename U, typename OtherTraits>
explicit Operands(OperandsLikeTag, const Operands<U, OtherTraits>& other)
{
m_arguments.fill(Traits::defaultValue(), other.numberOfArguments());
m_locals.fill(Traits::defaultValue(), other.numberOfLocals());
}
size_t numberOfArguments() const { return m_arguments.size(); }
size_t numberOfLocals() const { return m_locals.size(); }
......@@ -208,6 +217,8 @@ public:
m_locals[i] = Traits::defaultValue();
}
void dump(PrintStream& out) const;
private:
Vector<T, 8> m_arguments;
Vector<T, 16> m_locals;
......@@ -231,6 +242,12 @@ void dumpOperands(const Operands<T, Traits>& operands, PrintStream& out)
}
}
template<typename T, typename Traits>
inline void Operands<T, Traits>::dump(PrintStream& out) const
{
dumpOperands(*this, out);
}
} // namespace JSC
#endif // Operands_h
......
......@@ -95,7 +95,8 @@ void AbstractState::initialize(Graph& graph)
continue;
}
SpeculatedType prediction = node->variableAccessData()->prediction();
SpeculatedType prediction =
node->variableAccessData()->argumentAwarePrediction();
if (isInt32Speculation(prediction))
root->valuesAtHead.argument(i).set(SpecInt32);
else if (isBooleanSpeculation(prediction))
......
......@@ -112,6 +112,21 @@ public:
return m_variables;
}
bool needsTypeCheck(Node* node, SpeculatedType typesPassedThrough)
{
return forNode(node).m_type & ~typesPassedThrough;
}
bool needsTypeCheck(Edge edge, SpeculatedType typesPassedThrough)
{
return needsTypeCheck(edge.node(), typesPassedThrough);
}
bool needsTypeCheck(Edge edge)
{
return needsTypeCheck(edge, typeFilterFor(edge.useKind()));
}
// Call this before beginning CFA to initialize the abstract values of
// arguments, and to indicate which blocks should be listed for CFA
// execution.
......@@ -185,19 +200,7 @@ public:
ALWAYS_INLINE void filterEdgeByUse(Node* node, Edge& edge)
{
#if !ASSERT_DISABLED
switch (edge.useKind()) {
case KnownInt32Use:
case KnownNumberUse:
case KnownCellUse:
case KnownStringUse:
ASSERT(!(forNode(edge).m_type & ~typeFilterFor(edge.useKind())));
break;
default:
break;
}
#endif // !ASSERT_DISABLED
ASSERT(mayHaveTypeCheck(edge.useKind()) || !needsTypeCheck(edge));
filterByType(node, edge, typeFilterFor(edge.useKind()));
}
......
......@@ -49,6 +49,10 @@
#include "DFGUnificationPhase.h"
#include "DFGValidate.h"
#include "DFGVirtualRegisterAllocationPhase.h"
#include "FTLCapabilities.h"
#include "FTLCompile.h"
#include "FTLLowerDFGToLLVM.h"
#include "FTLState.h"
#include "Operations.h"
#include "Options.h"
......@@ -61,6 +65,18 @@ unsigned getNumCompilations()
return numCompilations;
}
static void dumpAndVerifyGraph(Graph& graph, const char* text)
{
GraphDumpMode modeForFinalValidate = DumpGraph;
if (verboseCompilationEnabled()) {
dataLog(text, "\n");
graph.dump();
modeForFinalValidate = DontDumpGraph;
}
if (validationEnabled())
validate(graph, modeForFinalValidate);
}
enum CompileMode { CompileFunction, CompileOther };
static bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlock, RefPtr<JSC::JITCode>& jitCode, MacroAssemblerCodePtr* jitCodeWithArityCheck, unsigned osrEntryBytecodeIndex)
{
......@@ -145,17 +161,31 @@ static bool compile(CompileMode compileMode, ExecState* exec, CodeBlock* codeBlo
performStoreElimination(dfg);
performCPSRethreading(dfg);
performDCE(dfg);
performVirtualRegisterAllocation(dfg);
GraphDumpMode modeForFinalValidate = DumpGraph;
if (verboseCompilationEnabled()) {
dataLogF("Graph after optimization:\n");
dfg.dump();
modeForFinalValidate = DontDumpGraph;
#if ENABLE(FTL_JIT)
if (Options::useExperimentalFTL()
&& compileMode == CompileFunction
&& FTL::canCompile(dfg)) {
dumpAndVerifyGraph(dfg, "Graph just before FTL lowering:");
// FIXME: Support OSR entry.
// https://bugs.webkit.org/show_bug.cgi?id=113625
FTL::State state(dfg);
FTL::lowerDFGToLLVM(state);
FTL::compile(state, jitCode, *jitCodeWithArityCheck);
// FIXME: Need to add support for the case where JIT memory allocation failed.
// https://bugs.webkit.org/show_bug.cgi?id=113620
return true;
}
if (validationEnabled())
validate(dfg, modeForFinalValidate);
#endif // ENABLE(FTL_JIT)
performVirtualRegisterAllocation(dfg);
dumpAndVerifyGraph(dfg, "Graph after optimization:");
JITCompiler dataFlowJIT(dfg);
bool result;
if (compileMode == CompileFunction) {
......
This diff is collapsed.
......@@ -51,6 +51,7 @@ inline bool belongsInMinifiedGraph(NodeType type)
case PhantomArguments:
return true;
default:
ASSERT(!needsOSRBackwardRewiring(type) && !needsOSRForwardRewiring(type));
return false;
}
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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