Changeset 43130 in webkit for trunk/JavaScriptCore/API/JSBase.cpp


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/API/JSBase.cpp

    r41594 r43130  
    5656    if (completion.complType() == Throw) {
    5757        if (exception)
    58             *exception = toRef(completion.value());
     58            *exception = toRef(exec, completion.value());
    5959        return 0;
    6060    }
    6161
    6262    if (completion.value())
    63         return toRef(completion.value());
     63        return toRef(exec, completion.value());
    6464   
    6565    // happens, for example, when the only statement is an empty (';') statement
    66     return toRef(jsUndefined());
     66    return toRef(exec, jsUndefined());
    6767}
    6868
     
    7777    if (completion.complType() == Throw) {
    7878        if (exception)
    79             *exception = toRef(completion.value());
     79            *exception = toRef(exec, completion.value());
    8080        return false;
    8181    }
Note: See TracChangeset for help on using the changeset viewer.