Commit 5b67d9e4 authored by oliver@apple.com's avatar oliver@apple.com

2010-10-25 Oliver Hunt <oliver@apple.com>

        Reviewed by Gavin Barraclough.

        Remove exec and globalData arguments from jsNumber
        https://bugs.webkit.org/show_bug.cgi?id=48270

        Remove the now unused exec and globalData arguments from jsNumber
        and mechanically update all users of jsNumber.

        * API/JSValueRef.cpp:
        (JSValueMakeNumber):
        * bytecompiler/BytecodeGenerator.cpp:
        (JSC::BytecodeGenerator::emitLoad):
        * bytecompiler/NodesCodegen.cpp:
        (JSC::ArrayNode::emitBytecode):
        * jit/JITArithmetic.cpp:
        (JSC::JIT::emit_op_mod):
        * jit/JITArithmetic32_64.cpp:
        (JSC::JIT::emit_op_mod):
        * jit/JITOpcodes.cpp:
        (JSC::JIT::emit_op_jfalse):
        (JSC::JIT::emit_op_jtrue):
        * jit/JITStubs.cpp:
        (JSC::DEFINE_STUB_FUNCTION):
        * jsc.cpp:
        (functionRun):
        * runtime/Arguments.cpp:
        (JSC::Arguments::getOwnPropertySlot):
        (JSC::Arguments::getOwnPropertyDescriptor):
        * runtime/ArrayConstructor.cpp:
        (JSC::ArrayConstructor::ArrayConstructor):
        * runtime/ArrayPrototype.cpp:
        (JSC::arrayProtoFuncPop):
        (JSC::arrayProtoFuncPush):
        (JSC::arrayProtoFuncShift):
        (JSC::arrayProtoFuncSplice):
        (JSC::arrayProtoFuncUnShift):
        (JSC::arrayProtoFuncFilter):
        (JSC::arrayProtoFuncMap):
        (JSC::arrayProtoFuncEvery):
        (JSC::arrayProtoFuncForEach):
        (JSC::arrayProtoFuncSome):
        (JSC::arrayProtoFuncReduce):
        (JSC::arrayProtoFuncReduceRight):
        (JSC::arrayProtoFuncIndexOf):
        (JSC::arrayProtoFuncLastIndexOf):
        * runtime/BooleanConstructor.cpp:
        (JSC::BooleanConstructor::BooleanConstructor):
        * runtime/CachedTranscendentalFunction.h:
        (JSC::CachedTranscendentalFunction::operator()):
        * runtime/DateConstructor.cpp:
        (JSC::DateConstructor::DateConstructor):
        (JSC::dateParse):
        (JSC::dateNow):
        (JSC::dateUTC):
        * runtime/DateInstance.cpp:
        (JSC::DateInstance::DateInstance):
        * runtime/DatePrototype.cpp:
        (JSC::dateProtoFuncGetFullYear):
        (JSC::dateProtoFuncGetUTCFullYear):
        (JSC::dateProtoFuncGetMonth):
        (JSC::dateProtoFuncGetUTCMonth):
        (JSC::dateProtoFuncGetDate):
        (JSC::dateProtoFuncGetUTCDate):
        (JSC::dateProtoFuncGetDay):
        (JSC::dateProtoFuncGetUTCDay):
        (JSC::dateProtoFuncGetHours):
        (JSC::dateProtoFuncGetUTCHours):
        (JSC::dateProtoFuncGetMinutes):
        (JSC::dateProtoFuncGetUTCMinutes):
        (JSC::dateProtoFuncGetSeconds):
        (JSC::dateProtoFuncGetUTCSeconds):
        (JSC::dateProtoFuncGetMilliSeconds):
        (JSC::dateProtoFuncGetUTCMilliseconds):
        (JSC::dateProtoFuncGetTimezoneOffset):
        (JSC::dateProtoFuncSetTime):
        (JSC::setNewValueFromTimeArgs):
        (JSC::setNewValueFromDateArgs):
        (JSC::dateProtoFuncSetYear):
        (JSC::dateProtoFuncGetYear):
        * runtime/Error.cpp:
        (JSC::addErrorSourceInfo):
        (JSC::addErrorDivotInfo):
        * runtime/ErrorConstructor.cpp:
        (JSC::ErrorConstructor::ErrorConstructor):
        * runtime/FunctionConstructor.cpp:
        (JSC::FunctionConstructor::FunctionConstructor):
        * runtime/FunctionPrototype.cpp:
        (JSC::FunctionPrototype::FunctionPrototype):
        * runtime/JSArray.cpp:
        (JSC::JSArray::getOwnPropertySlot):
        (JSC::JSArray::getOwnPropertyDescriptor):
        * runtime/JSByteArray.cpp:
        (JSC::JSByteArray::JSByteArray):
        * runtime/JSByteArray.h:
        (JSC::JSByteArray::getIndex):
        * runtime/JSFunction.cpp:
        (JSC::JSFunction::JSFunction):
        (JSC::JSFunction::lengthGetter):
        (JSC::JSFunction::getOwnPropertyDescriptor):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::reset):
        * runtime/JSGlobalObjectFunctions.cpp:
        (JSC::globalFuncParseInt):
        (JSC::globalFuncParseFloat):
        * runtime/JSNumberCell.h:
        (JSC::JSValue::JSValue):
        (JSC::jsNaN):
        (JSC::JSValue::toJSNumber):
        * runtime/JSONObject.cpp:
        (JSC::unwrapBoxedPrimitive):
        (JSC::PropertyNameForFunctionCall::value):
        (JSC::JSONStringify):
        * runtime/JSString.cpp:
        (JSC::JSString::getStringPropertyDescriptor):
        * runtime/JSString.h:
        (JSC::JSString::getStringPropertySlot):
        * runtime/JSValue.h:
        (JSC::jsDoubleNumber):
        (JSC::jsNumber):
        (JSC::jsNaN):
        (JSC::JSValue::JSValue):
        (JSC::JSValue::toJSNumber):
        * runtime/LiteralParser.cpp:
        (JSC::LiteralParser::parse):
        * runtime/MathObject.cpp:
        (JSC::MathObject::MathObject):
        (JSC::mathProtoFuncAbs):
        (JSC::mathProtoFuncACos):
        (JSC::mathProtoFuncASin):
        (JSC::mathProtoFuncATan):
        (JSC::mathProtoFuncATan2):
        (JSC::mathProtoFuncCeil):
        (JSC::mathProtoFuncCos):
        (JSC::mathProtoFuncExp):
        (JSC::mathProtoFuncFloor):
        (JSC::mathProtoFuncLog):
        (JSC::mathProtoFuncMax):
        (JSC::mathProtoFuncMin):
        (JSC::mathProtoFuncPow):
        (JSC::mathProtoFuncRandom):
        (JSC::mathProtoFuncRound):
        (JSC::mathProtoFuncSin):
        (JSC::mathProtoFuncSqrt):
        (JSC::mathProtoFuncTan):
        * runtime/NativeErrorConstructor.cpp:
        (JSC::NativeErrorConstructor::NativeErrorConstructor):
        * runtime/NumberConstructor.cpp:
        (JSC::NumberConstructor::NumberConstructor):
        (JSC::numberConstructorNaNValue):
        (JSC::numberConstructorNegInfinity):
        (JSC::numberConstructorPosInfinity):
        (JSC::numberConstructorMaxValue):
        (JSC::numberConstructorMinValue):
        (JSC::constructWithNumberConstructor):
        (JSC::callNumberConstructor):
        * runtime/NumberPrototype.cpp:
        (JSC::NumberPrototype::NumberPrototype):
        * runtime/ObjectConstructor.cpp:
        (JSC::ObjectConstructor::ObjectConstructor):
        * runtime/Operations.cpp:
        (JSC::jsAddSlowCase):
        * runtime/Operations.h:
        (JSC::jsAdd):
        * runtime/PrototypeFunction.cpp:
        (JSC::PrototypeFunction::PrototypeFunction):
        * runtime/RegExpConstructor.cpp:
        (JSC::RegExpConstructor::RegExpConstructor):
        (JSC::RegExpMatchesArray::fillArrayInstance):
        * runtime/RegExpObject.cpp:
        (JSC::regExpObjectLastIndex):
        * runtime/StringConstructor.cpp:
        (JSC::StringConstructor::StringConstructor):
        * runtime/StringPrototype.cpp:
        (JSC::StringPrototype::StringPrototype):
        (JSC::stringProtoFuncReplace):
        (JSC::stringProtoFuncCharCodeAt):
        (JSC::stringProtoFuncIndexOf):
        (JSC::stringProtoFuncLastIndexOf):
        (JSC::stringProtoFuncSearch):
        (JSC::stringProtoFuncLocaleCompare):
