Bug 58198 - Clean up JSValue implementation for JSVALUE64
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 18:29:14 +0000 (18:29 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Apr 2011 18:29:14 +0000 (18:29 +0000)
commitfced2362fdc2b3c84a82ed111ace1cef4dcc5ff0
tree823c8708d95e994dbe386a0d8c3afb7963a273bb
parent1b73e16c1207378fde3f9522ef1b6e296f51ce19
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: https://svn.webkit.org/repository/webkit/trunk@83459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
Source/JavaScriptCore/Android.mk
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.pro
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/dfg/DFGNonSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/jit/JITArithmetic.cpp
Source/JavaScriptCore/jit/JITInlineMethods.h
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JSInterfaceJIT.h
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSImmediate.cpp [deleted file]
Source/JavaScriptCore/runtime/JSImmediate.h [deleted file]
Source/JavaScriptCore/runtime/JSNumberCell.cpp [deleted file]
Source/JavaScriptCore/runtime/JSNumberCell.h [deleted file]
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSString.h
Source/JavaScriptCore/runtime/JSValue.h
Source/JavaScriptCore/runtime/JSValueInlineMethods.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/Operations.h
Source/JavaScriptCore/wtf/StdLibExtras.h
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/runtime/JSNumberCell.h [deleted file]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bridge/c/c_instance.cpp