summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGFlushFormat.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGFlushFormat.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGFlushFormat.h64
1 files changed, 48 insertions, 16 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGFlushFormat.h b/Source/JavaScriptCore/dfg/DFGFlushFormat.h
index 9083a107e..f7084fb4d 100644
--- a/Source/JavaScriptCore/dfg/DFGFlushFormat.h
+++ b/Source/JavaScriptCore/dfg/DFGFlushFormat.h
@@ -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
@@ -23,10 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DFGFlushFormat_h
-#define DFGFlushFormat_h
-
-#include <wtf/Platform.h>
+#pragma once
#if ENABLE(DFG_JIT)
@@ -46,7 +43,6 @@ enum FlushFormat {
FlushedCell,
FlushedBoolean,
FlushedJSValue,
- FlushedArguments,
ConflictingFlush
};
@@ -57,14 +53,13 @@ inline NodeFlags resultFor(FlushFormat format)
case FlushedJSValue:
case FlushedCell:
case ConflictingFlush:
- case FlushedArguments:
return NodeResultJS;
case FlushedInt32:
return NodeResultInt32;
case FlushedInt52:
return NodeResultInt52;
case FlushedDouble:
- return NodeResultNumber;
+ return NodeResultDouble;
case FlushedBoolean:
return NodeResultBoolean;
}
@@ -78,16 +73,15 @@ inline UseKind useKindFor(FlushFormat format)
case DeadFlush:
case FlushedJSValue:
case ConflictingFlush:
- case FlushedArguments:
return UntypedUse;
case FlushedCell:
return CellUse;
case FlushedInt32:
return Int32Use;
case FlushedInt52:
- return MachineIntUse;
+ return Int52RepUse;
case FlushedDouble:
- return NumberUse;
+ return DoubleRepUse;
case FlushedBoolean:
return BooleanUse;
}
@@ -95,6 +89,33 @@ inline UseKind useKindFor(FlushFormat format)
return UntypedUse;
}
+inline UseKind uncheckedUseKindFor(FlushFormat format)
+{
+ switch (format) {
+ case DeadFlush:
+ case FlushedJSValue:
+ case ConflictingFlush:
+ return UntypedUse;
+ case FlushedCell:
+ return KnownCellUse;
+ case FlushedInt32:
+ return KnownInt32Use;
+ case FlushedInt52:
+ return Int52RepUse;
+ case FlushedDouble:
+ return DoubleRepUse;
+ case FlushedBoolean:
+ return KnownBooleanUse;
+ }
+ RELEASE_ASSERT_NOT_REACHED();
+ return UntypedUse;
+}
+
+inline SpeculatedType typeFilterFor(FlushFormat format)
+{
+ return typeFilterFor(useKindFor(format));
+}
+
inline DataFormat dataFormatFor(FlushFormat format)
{
switch (format) {
@@ -113,13 +134,27 @@ inline DataFormat dataFormatFor(FlushFormat format)
return DataFormatCell;
case FlushedBoolean:
return DataFormatBoolean;
- case FlushedArguments:
- return DataFormatArguments;
}
RELEASE_ASSERT_NOT_REACHED();
return DataFormatDead;
}
+inline FlushFormat merge(FlushFormat a, FlushFormat b)
+{
+ if (a == DeadFlush)
+ return b;
+ if (b == DeadFlush)
+ return a;
+ if (a == b)
+ return a;
+ return ConflictingFlush;
+}
+
+inline bool isConcrete(FlushFormat format)
+{
+ return format != DeadFlush && format != ConflictingFlush;
+}
+
} } // namespace JSC::DFG
namespace WTF {
@@ -134,6 +169,3 @@ inline JSC::DFG::FlushFormat inContext(JSC::DFG::FlushFormat format, JSC::DumpCo
} // namespace WTF
#endif // ENABLE(DFG_JIT)
-
-#endif // DFGFlushFormat_h
-