2010-10-25  Oliver Hunt  <oliver@apple.com>

        Reviewed by Gavin Barraclough.

        Remove exec and globalData arguments from jsNumber
        https://bugs.webkit.org/show_bug.cgi?id=48270

        Don't pass exec to jsNumber

        * JSUtils.cpp:
        (JSObjectKJSValue):
        * UserObjectImp.cpp:
        (UserObjectImp::toPrimitive):
2010-10-25  Oliver Hunt  <oliver@apple.com>

        Reviewed by Gavin Barraclough.

        Remove exec and globalData arguments from jsNumber
        https://bugs.webkit.org/show_bug.cgi?id=48270

        Mechanical removal of exec parameter to jsNumber.

        * bindings/js/JSAudioConstructor.cpp:
        (WebCore::JSAudioConstructor::JSAudioConstructor):
        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
        (WebCore::JSCSSStyleDeclaration::nameGetter):
        * bindings/js/JSCoordinatesCustom.cpp:
        (WebCore::JSCoordinates::altitude):
        (WebCore::JSCoordinates::altitudeAccuracy):
        (WebCore::JSCoordinates::heading):
        (WebCore::JSCoordinates::speed):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::setTimeout):
        (WebCore::JSDOMWindow::setInterval):
        * bindings/js/JSDeviceMotionEventCustom.cpp:
        (WebCore::createAccelerationObject):
        (WebCore::createRotationRateObject):
        (WebCore::JSDeviceMotionEvent::interval):
        * bindings/js/JSDeviceOrientationEventCustom.cpp:
        (WebCore::JSDeviceOrientationEvent::alpha):
        (WebCore::JSDeviceOrientationEvent::beta):
        (WebCore::JSDeviceOrientationEvent::gamma):
        * bindings/js/JSGeolocationCustom.cpp:
        (WebCore::JSGeolocation::watchPosition):
        * bindings/js/JSHTMLInputElementCustom.cpp:
        (WebCore::JSHTMLInputElement::selectionStart):
        (WebCore::JSHTMLInputElement::selectionEnd):
        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
        (WebCore::JSHTMLOptionsCollection::length):
        * bindings/js/JSIDBKeyCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSInjectedScriptHostCustom.cpp:
        (WebCore::InjectedScriptHost::createInjectedScript):
        (WebCore::JSInjectedScriptHost::pushNodePathToFrontend):
        * bindings/js/JSOptionConstructor.cpp:
        (WebCore::JSOptionConstructor::JSOptionConstructor):
        * bindings/js/JSSQLResultSetRowListCustom.cpp:
        (WebCore::JSSQLResultSetRowList::item):
        * bindings/js/JSSVGLengthCustom.cpp:
        (WebCore::JSSVGLength::value):
        * bindings/js/JSScriptProfileNodeCustom.cpp:
        (WebCore::JSScriptProfileNode::callUID):
        * bindings/js/JSWebGLRenderingContextCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSWorkerContextCustom.cpp:
        (WebCore::JSWorkerContext::setTimeout):
        (WebCore::JSWorkerContext::setInterval):
        * bindings/js/JSWorkerContextErrorHandler.cpp:
        (WebCore::JSWorkerContextErrorHandler::handleEvent):
        * bindings/js/ScriptFunctionCall.cpp:
        (WebCore::ScriptCallArgumentHandler::appendArgument):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::CloneDeserializer::readTerminal):
        * bindings/scripts/CodeGeneratorJS.pm:
        * bridge/c/c_instance.cpp:
        (JSC::Bindings::CInstance::numberValue):
        * bridge/c/c_utility.cpp:
        (JSC::Bindings::convertNPVariantToValue):
        * bridge/jni/jsc/JNIBridgeJSC.cpp:
        (JavaField::valueFromInstance):
        (JavaArray::valueAt):
        * bridge/jni/jsc/JavaInstanceJSC.cpp:
        (JavaInstance::numberValue):
        (JavaInstance::invokeMethod):
        * bridge/objc/objc_instance.mm:
        (ObjcInstance::numberValue):
        * bridge/objc/objc_utility.mm:
        (JSC::Bindings::convertObjcValueToValue):
        * bridge/runtime_array.cpp:
        (JSC::RuntimeArray::lengthGetter):
        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::lengthGetter):
