Ignore:
Timestamp:
May 1, 2009, 5:25:41 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-01 Sam Weinig <[email protected]>

Reviewed by Geoff "The Minneapolis" Garen.

Add mechanism to vend heap allocated JS numbers to JavaScriptCore API clients with a
representation that is independent of the number representation in the VM.

  • Numbers leaving the interpreter are converted to a tagged JSNumberCell.
  • The numbers coming into the interpreter (asserted to be the tagged JSNumberCell) are converted back to the VM's internal number representation.
  • API/APICast.h: (toJS): (toRef):
  • API/JSBase.cpp: (JSEvaluateScript): (JSCheckScriptSyntax):
  • API/JSCallbackConstructor.cpp: (JSC::constructJSCallback):
  • API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::call):
  • API/JSCallbackObjectFunctions.h: (JSC::::getOwnPropertySlot): (JSC::::put): (JSC::::deleteProperty): (JSC::::construct): (JSC::::hasInstance): (JSC::::call): (JSC::::toNumber): (JSC::::toString): (JSC::::staticValueGetter): (JSC::::callbackGetter):
  • API/JSObjectRef.cpp: (JSObjectMakeFunction): (JSObjectMakeArray): (JSObjectMakeDate): (JSObjectMakeError): (JSObjectMakeRegExp): (JSObjectGetPrototype): (JSObjectSetPrototype): (JSObjectGetProperty): (JSObjectSetProperty): (JSObjectGetPropertyAtIndex): (JSObjectSetPropertyAtIndex): (JSObjectDeleteProperty): (JSObjectCallAsFunction): (JSObjectCallAsConstructor):
  • API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsObjectOfClass): (JSValueIsEqual): (JSValueIsStrictEqual): (JSValueIsInstanceOfConstructor): (JSValueMakeUndefined): (JSValueMakeNull): (JSValueMakeBoolean): (JSValueMakeNumber): (JSValueMakeString): (JSValueToBoolean): (JSValueToNumber): (JSValueToStringCopy): (JSValueToObject): (JSValueProtect): (JSValueUnprotect):
  • runtime/JSNumberCell.cpp: (JSC::jsAPIMangledNumber):
  • runtime/JSNumberCell.h: (JSC::JSNumberCell::isAPIMangledNumber): (JSC::JSNumberCell::): (JSC::JSNumberCell::JSNumberCell): (JSC::JSValue::isAPIMangledNumber):
  • runtime/JSValue.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSValue.h

    r43122 r43130  
    151151        float toFloat(ExecState* exec) const { return static_cast<float>(toNumber(exec)); }
    152152
     153        // API Mangled Numbers
     154        bool isAPIMangledNumber();
     155
    153156        // Garbage collection.
    154157        void mark();
Note: See TracChangeset for help on using the changeset viewer.