diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/JavaScriptCore/dfg/DFGCommon.cpp | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGCommon.cpp')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGCommon.cpp | 100 |
1 files changed, 69 insertions, 31 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGCommon.cpp b/Source/JavaScriptCore/dfg/DFGCommon.cpp index 502a95eb1..cd2a12c73 100644 --- a/Source/JavaScriptCore/dfg/DFGCommon.cpp +++ b/Source/JavaScriptCore/dfg/DFGCommon.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013-2015 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,15 +26,35 @@ #include "config.h" #include "DFGCommon.h" -#if ENABLE(DFG_JIT) - #include "DFGNode.h" +#include "JSCInlines.h" +#include <wtf/PrintStream.h> + +#if ENABLE(DFG_JIT) namespace JSC { namespace DFG { -void NodePointerTraits::dump(Node* value, PrintStream& out) +static StaticLock crashLock; + +void startCrashing() +{ + crashLock.lock(); +} + +bool isCrashing() +{ + return crashLock.isLocked(); +} + +bool stringLessThan(StringImpl& a, StringImpl& b) { - out.print(value); + unsigned minLength = std::min(a.length(), b.length()); + for (unsigned i = 0; i < minLength; ++i) { + if (a[i] == b[i]) + continue; + return a[i] < b[i]; + } + return a.length() < b.length(); } } } // namespace JSC::DFG @@ -48,17 +68,15 @@ void printInternal(PrintStream& out, OptimizationFixpointState state) switch (state) { case BeforeFixpoint: out.print("BeforeFixpoint"); - break; + return; case FixpointNotConverged: out.print("FixpointNotConverged"); - break; + return; case FixpointConverged: out.print("FixpointConverged"); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; + return; } + RELEASE_ASSERT_NOT_REACHED(); } void printInternal(PrintStream& out, GraphForm form) @@ -66,14 +84,15 @@ void printInternal(PrintStream& out, GraphForm form) switch (form) { case LoadStore: out.print("LoadStore"); - break; + return; case ThreadedCPS: out.print("ThreadedCPS"); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; + return; + case SSA: + out.print("SSA"); + return; } + RELEASE_ASSERT_NOT_REACHED(); } void printInternal(PrintStream& out, UnificationState state) @@ -81,14 +100,12 @@ void printInternal(PrintStream& out, UnificationState state) switch (state) { case LocallyUnified: out.print("LocallyUnified"); - break; + return; case GloballyUnified: out.print("GloballyUnified"); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; + return; } + RELEASE_ASSERT_NOT_REACHED(); } void printInternal(PrintStream& out, RefCountState state) @@ -96,14 +113,12 @@ void printInternal(PrintStream& out, RefCountState state) switch (state) { case EverythingIsLive: out.print("EverythingIsLive"); - break; + return; case ExactRefCount: out.print("ExactRefCount"); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; + return; } + RELEASE_ASSERT_NOT_REACHED(); } void printInternal(PrintStream& out, ProofStatus status) @@ -111,17 +126,40 @@ void printInternal(PrintStream& out, ProofStatus status) switch (status) { case IsProved: out.print("IsProved"); - break; + return; case NeedsCheck: out.print("NeedsCheck"); - break; - default: - RELEASE_ASSERT_NOT_REACHED(); - break; + return; } + RELEASE_ASSERT_NOT_REACHED(); } } // namespace WTF #endif // ENABLE(DFG_JIT) +namespace WTF { + +using namespace JSC::DFG; + +void printInternal(PrintStream& out, CapabilityLevel capabilityLevel) +{ + switch (capabilityLevel) { + case CannotCompile: + out.print("CannotCompile"); + return; + case CanCompile: + out.print("CanCompile"); + return; + case CanCompileAndInline: + out.print("CanCompileAndInline"); + return; + case CapabilityLevelNotSet: + out.print("CapabilityLevelNotSet"); + return; + } + RELEASE_ASSERT_NOT_REACHED(); +} + +} // namespace WTF + |