/*
- * Copyright (C) 2011-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-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
#if ENABLE(DFG_JIT)
-#include "CodeOrigin.h"
#include "Options.h"
#include "VirtualRegister.h"
DontRefNode
};
+enum SwitchKind {
+ SwitchImm,
+ SwitchChar,
+ SwitchString,
+ SwitchCell
+};
+
inline bool verboseCompilationEnabled(CompilationMode mode = DFGMode)
{
return Options::verboseCompilation() || Options::dumpGraphAtEachPhase() || (isFTL(mode) && Options::verboseFTLCompilation());
FixupPass
};
+enum StructureRegistrationState { HaveNotStartedRegistering, AllStructuresAreRegistered };
+
+enum StructureRegistrationResult { StructureRegisteredNormally, StructureRegisteredAndWatched };
+
enum OptimizationFixpointState { BeforeFixpoint, FixpointNotConverged, FixpointConverged };
// Describes the form you can expect the entire graph to be in.
// expect to be live at the head, and which locals they make available at the
// tail. ThreadedCPS form also implies that:
//
- // - GetLocals and SetLocals to uncaptured variables are not redundant within
- // a basic block.
+ // - GetLocals and SetLocals are not redundant within a basic block.
//
// - All GetLocals and Flushes are linked directly to the last access point
- // of the variable, which must not be another GetLocal if the variable is
- // uncaptured.
+ // of the variable, which must not be another GetLocal.
//
// - Phantom(Phi) is not legal, but PhantomLocal is.
//
return doesKill ? DoesKill : DoesNotKill;
}
+enum class PlanStage {
+ Initial,
+ AfterFixup
+};
+
template<typename T, typename U>
bool checkAndSet(T& left, U right)
{
// when you're forcing a crash with diagnostics.
void startCrashing();
+JS_EXPORT_PRIVATE bool isCrashing();
+
+struct NodeAndIndex {
+ NodeAndIndex()
+ : node(nullptr)
+ , index(UINT_MAX)
+ {
+ }
+
+ NodeAndIndex(Node* node, unsigned index)
+ : node(node)
+ , index(index)
+ {
+ ASSERT(!node == (index == UINT_MAX));
+ }
+
+ bool operator!() const
+ {
+ return !node;
+ }
+
+ Node* node;
+ unsigned index;
+};
+
+// A less-than operator for strings that is useful for generating string switches. Sorts by <
+// relation on characters. Ensures that if a is a prefix of b, then a < b.
+bool stringLessThan(StringImpl& a, StringImpl& b);
+
} } // namespace JSC::DFG
namespace WTF {
enum CapabilityLevel {
CannotCompile,
- CanInline,
CanCompile,
CanCompileAndInline,
CapabilityLevelNotSet
inline bool canInline(CapabilityLevel level)
{
switch (level) {
- case CanInline:
case CanCompileAndInline:
return true;
default:
switch (a) {
case CannotCompile:
return CannotCompile;
- case CanInline:
- switch (b) {
- case CanInline:
- case CanCompileAndInline:
- return CanInline;
- default:
- return CannotCompile;
- }
case CanCompile:
switch (b) {
case CanCompile:
} } // namespace JSC::DFG
+namespace WTF {
+
+void printInternal(PrintStream&, JSC::DFG::CapabilityLevel);
+
+} // namespace WTF
+
#endif // DFGCommon_h