Commit c6441e68 authored by barraclough@apple.com's avatar barraclough@apple.com

Bug 58198 - Clean up JSValue implementation for JSVALUE64

Reviewed by Sam Weinig.

Source/JavaScriptCore: 

Remove JSNumberCell, JSImmediate, unify some methods between JSVALUE32_64/JSVALUE64

JSNumberCell.h largely just contained the constructors for JSValue on JSVALUE64,
which should not have been here.  JSImmediate mostly contained uncalled methods,
along with the internal implementation of the JSValue constructors split unnecessarily
across a number of layers of function calls. These could largely be merged back
together. Many methods and constructors from JSVALUE32_64 and JSVALUE64 can by unified.

The .cpp files were empty.

Moving all these methods into JSValue.h seems to be a repro measurable regression, so
I have kept these methods in a separate JSValueInlineMethods.h. Adding the 64-bit tag
values as static const members of JSValue also measures as a repro regression, so I
have made these #defines.

* Android.mk:
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.exp:
* JavaScriptCore.gypi:
* JavaScriptCore.pro:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
    - Removed JSImmediate.h, JSNumberCell.h.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
    - Removed class JSImmediate.
* dfg/DFGNonSpeculativeJIT.cpp:
(JSC::DFG::NonSpeculativeJIT::compile):
    - Removed class JSImmediate.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compile):
    - Removed class JSImmediate.
* jit/JITArithmetic.cpp:
(JSC::JIT::compileBinaryArithOpSlowCase):
    - Removed class JSImmediate.
* jit/JITInlineMethods.h:
(JSC::JIT::emitJumpIfJSCell):
(JSC::JIT::emitJumpIfNotJSCell):
(JSC::JIT::emitJumpIfImmediateInteger):
(JSC::JIT::emitJumpIfNotImmediateInteger):
(JSC::JIT::emitFastArithDeTagImmediate):
(JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
(JSC::JIT::emitFastArithReTagImmediate):
(JSC::JIT::emitTagAsBoolImmediate):
    - Removed class JSImmediate.
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emitSlow_op_not):
    - Removed class JSImmediate.
* jit/JSInterfaceJIT.h:
    - Removed class JSImmediate.
* runtime/JSCell.h:
    - Removed JSImmediate.h, JSNumberCell.h.
* runtime/JSImmediate.cpp: Removed.
* runtime/JSImmediate.h: Removed.
* runtime/JSNumberCell.cpp: Removed.
* runtime/JSNumberCell.h: Removed.
    - Removed.
* runtime/JSObject.h:
    - Removed JSImmediate.h, JSNumberCell.h.
* runtime/JSString.h:
    - Removed JSImmediate.h, JSNumberCell.h.
* runtime/JSValue.h:
    - Added tags for JSVALUE64, moved out some JSVALUE32_64 methods, unified with JSVALUE64.
* runtime/JSValueInlineMethods.h: Added.
(JSC::JSValue::toInt32):
(JSC::JSValue::toUInt32):
(JSC::JSValue::isUInt32):
(JSC::JSValue::asUInt32):
(JSC::JSValue::uncheckedGetNumber):
(JSC::JSValue::toJSNumber):
(JSC::jsNaN):
(JSC::JSValue::getNumber):
(JSC::JSValue::getBoolean):
(JSC::JSValue::JSValue):
(JSC::JSValue::encode):
(JSC::JSValue::decode):
(JSC::JSValue::operator bool):
(JSC::JSValue::operator==):
(JSC::JSValue::operator!=):
(JSC::JSValue::isUndefined):
(JSC::JSValue::isNull):
(JSC::JSValue::isUndefinedOrNull):
(JSC::JSValue::isCell):
(JSC::JSValue::isInt32):
(JSC::JSValue::isDouble):
(JSC::JSValue::isTrue):
(JSC::JSValue::isFalse):
(JSC::JSValue::tag):
(JSC::JSValue::payload):
(JSC::JSValue::asInt32):
(JSC::JSValue::asDouble):
(JSC::JSValue::asCell):
(JSC::JSValue::isNumber):
(JSC::JSValue::isBoolean):
(JSC::JSValue::makeImmediate):
(JSC::JSValue::immediateValue):
(JSC::reinterpretDoubleToIntptr):
(JSC::reinterpretIntptrToDouble):
    - Methods moved here from JSImmediate.h/JSNumberCell.h/JSValue.h.