2010-10-25  Oliver Hunt  <oliver@apple.com>

        Reviewed by Gavin Barraclough.

        Remove exec and globalData arguments from jsNumber
        https://bugs.webkit.org/show_bug.cgi?id=48270

        Mechanical removal of exec parameter to jsNumber

        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
        (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray):
        * Plugins/Hosted/ProxyInstance.mm:
        (WebKit::ProxyInstance::numberValue):
2010-10-25  Oliver Hunt  <oliver@apple.com>

        Reviewed by Gavin Barraclough.

        Remove exec and globalData arguments from jsNumber
        https://bugs.webkit.org/show_bug.cgi?id=48270

        Mechanical removal of exec parameter to jsNumber

        * WebProcess/Plugins/NPRuntimeObjectMap.cpp:
        (WebKit::NPRuntimeObjectMap::convertNPVariantToJSValue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7b38a736
......@@ -219,7 +219,7 @@ JSValueRef JSValueMakeNumber(JSContextRef ctx, double value)
if (isnan(value))
value = NaN;
return toRef(exec, jsNumber(exec, value));
return toRef(exec, jsNumber(value));
}
JSValueRef JSValueMakeString(JSContextRef ctx, JSStringRef string)
......
2010-10-25 Oliver Hunt <oliver@apple.com>
Reviewed by Gavin Barraclough.
Remove exec and globalData arguments from jsNumber
https://bugs.webkit.org/show_bug.cgi?id=48270
Remove the now unused exec and globalData arguments from jsNumber
and mechanically update all users of jsNumber.
* API/JSValueRef.cpp:
(JSValueMakeNumber):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitLoad):
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_mod):
* jit/JITArithmetic32_64.cpp:
(JSC::JIT::emit_op_mod):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* jsc.cpp:
(functionRun):
* runtime/Arguments.cpp:
(JSC::Arguments::getOwnPropertySlot):
(JSC::Arguments::getOwnPropertyDescriptor):
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::ArrayConstructor):
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncFilter):
(JSC::arrayProtoFuncMap):
(JSC::arrayProtoFuncEvery):
(JSC::arrayProtoFuncForEach):
(JSC::arrayProtoFuncSome):
(JSC::arrayProtoFuncReduce):
(JSC::arrayProtoFuncReduceRight):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
* runtime/BooleanConstructor.cpp:
(JSC::BooleanConstructor::BooleanConstructor):
* runtime/CachedTranscendentalFunction.h:
(JSC::CachedTranscendentalFunction::operator()):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::DateConstructor):
(JSC::dateParse):
(JSC::dateNow):
(JSC::dateUTC):
* runtime/DateInstance.cpp:
(JSC::DateInstance::DateInstance):
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetMilliSeconds):
(JSC::dateProtoFuncGetUTCMilliseconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::dateProtoFuncSetTime):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear):
* runtime/Error.cpp:
(JSC::addErrorSourceInfo):
(JSC::addErrorDivotInfo):
* runtime/ErrorConstructor.cpp:
(JSC::ErrorConstructor::ErrorConstructor):
* runtime/FunctionConstructor.cpp:
(JSC::FunctionConstructor::FunctionConstructor):
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::FunctionPrototype):
* runtime/JSArray.cpp:
(JSC::JSArray::getOwnPropertySlot):
(JSC::JSArray::getOwnPropertyDescriptor):
* runtime/JSByteArray.cpp:
(JSC::JSByteArray::JSByteArray):
* runtime/JSByteArray.h:
(JSC::JSByteArray::getIndex):
* runtime/JSFunction.cpp:
(JSC::JSFunction::JSFunction):
(JSC::JSFunction::lengthGetter):
(JSC::JSFunction::getOwnPropertyDescriptor):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncParseInt):
(JSC::globalFuncParseFloat):
* runtime/JSNumberCell.h:
(JSC::JSValue::JSValue):
(JSC::jsNaN):
(JSC::JSValue::toJSNumber):
* runtime/JSONObject.cpp:
(JSC::unwrapBoxedPrimitive):
(JSC::PropertyNameForFunctionCall::value):
(JSC::JSONStringify):
* runtime/JSString.cpp:
(JSC::JSString::getStringPropertyDescriptor):
* runtime/JSString.h:
(JSC::JSString::getStringPropertySlot):
* runtime/JSValue.h:
(JSC::jsDoubleNumber):
(JSC::jsNumber):
(JSC::jsNaN):
(JSC::JSValue::JSValue):
(JSC::JSValue::toJSNumber):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser::parse):
* runtime/MathObject.cpp:
(JSC::MathObject::MathObject):
(JSC::mathProtoFuncAbs):
(JSC::mathProtoFuncACos):
(JSC::mathProtoFuncASin):
(JSC::mathProtoFuncATan):
(JSC::mathProtoFuncATan2):
(JSC::mathProtoFuncCeil):
(JSC::mathProtoFuncCos):
(JSC::mathProtoFuncExp):
(JSC::mathProtoFuncFloor):
(JSC::mathProtoFuncLog):
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):
(JSC::mathProtoFuncPow):
(JSC::mathProtoFuncRandom):
(JSC::mathProtoFuncRound):
(JSC::mathProtoFuncSin):
(JSC::mathProtoFuncSqrt):
(JSC::mathProtoFuncTan):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::NativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::NumberConstructor):
(JSC::numberConstructorNaNValue):
(JSC::numberConstructorNegInfinity):
(JSC::numberConstructorPosInfinity):
(JSC::numberConstructorMaxValue):
(JSC::numberConstructorMinValue):
(JSC::constructWithNumberConstructor):
(JSC::callNumberConstructor):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::NumberPrototype):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::ObjectConstructor):
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Operations.h:
(JSC::jsAdd):
* runtime/PrototypeFunction.cpp:
(JSC::PrototypeFunction::PrototypeFunction):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::RegExpConstructor):
(JSC::RegExpMatchesArray::fillArrayInstance):
* runtime/RegExpObject.cpp:
(JSC::regExpObjectLastIndex):
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::StringConstructor):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::StringPrototype):
(JSC::stringProtoFuncReplace):
(JSC::stringProtoFuncCharCodeAt):
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):
(JSC::stringProtoFuncSearch):
(JSC::stringProtoFuncLocaleCompare):
2010-10-25 David Tapuska <dtapuska@rim.com>
Reviewed by David Kilzer.
......
......@@ -1080,10 +1080,10 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number)
// FIXME: Our hash tables won't hold infinity, so we make a new JSNumberCell each time.
// Later we can do the extra work to handle that like the other cases.
if (number == HashTraits<double>::emptyValue() || HashTraits<double>::isDeletedValue(number))
return emitLoad(dst, jsNumber(globalData(), number));
return emitLoad(dst, jsNumber(number));
JSValue& valueInMap = m_numberMap.add(number, JSValue()).first->second;
if (!valueInMap)
valueInMap = jsNumber(globalData(), number);
valueInMap = jsNumber(number);
return emitLoad(dst, valueInMap);
}
......
......@@ -208,7 +208,7 @@ RegisterID* ArrayNode::emitBytecode(BytecodeGenerator& generator, RegisterID* ds
}
if (m_elision) {
RegisterID* value = generator.emitLoad(0, jsNumber(generator.globalData(), m_elision + length));
RegisterID* value = generator.emitLoad(0, jsNumber(m_elision + length));
generator.emitPutById(array.get(), generator.propertyNames().length, value);
}
......
......@@ -888,7 +888,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
emitJumpSlowCaseIfNotImmediateInteger(regT0);
emitJumpSlowCaseIfNotImmediateInteger(regT2);
addSlowCase(branchPtr(Equal, regT2, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0)))));
addSlowCase(branchPtr(Equal, regT2, ImmPtr(JSValue::encode(jsNumber(0)))));
m_assembler.cdq();
m_assembler.idivl_r(regT2);
emitFastArithReTagImmediate(regT1, regT0);
......
......@@ -1323,7 +1323,7 @@ void JIT::emit_op_mod(Instruction* currentInstruction)
// If the remainder is zero and the dividend is negative, the result is -0.
Jump storeResult1 = branchTest32(NonZero, X86Registers::edx);
Jump storeResult2 = branchTest32(Zero, X86Registers::ebx, Imm32(0x80000000)); // not negative
emitStore(dst, jsNumber(m_globalData, -0.0));
emitStore(dst, jsNumber(-0.0));
Jump end = jump();
storeResult1.link(this);
......
......@@ -711,7 +711,7 @@ void JIT::emit_op_jfalse(Instruction* currentInstruction)
unsigned target = currentInstruction[2].u.operand;
emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0)))), target);
addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(0)))), target);
Jump isNonZero = emitJumpIfImmediateInteger(regT0);
addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsBoolean(false)))), target);
......@@ -831,7 +831,7 @@ void JIT::emit_op_jtrue(Instruction* currentInstruction)
unsigned target = currentInstruction[2].u.operand;
emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
Jump isZero = branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(m_globalData, 0))));
Jump isZero = branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsNumber(0))));
addJump(emitJumpIfImmediateInteger(regT0), target);
addJump(branchPtr(Equal, regT0, ImmPtr(JSValue::encode(jsBoolean(true)))), target);
......
......@@ -1342,7 +1342,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_add)
double left = 0.0, right;
if (v1.getNumber(left) && v2.getNumber(right))
return JSValue::encode(jsNumber(stackFrame.globalData, left + right));
return JSValue::encode(jsNumber(left + right));
// All other cases are pretty uncommon
JSValue result = jsAddSlowCase(callFrame, v1, v2);
......@@ -1357,7 +1357,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_pre_inc)
JSValue v = stackFrame.args[0].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, v.toNumber(callFrame) + 1);
JSValue result = jsNumber(v.toNumber(callFrame) + 1);
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -1913,10 +1913,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_mul)
double left;
double right;
if (src1.getNumber(left) && src2.getNumber(right))
return JSValue::encode(jsNumber(stackFrame.globalData, left * right));
return JSValue::encode(jsNumber(left * right));
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, src1.toNumber(callFrame) * src2.toNumber(callFrame));
JSValue result = jsNumber(src1.toNumber(callFrame) * src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -2475,10 +2475,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_sub)
double left;
double right;
if (src1.getNumber(left) && src2.getNumber(right))
return JSValue::encode(jsNumber(stackFrame.globalData, left - right));
return JSValue::encode(jsNumber(left - right));
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, src1.toNumber(callFrame) - src2.toNumber(callFrame));
JSValue result = jsNumber(src1.toNumber(callFrame) - src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -2685,10 +2685,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_negate)
double v;
if (src.getNumber(v))
return JSValue::encode(jsNumber(stackFrame.globalData, -v));
return JSValue::encode(jsNumber(-v));
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, -src.toNumber(callFrame));
JSValue result = jsNumber(-src.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -2808,10 +2808,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_div)
double left;
double right;
if (src1.getNumber(left) && src2.getNumber(right))
return JSValue::encode(jsNumber(stackFrame.globalData, left / right));
return JSValue::encode(jsNumber(left / right));
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, src1.toNumber(callFrame) / src2.toNumber(callFrame));
JSValue result = jsNumber(src1.toNumber(callFrame) / src2.toNumber(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -2823,7 +2823,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_pre_dec)
JSValue v = stackFrame.args[0].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, v.toNumber(callFrame) - 1);
JSValue result = jsNumber(v.toNumber(callFrame) - 1);
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -2891,7 +2891,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_post_inc)
JSValue number = v.toJSNumber(callFrame);
CHECK_FOR_EXCEPTION_AT_END();
callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(stackFrame.globalData, number.uncheckedGetNumber() + 1);
callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(number.uncheckedGetNumber() + 1);
return JSValue::encode(number);
}
......@@ -3019,7 +3019,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_lshift)
JSValue shift = stackFrame.args[1].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, (val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f));
JSValue result = jsNumber((val.toInt32(callFrame)) << (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -3033,7 +3033,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitand)
ASSERT(!src1.isInt32() || !src2.isInt32());
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, src1.toInt32(callFrame) & src2.toInt32(callFrame));
JSValue result = jsNumber(src1.toInt32(callFrame) & src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -3046,7 +3046,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_rshift)
JSValue shift = stackFrame.args[1].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, (val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
JSValue result = jsNumber((val.toInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
......@@ -3060,7 +3060,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitnot)
ASSERT(!src.isInt32());
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, ~src.toInt32(callFrame));
JSValue result = jsNumber(~src.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -3134,7 +3134,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_mod)
CallFrame* callFrame = stackFrame.callFrame;
double d = dividendValue.toNumber(callFrame);
JSValue result = jsNumber(stackFrame.globalData, fmod(d, divisorValue.toNumber(callFrame)));
JSValue result = jsNumber(fmod(d, divisorValue.toNumber(callFrame)));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -3160,7 +3160,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_post_dec)
JSValue number = v.toJSNumber(callFrame);
CHECK_FOR_EXCEPTION_AT_END();
callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(stackFrame.globalData, number.uncheckedGetNumber() - 1);
callFrame->registers()[stackFrame.args[1].int32()] = jsNumber(number.uncheckedGetNumber() - 1);
return JSValue::encode(number);
}
......@@ -3172,7 +3172,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_urshift)
JSValue shift = stackFrame.args[1].jsValue();
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, (val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
JSValue result = jsNumber((val.toUInt32(callFrame)) >> (shift.toUInt32(callFrame) & 0x1f));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -3186,7 +3186,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitxor)
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, src1.toInt32(callFrame) ^ src2.toInt32(callFrame));
JSValue result = jsNumber(src1.toInt32(callFrame) ^ src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......@@ -3207,7 +3207,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_bitor)
CallFrame* callFrame = stackFrame.callFrame;
JSValue result = jsNumber(stackFrame.globalData, src1.toInt32(callFrame) | src2.toInt32(callFrame));
JSValue result = jsNumber(src1.toInt32(callFrame) | src2.toInt32(callFrame));
CHECK_FOR_EXCEPTION_AT_END();
return JSValue::encode(result);
}
......
......@@ -220,7 +220,7 @@ EncodedJSValue JSC_HOST_CALL functionRun(ExecState* exec)
evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName));
stopWatch.stop();
return JSValue::encode(jsNumber(globalObject->globalExec(), stopWatch.getElapsedMS()));
return JSValue::encode(jsNumber(stopWatch.getElapsedMS()));
}
EncodedJSValue JSC_HOST_CALL functionLoad(ExecState* exec)
......
......@@ -191,7 +191,7 @@ bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyNa
}
if (propertyName == exec->propertyNames().length && LIKELY(!d->overrodeLength)) {
slot.setValue(jsNumber(exec, d->numArguments));
slot.setValue(jsNumber(d->numArguments));
return true;
}
......@@ -222,7 +222,7 @@ bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& prop
}
if (propertyName == exec->propertyNames().length && LIKELY(!d->overrodeLength)) {
descriptor.setDescriptor(jsNumber(exec, d->numArguments), DontEnum);
descriptor.setDescriptor(jsNumber(d->numArguments), DontEnum);
return true;
}
......
......@@ -45,7 +45,7 @@ ArrayConstructor::ArrayConstructor(ExecState* exec, JSGlobalObject* globalObject
putDirectWithoutTransition(exec->propertyNames().prototype, arrayPrototype, DontEnum | DontDelete | ReadOnly);
// no. of arguments for constructor
putDirectWithoutTransition(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontEnum | DontDelete);
putDirectWithoutTransition(exec->propertyNames().length, jsNumber(1), ReadOnly | DontEnum | DontDelete);
// ES5
putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, globalObject, prototypeFunctionStructure, 1, exec->propertyNames().isArray, arrayConstructorIsArray), DontEnum);
......
......@@ -379,12 +379,12 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPop(ExecState* exec)
JSValue result;
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (length == 0) {
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
result = jsUndefined();
} else {
result = thisObj->get(exec, length - 1);
thisObj->deleteProperty(exec, length - 1);
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length - 1));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - 1));
}
return JSValue::encode(result);
}
......@@ -395,7 +395,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec)
if (isJSArray(&exec->globalData(), thisValue) && exec->argumentCount() == 1) {
JSArray* array = asArray(thisValue);
array->push(exec, exec->argument(0));
return JSValue::encode(jsNumber(exec, array->length()));
return JSValue::encode(jsNumber(array->length()));
}
JSObject* thisObj = thisValue.toThisObject(exec);
......@@ -403,8 +403,8 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec)
for (unsigned n = 0; n < exec->argumentCount(); n++)
thisObj->put(exec, length + n, exec->argument(n));
length += exec->argumentCount();
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
return JSValue::encode(jsNumber(exec, length));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
return JSValue::encode(jsNumber(length));
}
EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec)
......@@ -438,7 +438,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (length == 0) {
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
result = jsUndefined();
} else {
result = thisObj->get(exec, 0);
......@@ -453,7 +453,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
}
thisObj->deleteProperty(exec, length - 1);
}
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length - 1));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - 1));
}
return JSValue::encode(result);
}
......@@ -600,7 +600,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
for (unsigned k = 0; k < additionalArgs; ++k)
thisObj->put(exec, k + begin, exec->argument(k + 2));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length - deleteCount + additionalArgs));
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - deleteCount + additionalArgs));
return JSValue::encode(result);
}
......@@ -625,7 +625,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncUnShift(ExecState* exec)
}
for (unsigned k = 0; k < nrArgs; ++k)
thisObj->put(exec, k, exec->argument(k));
JSValue result = jsNumber(exec, length + nrArgs);
JSValue result = jsNumber(length + nrArgs);
putProperty(exec, thisObj, exec->propertyNames().length, result);
return JSValue::encode(result);
}
......@@ -656,7 +656,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
JSValue v = array->getIndex(k);
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, v);
cachedCall.setArgument(1, jsNumber(exec, k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
......@@ -677,7 +677,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(v);
eachArguments.append(jsNumber(exec, k));
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
JSValue result = call(exec, function, callType, callData, applyThis, eachArguments);
......@@ -714,7 +714,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
cachedCall.setArgument(1, jsNumber(exec, k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
resultArray->JSArray::put(exec, k, cachedCall.call());
......@@ -730,7 +730,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(v);
eachArguments.append(jsNumber(exec, k));
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
JSValue result = call(exec, function, callType, callData, applyThis, eachArguments);
......@@ -771,7 +771,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec)
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
cachedCall.setArgument(1, jsNumber(exec, k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);
JSValue result = cachedCall.call();
if (!result.toBoolean(cachedCall.newCallFrame(exec)))
......@@ -787,7 +787,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec)
MarkedArgumentBuffer eachArguments;
eachArguments.append(slot.getValue(exec, k));
eachArguments.append(jsNumber(exec, k));
eachArguments.append(jsNumber(k));
eachArguments.append(thisObj);
bool predicateResult = call(exec, function, callType, callData, applyThis, eachArguments).toBoolean(exec);
......@@ -825,7 +825,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncForEach(ExecState* exec)
cachedCall.setThis(applyThis);
cachedCall.setArgument(0, array->getIndex(k));
cachedCall.setArgument(1, jsNumber(exec, k));
cachedCall.setArgument(1, jsNumber(k));
cachedCall.setArgument(2, thisObj);