Changeset 173911 in webkit


Ignore:
Timestamp:
Sep 24, 2014 2:14:32 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r173839.
https://bugs.webkit.org/show_bug.cgi?id=137062

NumberConstruct should no longer use static tables (Requested
by dpino on #webkit).

Reverted changeset:

"Simple ES6 feature: Number constructor extras"
https://bugs.webkit.org/show_bug.cgi?id=131707
http://trac.webkit.org/changeset/173839

Location:
trunk
Files:
3 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r173910 r173911  
     12014-09-24  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r173839.
     4        https://bugs.webkit.org/show_bug.cgi?id=137062
     5
     6        NumberConstruct should no longer use static tables (Requested
     7        by dpino on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Simple ES6 feature: Number constructor extras"
     12        https://bugs.webkit.org/show_bug.cgi?id=131707
     13        http://trac.webkit.org/changeset/173839
     14
    1152014-09-24  Benjamin Poulain  <bpoulain@apple.com>
    216
  • trunk/LayoutTests/js/Object-getOwnPropertyNames-expected.txt

    r173839 r173911  
    5151PASS getSortedOwnPropertyNames(Boolean) is ['length', 'name', 'prototype']
    5252PASS getSortedOwnPropertyNames(Boolean.prototype) is ['constructor', 'toString', 'valueOf']
    53 PASS getSortedOwnPropertyNames(Number) is ['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']
     53PASS getSortedOwnPropertyNames(Number) is ['MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'length', 'name', 'prototype']
    5454PASS getSortedOwnPropertyNames(Number.prototype) is ['clz', 'constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf']
    5555PASS getSortedOwnPropertyNames(Date) is ['UTC', 'length', 'name', 'now', 'parse', 'prototype']
  • trunk/LayoutTests/js/script-tests/Object-getOwnPropertyNames.js

    r173839 r173911  
    5959    "Boolean": "['length', 'name', 'prototype']",
    6060    "Boolean.prototype": "['constructor', 'toString', 'valueOf']",
    61     "Number": "['EPSILON', 'MAX_SAFE_INTEGER', 'MAX_VALUE', 'MIN_SAFE_INTEGER', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'isFinite', 'isInteger', 'isNaN', 'isSafeInteger', 'length', 'name', 'parseFloat', 'parseInt', 'prototype']",
     61    "Number": "['MAX_VALUE', 'MIN_VALUE', 'NEGATIVE_INFINITY', 'NaN', 'POSITIVE_INFINITY', 'length', 'name', 'prototype']",
    6262    "Number.prototype": "['clz', 'constructor', 'toExponential', 'toFixed', 'toLocaleString', 'toPrecision', 'toString', 'valueOf']",
    6363    "Date": "['UTC', 'length', 'name', 'now', 'parse', 'prototype']",
  • trunk/Source/JavaScriptCore/ChangeLog

    r173896 r173911  
     12014-09-24  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r173839.
     4        https://bugs.webkit.org/show_bug.cgi?id=137062
     5
     6        NumberConstruct should no longer use static tables (Requested
     7        by dpino on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Simple ES6 feature: Number constructor extras"
     12        https://bugs.webkit.org/show_bug.cgi?id=131707
     13        http://trac.webkit.org/changeset/173839
     14
    1152014-09-23  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h

    r173839 r173911  
    119119    macro(instructionCount) \
    120120    macro(isArray) \
    121     macro(isFinite) \
    122     macro(isInteger) \
    123     macro(isNaN) \
    124121    macro(isPrototypeOf) \
    125     macro(isSafeInteger) \
    126122    macro(isView) \
    127123    macro(isWatchpoint) \
     
    145141    macro(osrExits) \
    146142    macro(parse) \
    147     macro(parseFloat) \
    148     macro(parseInt) \
    149143    macro(postMessage) \
    150144    macro(profiledBytecodes) \
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r173839 r173911  
    2727#include "NumberPrototype.h"
    2828#include "JSCInlines.h"
    29 #include "JSGlobalObjectFunctions.h"
    3029
    3130namespace JSC {
    3231
    33 static EncodedJSValue numberConstructorEpsilonValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
    3432static EncodedJSValue numberConstructorNaNValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
    3533static EncodedJSValue numberConstructorNegInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName);
     
    3735static EncodedJSValue numberConstructorMaxValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
    3836static EncodedJSValue numberConstructorMinValue(ExecState*, JSObject*, EncodedJSValue, PropertyName);
    39 static EncodedJSValue numberConstructorMaxSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName);
    40 static EncodedJSValue numberConstructorMinSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName);
    41 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsFinite(ExecState*);
    42 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsInteger(ExecState*);
    43 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsNaN(ExecState*);
    44 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsSafeInteger(ExecState*);
    4537
    4638} // namespace JSC
     
    5648/* Source for NumberConstructor.lut.h
    5749@begin numberConstructorTable
    58    EPSILON               numberConstructorEpsilonValue      DontEnum|DontDelete|ReadOnly
    59    NaN                   numberConstructorNaNValue          DontEnum|DontDelete|ReadOnly
    60    NEGATIVE_INFINITY     numberConstructorNegInfinity       DontEnum|DontDelete|ReadOnly
    61    POSITIVE_INFINITY     numberConstructorPosInfinity       DontEnum|DontDelete|ReadOnly
    62    MAX_VALUE             numberConstructorMaxValue          DontEnum|DontDelete|ReadOnly
    63    MIN_VALUE             numberConstructorMinValue          DontEnum|DontDelete|ReadOnly
    64    MAX_SAFE_INTEGER      numberConstructorMaxSafeInteger    DontEnum|DontDelete|ReadOnly
    65    MIN_SAFE_INTEGER      numberConstructorMinSafeInteger    DontEnum|DontDelete|ReadOnly
    66    isFinite              numberConstructorFuncIsFinite      DontEnum|Function 1
    67    isInteger             numberConstructorFuncIsInteger     DontEnum|Function 1
    68    isNaN                 numberConstructorFuncIsNaN         DontEnum|Function 1
    69    isSafeInteger         numberConstructorFuncIsSafeInteger DontEnum|Function 1
    70    parseFloat            globalFuncParseFloat                DontEnum|Function 1
    71    parseInt              globalFuncParseInt                  DontEnum|Function 2
     50   NaN                   numberConstructorNaNValue       DontEnum|DontDelete|ReadOnly
     51   NEGATIVE_INFINITY     numberConstructorNegInfinity    DontEnum|DontDelete|ReadOnly
     52   POSITIVE_INFINITY     numberConstructorPosInfinity    DontEnum|DontDelete|ReadOnly
     53   MAX_VALUE             numberConstructorMaxValue       DontEnum|DontDelete|ReadOnly
     54   MIN_VALUE             numberConstructorMinValue       DontEnum|DontDelete|ReadOnly
    7255@end
    7356*/
     
    9275bool NumberConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
    9376{
    94     if (isFunction(exec->vm(), propertyName.uid())) {
    95         return getStaticFunctionSlot<InternalFunction>(exec, numberConstructorTable,
    96             jsCast<NumberConstructor*>(object), propertyName, slot);
    97     }
    98     return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, numberConstructorTable,
    99         jsCast<NumberConstructor*>(object), propertyName, slot);
     77    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, numberConstructorTable, jsCast<NumberConstructor*>(object), propertyName, slot);
    10078}
    10179
    102 bool ALWAYS_INLINE NumberConstructor::isFunction(VM& vm, AtomicStringImpl* propertyName)
    103 {
    104     return propertyName == vm.propertyNames->isFinite
    105         || propertyName == vm.propertyNames->isInteger
    106         || propertyName == vm.propertyNames->isNaN
    107         || propertyName == vm.propertyNames->isSafeInteger
    108         || propertyName == vm.propertyNames->parseFloat
    109         || propertyName == vm.propertyNames->parseInt;
    110 }
    111 
    112 // ECMA-262 20.1.2.1
    113 static EncodedJSValue numberConstructorEpsilonValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    114 {
    115     return JSValue::encode(jsDoubleNumber((std::numeric_limits<double>::epsilon())));
    116 }
    117 
    118 // ECMA-262 20.1.2.8
    11980static EncodedJSValue numberConstructorNaNValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    12081{
     
    12283}
    12384
    124 // ECMA-262 20.1.2.9
    12585static EncodedJSValue numberConstructorNegInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    12686{
    127     return JSValue::encode(jsDoubleNumber(-std::numeric_limits<double>::infinity()));
     87    return JSValue::encode(jsNumber(-std::numeric_limits<double>::infinity()));
    12888}
    12989
    130 // ECMA-262 20.1.2.14
    13190static EncodedJSValue numberConstructorPosInfinity(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    13291{
    133     return JSValue::encode(jsDoubleNumber(std::numeric_limits<double>::infinity()));
     92    return JSValue::encode(jsNumber(std::numeric_limits<double>::infinity()));
    13493}
    13594
    136 // ECMA-262 20.1.2.7
    13795static EncodedJSValue numberConstructorMaxValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    13896{
    139     return JSValue::encode(jsDoubleNumber(1.7976931348623157E+308));
     97    return JSValue::encode(jsNumber(1.7976931348623157E+308));
    14098}
    14199
    142 // ECMA-262 20.1.2.11
    143100static EncodedJSValue numberConstructorMinValue(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    144101{
    145     return JSValue::encode(jsDoubleNumber(5E-324));
    146 }
    147 
    148 // ECMA-262 20.1.2.6
    149 static EncodedJSValue numberConstructorMaxSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    150 {
    151     return JSValue::encode(jsDoubleNumber(9007199254740991.0));
    152 }
    153 
    154 // ECMA-262 20.1.2.7
    155 static EncodedJSValue numberConstructorMinSafeInteger(ExecState*, JSObject*, EncodedJSValue, PropertyName)
    156 {
    157     return JSValue::encode(jsDoubleNumber(-9007199254740991.0));
     102    return JSValue::encode(jsNumber(5E-324));
    158103}
    159104
     
    185130}
    186131
    187 // ECMA-262 20.1.2.2
    188 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsFinite(ExecState* exec)
    189 {
    190     JSValue argument = exec->argument(0);
    191     return JSValue::encode(jsBoolean(argument.isNumber() && (argument.isInt32() || std::isfinite(argument.asDouble()))));
    192 }
    193 
    194 // ECMA-262 20.1.2.3
    195 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsInteger(ExecState* exec)
    196 {
    197     JSValue argument = exec->argument(0);
    198     bool isInteger;
    199     if (argument.isInt32())
    200         isInteger = true;
    201     else if (!argument.isDouble())
    202         isInteger = false;
    203     else {
    204         double number = argument.asDouble();
    205         isInteger = std::isfinite(number) && trunc(number) == number;
    206     }
    207     return JSValue::encode(jsBoolean(isInteger));
    208 }
    209 
    210 // ECMA-262 20.1.2.4
    211 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsNaN(ExecState* exec)
    212 {
    213     JSValue argument = exec->argument(0);
    214     return JSValue::encode(jsBoolean(argument.isDouble() && std::isnan(argument.asDouble())));
    215 }
    216 
    217 // ECMA-262 20.1.2.5
    218 static EncodedJSValue JSC_HOST_CALL numberConstructorFuncIsSafeInteger(ExecState* exec)
    219 {
    220     JSValue argument = exec->argument(0);
    221     bool isInteger;
    222     if (argument.isInt32())
    223         isInteger = true;
    224     else if (!argument.isDouble())
    225         isInteger = false;
    226     else {
    227         double number = argument.asDouble();
    228         isInteger = trunc(number) == number && std::abs(number) <= 9007199254740991.0;
    229     }
    230     return JSValue::encode(jsBoolean(isInteger));
    231 }
    232 
    233132} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r173839 r173911  
    5959    static ConstructType getConstructData(JSCell*, ConstructData&);
    6060    static CallType getCallData(JSCell*, CallData&);
    61     static bool isFunction(VM&, AtomicStringImpl* propertyName);
    6261};
    6362
Note: See TracChangeset for help on using the changeset viewer.