* runtime/Operations.h:
    - Removed JSImmediate.h, JSNumberCell.h.
* wtf/StdLibExtras.h:
    - Export bitwise_cast.

Source/WebCore: 

JSNumberCell.h has been deprecated.

* ForwardingHeaders/runtime/JSNumberCell.h: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
* bridge/c/c_instance.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5f121e26
......@@ -107,10 +107,8 @@ LOCAL_SRC_FILES := \
runtime/JSGlobalData.cpp \
runtime/JSGlobalObject.cpp \
runtime/JSGlobalObjectFunctions.cpp \
runtime/JSImmediate.cpp \
runtime/JSLock.cpp \
runtime/JSNotAnObject.cpp \
runtime/JSNumberCell.cpp \
runtime/JSONObject.cpp \
runtime/JSObject.cpp \
runtime/JSPropertyNameIterator.cpp \
......
......@@ -117,10 +117,8 @@ SET(JavaScriptCore_SOURCES
runtime/JSGlobalData.cpp
runtime/JSGlobalObject.cpp
runtime/JSGlobalObjectFunctions.cpp
runtime/JSImmediate.cpp
runtime/JSLock.cpp
runtime/JSNotAnObject.cpp
runtime/JSNumberCell.cpp
runtime/JSObject.cpp
runtime/JSObjectWithGlobalObject.cpp
runtime/JSONObject.cpp
......
2011-04-09 Gavin Barraclough <barraclough@apple.com>
Reviewed by Sam Weinig.
Bug 58198 - Clean up JSValue implementation for JSVALUE64
Remove JSNumberCell, JSImmediate, unify some methods between JSVALUE32_64/JSVALUE64
JSNumberCell.h largely just contained the constructors for JSValue on JSVALUE64,
which should not have been here. JSImmediate mostly contained uncalled methods,
along with the internal implementation of the JSValue constructors split unnecessarily
across a number of layers of function calls. These could largely be merged back
together. Many methods and constructors from JSVALUE32_64 and JSVALUE64 can by unified.
The .cpp files were empty.
Moving all these methods into JSValue.h seems to be a repro measurable regression, so
I have kept these methods in a separate JSValueInlineMethods.h. Adding the 64-bit tag
values as static const members of JSValue also measures as a repro regression, so I
have made these #defines.
* Android.mk:
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.exp:
* JavaScriptCore.gypi:
* JavaScriptCore.pro:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
- Removed JSImmediate.h, JSNumberCell.h.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
- Removed class JSImmediate.
* dfg/DFGNonSpeculativeJIT.cpp:
(JSC::DFG::NonSpeculativeJIT::compile):
- Removed class JSImmediate.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compile):
- Removed class JSImmediate.
* jit/JITArithmetic.cpp:
(JSC::JIT::compileBinaryArithOpSlowCase):
- Removed class JSImmediate.
* jit/JITInlineMethods.h:
(JSC::JIT::emitJumpIfJSCell):
(JSC::JIT::emitJumpIfNotJSCell):
(JSC::JIT::emitJumpIfImmediateInteger):
(JSC::JIT::emitJumpIfNotImmediateInteger):
(JSC::JIT::emitFastArithDeTagImmediate):
(JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
(JSC::JIT::emitFastArithReTagImmediate):
(JSC::JIT::emitTagAsBoolImmediate):
- Removed class JSImmediate.
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emitSlow_op_not):
- Removed class JSImmediate.
* jit/JSInterfaceJIT.h:
- Removed class JSImmediate.
* runtime/JSCell.h:
- Removed JSImmediate.h, JSNumberCell.h.
* runtime/JSImmediate.cpp: Removed.
* runtime/JSImmediate.h: Removed.
* runtime/JSNumberCell.cpp: Removed.
* runtime/JSNumberCell.h: Removed.
- Removed.
* runtime/JSObject.h:
- Removed JSImmediate.h, JSNumberCell.h.
* runtime/JSString.h:
- Removed JSImmediate.h, JSNumberCell.h.
* runtime/JSValue.h:
- Added tags for JSVALUE64, moved out some JSVALUE32_64 methods, unified with JSVALUE64.
* runtime/JSValueInlineMethods.h: Added.
(JSC::JSValue::toInt32):
(JSC::JSValue::toUInt32):
(JSC::JSValue::isUInt32):
(JSC::JSValue::asUInt32):
(JSC::JSValue::uncheckedGetNumber):
(JSC::JSValue::toJSNumber):
(JSC::jsNaN):
(JSC::JSValue::getNumber):
(JSC::JSValue::getBoolean):
(JSC::JSValue::JSValue):
(JSC::JSValue::encode):
(JSC::JSValue::decode):
(JSC::JSValue::operator bool):
(JSC::JSValue::operator==):
(JSC::JSValue::operator!=):
(JSC::JSValue::isUndefined):
(JSC::JSValue::isNull):
(JSC::JSValue::isUndefinedOrNull):
(JSC::JSValue::isCell):
(JSC::JSValue::isInt32):
(JSC::JSValue::isDouble):
(JSC::JSValue::isTrue):
(JSC::JSValue::isFalse):
(JSC::JSValue::tag):
(JSC::JSValue::payload):
(JSC::JSValue::asInt32):
(JSC::JSValue::asDouble):
(JSC::JSValue::asCell):
(JSC::JSValue::isNumber):
(JSC::JSValue::isBoolean):
(JSC::JSValue::makeImmediate):
(JSC::JSValue::immediateValue):
(JSC::reinterpretDoubleToIntptr):
(JSC::reinterpretIntptrToDouble):
- Methods moved here from JSImmediate.h/JSNumberCell.h/JSValue.h.
* runtime/Operations.h:
- Removed JSImmediate.h, JSNumberCell.h.
* wtf/StdLibExtras.h:
- Export bitwise_cast.
2011-04-11 Thouraya ANDOLSI <thouraya.andolsi@st.com>
Reviewed by Oliver Hunt.
......
......@@ -284,14 +284,10 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp \
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h \
Source/JavaScriptCore/runtime/JSGlobalObject.h \
Source/JavaScriptCore/runtime/JSImmediate.cpp \
Source/JavaScriptCore/runtime/JSImmediate.h \
Source/JavaScriptCore/runtime/JSLock.cpp \
Source/JavaScriptCore/runtime/JSLock.h \
Source/JavaScriptCore/runtime/JSNotAnObject.cpp \
Source/JavaScriptCore/runtime/JSNotAnObject.h \
Source/JavaScriptCore/runtime/JSNumberCell.cpp \
Source/JavaScriptCore/runtime/JSNumberCell.h \
Source/JavaScriptCore/runtime/JSObject.cpp \
Source/JavaScriptCore/runtime/JSObject.h \
Source/JavaScriptCore/runtime/JSObjectWithGlobalObject.cpp \
......@@ -309,6 +305,7 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/JSTypeInfo.h \
Source/JavaScriptCore/runtime/JSValue.cpp \
Source/JavaScriptCore/runtime/JSValue.h \
Source/JavaScriptCore/runtime/JSValueInlineMethods.h \
Source/JavaScriptCore/runtime/JSVariableObject.cpp \
Source/JavaScriptCore/runtime/JSVariableObject.h \
Source/JavaScriptCore/runtime/JSWrapperObject.cpp \
......
......@@ -147,7 +147,6 @@ __ZN3JSC12StringObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10Identifie
__ZN3JSC12StringObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC12StringObject6s_infoE
__ZN3JSC12StringObjectC2EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7UStringE
__ZN3JSC12jsNumberCellEPNS_9ExecStateEd
__ZN3JSC12nonInlineNaNEv
__ZN3JSC13SamplingFlags4stopEv
__ZN3JSC13SamplingFlags5startEv
......
......@@ -81,7 +81,6 @@
'runtime/JSFunction.h',
'runtime/JSGlobalData.h',
'runtime/JSGlobalObject.h',
'runtime/JSImmediate.h',
'runtime/JSLock.h',
'runtime/JSNumberCell.h',
'runtime/JSObject.h',
......@@ -90,6 +89,7 @@
'runtime/JSType.h',
'runtime/JSTypeInfo.h',
'runtime/JSValue.h',
'runtime/JSValueInlineMethods.h',
'runtime/JSVariableObject.h',
'runtime/JSWrapperObject.h',
'runtime/Lookup.h',
......@@ -497,7 +497,6 @@
'runtime/JSGlobalObject.cpp',
'runtime/JSGlobalObjectFunctions.cpp',
'runtime/JSGlobalObjectFunctions.h',
'runtime/JSImmediate.cpp',
'runtime/JSLock.cpp',
'runtime/JSNotAnObject.cpp',
'runtime/JSNotAnObject.h',
......
......@@ -147,10 +147,8 @@ SOURCES += \
runtime/JSGlobalData.cpp \
runtime/JSGlobalObject.cpp \
runtime/JSGlobalObjectFunctions.cpp \
runtime/JSImmediate.cpp \
runtime/JSLock.cpp \
runtime/JSNotAnObject.cpp \
runtime/JSNumberCell.cpp \
runtime/JSObject.cpp \
runtime/JSObjectWithGlobalObject.cpp \
runtime/JSONObject.cpp \
......
......@@ -829,14 +829,6 @@
RelativePath="..\..\runtime\JSGlobalObjectFunctions.h"
>
</File>
<File
RelativePath="..\..\runtime\JSImmediate.cpp"
>
</File>
<File
RelativePath="..\..\runtime\JSImmediate.h"
>
</File>
<File
RelativePath="..\..\runtime\JSLock.cpp"
>
......@@ -853,14 +845,6 @@
RelativePath="..\..\runtime\JSNotAnObject.h"
>
</File>
<File
RelativePath="..\..\runtime\JSNumberCell.cpp"
>
</File>
<File
RelativePath="..\..\runtime\JSNumberCell.h"
>
</File>
<File
RelativePath="..\..\runtime\JSObject.cpp"
>
......@@ -925,6 +909,10 @@
RelativePath="..\..\runtime\JSValue.h"
>
</File>
<File
RelativePath="..\..\runtime\JSValueInlineMethods.h"
>
</File>
<File
RelativePath="..\..\runtime\JSVariableObject.cpp"
>
......
......@@ -1103,7 +1103,7 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, bool b)
RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number)
{
// FIXME: Our hash tables won't hold infinity, so we make a new JSNumberCell each time.
// FIXME: Our hash tables won't hold infinity, so we make a new JSValue each time.
// Later we can do the extra work to handle that like the other cases. They also don't
// work correctly with NaN as a key.
if (isnan(number) || number == HashTraits<double>::emptyValue() || HashTraits<double>::isDeletedValue(number))
......
......@@ -455,7 +455,7 @@ void NonSpeculativeJIT::compile(SpeculationCheckIndexIterator& checkIterator, No
callOperation(dfgConvertJSValueToBoolean, result.gpr(), arg1GPR);
// If we add a DataFormatBool, we should use it here.
m_jit.xor32(TrustedImm32(JSImmediate::FullTagTypeTrue), result.registerID());
m_jit.xor32(TrustedImm32(FullTagTypeTrue), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
}
......@@ -469,7 +469,7 @@ void NonSpeculativeJIT::compile(SpeculationCheckIndexIterator& checkIterator, No
GPRResult result(this);
callOperation(operationCompareLess, result.gpr(), arg1GPR, arg2GPR);
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
......@@ -484,7 +484,7 @@ void NonSpeculativeJIT::compile(SpeculationCheckIndexIterator& checkIterator, No
GPRResult result(this);
callOperation(operationCompareLessEq, result.gpr(), arg1GPR, arg2GPR);
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
......@@ -499,7 +499,7 @@ void NonSpeculativeJIT::compile(SpeculationCheckIndexIterator& checkIterator, No
GPRResult result(this);
callOperation(operationCompareEq, result.gpr(), arg1GPR, arg2GPR);
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
......@@ -514,7 +514,7 @@ void NonSpeculativeJIT::compile(SpeculationCheckIndexIterator& checkIterator, No
GPRResult result(this);
callOperation(operationCompareStrictEq, result.gpr(), arg1GPR, arg2GPR);
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
......
......@@ -439,9 +439,9 @@ bool SpeculativeJIT::compile(Node& node)
GPRTemporary result(this); // FIXME: We could reuse, but on speculation fail would need recovery to restore tag (akin to add).
m_jit.move(value.registerID(), result.registerID());
m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(JSImmediate::FullTagTypeFalse)), result.registerID());
m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(FullTagTypeFalse)), result.registerID());
speculationCheck(m_jit.branchTestPtr(JITCompiler::NonZero, result.registerID(), TrustedImm32(static_cast<int32_t>(~1))));
m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(JSImmediate::FullTagTypeTrue)), result.registerID());
m_jit.xorPtr(TrustedImm32(static_cast<int32_t>(FullTagTypeTrue)), result.registerID());
// If we add a DataFormatBool, we should use it here.
jsValueResult(result.gpr(), m_compileIndex);
......@@ -456,7 +456,7 @@ bool SpeculativeJIT::compile(Node& node)
m_jit.set32Compare32(JITCompiler::LessThan, op1.registerID(), op2.registerID(), result.registerID());
// If we add a DataFormatBool, we should use it here.
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
}
......@@ -469,7 +469,7 @@ bool SpeculativeJIT::compile(Node& node)
m_jit.set32Compare32(JITCompiler::LessThanOrEqual, op1.registerID(), op2.registerID(), result.registerID());
// If we add a DataFormatBool, we should use it here.
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
}
......@@ -482,7 +482,7 @@ bool SpeculativeJIT::compile(Node& node)
m_jit.set32Compare32(JITCompiler::Equal, op1.registerID(), op2.registerID(), result.registerID());
// If we add a DataFormatBool, we should use it here.
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
}
......@@ -495,7 +495,7 @@ bool SpeculativeJIT::compile(Node& node)
m_jit.set32Compare32(JITCompiler::Equal, op1.registerID(), op2.registerID(), result.registerID());
// If we add a DataFormatBool, we should use it here.
m_jit.or32(TrustedImm32(JSImmediate::FullTagTypeFalse), result.registerID());
m_jit.or32(TrustedImm32(FullTagTypeFalse), result.registerID());
jsValueResult(result.gpr(), m_compileIndex);
break;
}
......
......@@ -966,7 +966,7 @@ void JIT::compileBinaryArithOp(OpcodeID opcodeID, unsigned, unsigned op1, unsign
void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned result, unsigned op1, unsigned op2, OperandTypes types, bool op1HasImmediateIntFastCase, bool op2HasImmediateIntFastCase)
{
// We assume that subtracting TagTypeNumber is equivalent to adding DoubleEncodeOffset.
COMPILE_ASSERT(((JSImmediate::TagTypeNumber + JSImmediate::DoubleEncodeOffset) == 0), TagTypeNumber_PLUS_DoubleEncodeOffset_EQUALS_0);
COMPILE_ASSERT(((TagTypeNumber + DoubleEncodeOffset) == 0), TagTypeNumber_PLUS_DoubleEncodeOffset_EQUALS_0);
Jump notImm1;
Jump notImm2;
......
......@@ -709,7 +709,7 @@ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfJSCell(RegisterID reg)
#if USE(JSVALUE64)
return branchTestPtr(Zero, reg, tagMaskRegister);
#else
return branchTest32(Zero, reg, TrustedImm32(JSImmediate::TagMask));
return branchTest32(Zero, reg, TrustedImm32(TagMask));
#endif
}
......@@ -730,7 +730,7 @@ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotJSCell(RegisterID reg)
#if USE(JSVALUE64)
return branchTestPtr(NonZero, reg, tagMaskRegister);
#else
return branchTest32(NonZero, reg, TrustedImm32(JSImmediate::TagMask));
return branchTest32(NonZero, reg, TrustedImm32(TagMask));
#endif
}
......@@ -771,7 +771,7 @@ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfImmediateInteger(RegisterID reg)
#if USE(JSVALUE64)
return branchPtr(AboveOrEqual, reg, tagTypeNumberRegister);
#else
return branchTest32(NonZero, reg, TrustedImm32(JSImmediate::TagTypeNumber));
return branchTest32(NonZero, reg, TrustedImm32(TagTypeNumber));
#endif
}
......@@ -780,7 +780,7 @@ ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotImmediateInteger(RegisterID reg)
#if USE(JSVALUE64)
return branchPtr(Below, reg, tagTypeNumberRegister);
#else
return branchTest32(Zero, reg, TrustedImm32(JSImmediate::TagTypeNumber));
return branchTest32(Zero, reg, TrustedImm32(TagTypeNumber));
#endif
}
......@@ -809,12 +809,12 @@ ALWAYS_INLINE void JIT::emitJumpSlowCaseIfNotImmediateNumber(RegisterID reg)
#if USE(JSVALUE32_64)
ALWAYS_INLINE void JIT::emitFastArithDeTagImmediate(RegisterID reg)
{
subPtr(TrustedImm32(JSImmediate::TagTypeNumber), reg);
subPtr(TrustedImm32(TagTypeNumber), reg);
}
ALWAYS_INLINE JIT::Jump JIT::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg)
{
return branchSubPtr(Zero, TrustedImm32(JSImmediate::TagTypeNumber), reg);
return branchSubPtr(Zero, TrustedImm32(TagTypeNumber), reg);
}
#endif
......@@ -825,7 +825,7 @@ ALWAYS_INLINE void JIT::emitFastArithReTagImmediate(RegisterID src, RegisterID d
#else
if (src != dest)
move(src, dest);
addPtr(TrustedImm32(JSImmediate::TagTypeNumber), dest);
addPtr(TrustedImm32(TagTypeNumber), dest);
#endif
}
......@@ -845,7 +845,7 @@ ALWAYS_INLINE void JIT::emitFastArithIntToImmNoCheck(RegisterID src, RegisterID
ALWAYS_INLINE void JIT::emitTagAsBoolImmediate(RegisterID reg)
{
or32(TrustedImm32(static_cast<int32_t>(JSImmediate::FullTagTypeFalse)), reg);
or32(TrustedImm32(static_cast<int32_t>(FullTagTypeFalse)), reg);
}
#endif // USE(JSVALUE32_64)
......
......@@ -699,9 +699,9 @@ void JIT::emit_op_not(Instruction* currentInstruction)
// Invert against JSValue(false); if the value was tagged as a boolean, then all bits will be
// clear other than the low bit (which will be 0 or 1 for false or true inputs respectively).
// Then invert against JSValue(true), which will add the tag back in, and flip the low bit.
xorPtr(TrustedImm32(static_cast<int32_t>(JSImmediate::FullTagTypeFalse)), regT0);
xorPtr(TrustedImm32(static_cast<int32_t>(FullTagTypeFalse)), regT0);
addSlowCase(branchTestPtr(NonZero, regT0, TrustedImm32(static_cast<int32_t>(~1))));
xorPtr(TrustedImm32(static_cast<int32_t>(JSImmediate::FullTagTypeTrue)), regT0);
xorPtr(TrustedImm32(static_cast<int32_t>(FullTagTypeTrue)), regT0);
emitPutVirtualRegister(currentInstruction[1].u.operand);
}
......@@ -736,7 +736,7 @@ void JIT::emit_op_jeq_null(Instruction* currentInstruction)
// Now handle the immediate cases - undefined & null
isImmediate.link(this);
andPtr(TrustedImm32(~JSImmediate::ExtendedTagBitUndefined), regT0);
andPtr(TrustedImm32(~ExtendedTagBitUndefined), regT0);
addJump(branchPtr(Equal, regT0, TrustedImmPtr(JSValue::encode(jsNull()))), target);
wasNotImmediate.link(this);
......@@ -757,7 +757,7 @@ void JIT::emit_op_jneq_null(Instruction* currentInstruction)
// Now handle the immediate cases - undefined & null
isImmediate.link(this);
andPtr(TrustedImm32(~JSImmediate::ExtendedTagBitUndefined), regT0);
andPtr(TrustedImm32(~ExtendedTagBitUndefined), regT0);
addJump(branchPtr(NotEqual, regT0, TrustedImmPtr(JSValue::encode(jsNull()))), target);
wasNotImmediate.link(this);
......@@ -914,8 +914,8 @@ void JIT::emit_op_get_pnames(Instruction* currentInstruction)
isNotObject.link(this);
move(regT0, regT1);
and32(TrustedImm32(~JSImmediate::ExtendedTagBitUndefined), regT1);
addJump(branch32(Equal, regT1, TrustedImm32(JSImmediate::FullTagTypeNull)), breakTarget);
and32(TrustedImm32(~ExtendedTagBitUndefined), regT1);
addJump(branch32(Equal, regT1, TrustedImm32(FullTagTypeNull)), breakTarget);
JITStubCall toObjectStubCall(this, cti_to_object);
toObjectStubCall.addArgument(regT0);
......@@ -1168,8 +1168,8 @@ void JIT::emit_op_eq_null(Instruction* currentInstruction)
isImmediate.link(this);
andPtr(TrustedImm32(~JSImmediate::ExtendedTagBitUndefined), regT0);
setPtr(Equal, regT0, TrustedImm32(JSImmediate::FullTagTypeNull), regT0);
andPtr(TrustedImm32(~ExtendedTagBitUndefined), regT0);
setPtr(Equal, regT0, TrustedImm32(FullTagTypeNull), regT0);
wasNotImmediate.link(this);
......@@ -1193,8 +1193,8 @@ void JIT::emit_op_neq_null(Instruction* currentInstruction)
isImmediate.link(this);
andPtr(TrustedImm32(~JSImmediate::ExtendedTagBitUndefined), regT0);
setPtr(NotEqual, regT0, TrustedImm32(JSImmediate::FullTagTypeNull), regT0);
andPtr(TrustedImm32(~ExtendedTagBitUndefined), regT0);
setPtr(NotEqual, regT0, TrustedImm32(FullTagTypeNull), regT0);
wasNotImmediate.link(this);
......@@ -1379,7 +1379,7 @@ void JIT::emitSlow_op_put_by_val(Instruction* currentInstruction, Vector<SlowCas
void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
{
linkSlowCase(iter);
xorPtr(TrustedImm32(static_cast<int32_t>(JSImmediate::FullTagTypeFalse)), regT0);
xorPtr(TrustedImm32(static_cast<int32_t>(FullTagTypeFalse)), regT0);
JITStubCall stubCall(this, cti_op_not);
stubCall.addArgument(regT0);
stubCall.call(currentInstruction[1].u.operand);
......
......@@ -28,7 +28,6 @@
#include "JITCode.h"
#include "JITStubs.h"
#include "JSImmediate.h"
#include "JSValue.h"
#include "MacroAssembler.h"
#include "RegisterFile.h"
......@@ -188,7 +187,7 @@ namespace JSC {
static const unsigned Int32Tag = 0xffffffff;
COMPILE_ASSERT(Int32Tag == JSValue::Int32Tag, Int32Tag_out_of_sync);
#else
static const unsigned Int32Tag = JSImmediate::TagTypeNumber >> 32;
static const unsigned Int32Tag = TagTypeNumber >> 32;
#endif
inline Jump emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID payload);
inline Jump emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst);
......
......@@ -27,9 +27,8 @@
#include "CallFrame.h"
#include "ConstructData.h"
#include "Heap.h"
#include "JSImmediate.h"
#include "JSLock.h"
#include "JSValue.h"
#include "JSValueInlineMethods.h"
#include "MarkStack.h"
#include "UString.h"
#include <wtf/Noncopyable.h>
......
/*
* Copyright (C) 2003-2006, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "JSImmediate.h"
namespace JSC {
} // namespace JSC
This diff is collapsed.
/*
* Copyright (C) 1999-2002 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2004, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "JSNumberCell.h"
#include "JSObject.h"
#include "ScopeChain.h"
// Keep our exported symbols lists happy.
namespace JSC {
JSValue jsNumberCell(ExecState*, double);
JSValue jsNumberCell(ExecState*, double)
{
ASSERT_NOT_REACHED();
return JSValue();
}
} // namespace JSC
/*
* Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
* Copyright (C) 2001 Peter Kelly (pmk@post.com)
* Copyright (C) 2003, 2004, 2005, 2007, 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License