return reinterpret_cast<JSC::ExecState*>(c);
}
-inline JSC::JSValue* toJS(JSValueRef v)
+inline JSC::JSValuePtr toJS(JSValueRef v)
{
- return reinterpret_cast<JSC::JSValue*>(const_cast<OpaqueJSValue*>(v));
+ return reinterpret_cast<JSC::JSValuePtr>(const_cast<OpaqueJSValue*>(v));
}
inline JSC::JSObject* toJS(JSObjectRef o)
return reinterpret_cast<JSC::JSGlobalData*>(const_cast<OpaqueJSContextGroup*>(g));
}
-inline JSValueRef toRef(JSC::JSValue* v)
+inline JSValueRef toRef(JSC::JSValuePtr v)
{
return reinterpret_cast<JSValueRef>(v);
}
-inline JSValueRef* toRef(JSC::JSValue** v)
+inline JSValueRef* toRef(JSC::JSValuePtr* v)
{
return reinterpret_cast<JSValueRef*>(const_cast<const JSC::JSValue**>(v));
}
JSObjectCallAsConstructorCallback callback() const { return m_callback; }
static const ClassInfo info;
- static PassRefPtr<StructureID> createStructureID(JSValue* proto)
+ static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
{
return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));
}
{
}
-JSValue* JSCallbackFunction::call(ExecState* exec, JSObject* functionObject, JSValue* thisValue, const ArgList& args)
+JSValuePtr JSCallbackFunction::call(ExecState* exec, JSObject* functionObject, JSValuePtr thisValue, const ArgList& args)
{
JSContextRef execRef = toRef(exec);
JSObjectRef functionRef = toRef(functionObject);
// InternalFunction mish-mashes constructor and function behavior -- we should
// refactor the code so this override isn't necessary
- static PassRefPtr<StructureID> createStructureID(JSValue* proto)
+ static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
{
return StructureID::create(proto, TypeInfo(ObjectType));
}
virtual CallType getCallData(CallData&);
virtual const ClassInfo* classInfo() const { return &info; }
- static JSValue* call(ExecState*, JSObject*, JSValue*, const ArgList&);
+ static JSValuePtr call(ExecState*, JSObject*, JSValuePtr, const ArgList&);
JSObjectCallAsFunctionCallback m_callback;
};
JSClassRef classRef() const { return m_callbackObjectData->jsClass; }
bool inherits(JSClassRef) const;
- static PassRefPtr<StructureID> createStructureID(JSValue* proto)
+ static PassRefPtr<StructureID> createStructureID(JSValuePtr proto)
{
return StructureID::create(proto, TypeInfo(ObjectType, ImplementsHasInstance | OverridesHasInstance));
}
virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned, PropertySlot&);
- virtual void put(ExecState*, const Identifier&, JSValue*, PutPropertySlot&);
+ virtual void put(ExecState*, const Identifier&, JSValuePtr, PutPropertySlot&);
virtual bool deleteProperty(ExecState*, const Identifier&);
virtual bool deleteProperty(ExecState*, unsigned);
- virtual bool hasInstance(ExecState* exec, JSValue* value, JSValue* proto);
+ virtual bool hasInstance(ExecState* exec, JSValuePtr value, JSValuePtr proto);
virtual void getPropertyNames(ExecState*, PropertyNameArray&);
void init(ExecState*);
- static JSCallbackObject* asCallbackObject(JSValue*);
+ static JSCallbackObject* asCallbackObject(JSValuePtr);
- static JSValue* call(ExecState*, JSObject* functionObject, JSValue* thisValue, const ArgList&);
+ static JSValuePtr call(ExecState*, JSObject* functionObject, JSValuePtr thisValue, const ArgList&);
static JSObject* construct(ExecState*, JSObject* constructor, const ArgList&);
- static JSValue* cachedValueGetter(ExecState*, const Identifier&, const PropertySlot&);
- static JSValue* staticValueGetter(ExecState*, const Identifier&, const PropertySlot&);
- static JSValue* staticFunctionGetter(ExecState*, const Identifier&, const PropertySlot&);
- static JSValue* callbackGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValuePtr cachedValueGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValuePtr staticValueGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValuePtr staticFunctionGetter(ExecState*, const Identifier&, const PropertySlot&);
+ static JSValuePtr callbackGetter(ExecState*, const Identifier&, const PropertySlot&);
struct JSCallbackObjectData {
JSCallbackObjectData(void* privateData_, JSClassRef jsClass_)
namespace JSC {
template <class Base>
-inline JSCallbackObject<Base>* JSCallbackObject<Base>::asCallbackObject(JSValue* value)
+inline JSCallbackObject<Base>* JSCallbackObject<Base>::asCallbackObject(JSValuePtr value)
{
ASSERT(asObject(value)->inherits(&info));
return static_cast<JSCallbackObject*>(asObject(value));
}
template <class Base>
-void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName, JSValue* value, PutPropertySlot& slot)
+void JSCallbackObject<Base>::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
{
JSContextRef ctx = toRef(exec);
JSObjectRef thisRef = toRef(this);
}
template <class Base>
-bool JSCallbackObject<Base>::hasInstance(ExecState* exec, JSValue* value, JSValue*)
+bool JSCallbackObject<Base>::hasInstance(ExecState* exec, JSValuePtr value, JSValuePtr)
{
JSContextRef execRef = toRef(exec);
JSObjectRef thisRef = toRef(this);
}
template <class Base>
-JSValue* JSCallbackObject<Base>::call(ExecState* exec, JSObject* functionObject, JSValue* thisValue, const ArgList& args)
+JSValuePtr JSCallbackObject<Base>::call(ExecState* exec, JSObject* functionObject, JSValuePtr thisValue, const ArgList& args)
{
JSContextRef execRef = toRef(exec);
JSObjectRef functionRef = toRef(functionObject);
}
template <class Base>
-JSValue* JSCallbackObject<Base>::cachedValueGetter(ExecState*, const Identifier&, const PropertySlot& slot)
+JSValuePtr JSCallbackObject<Base>::cachedValueGetter(ExecState*, const Identifier&, const PropertySlot& slot)
{
- JSValue* v = slot.slotBase();
+ JSValuePtr v = slot.slotBase();
ASSERT(v);
return v;
}
template <class Base>
-JSValue* JSCallbackObject<Base>::staticValueGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr JSCallbackObject<Base>::staticValueGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
}
template <class Base>
-JSValue* JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr JSCallbackObject<Base>::staticFunctionGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
}
template <class Base>
-JSValue* JSCallbackObject<Base>::callbackGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
+JSValuePtr JSCallbackObject<Base>::callbackGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
JSCallbackObject* thisObj = asCallbackObject(slot.slotBase());
JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(globalData.get(), globalObjectClass);
ExecState* exec = globalObject->globalExec();
- JSValue* prototype = globalObjectClass->prototype(exec);
+ JSValuePtr prototype = globalObjectClass->prototype(exec);
if (!prototype)
prototype = jsNull();
globalObject->resetPrototype(prototype);
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsPrototype = jsClass
+ JSValuePtr jsPrototype = jsClass
? jsClass->prototype(exec)
: exec->lexicalGlobalObject()->objectPrototype();
void JSObjectSetPrototype(JSContextRef, JSObjectRef object, JSValueRef value)
{
JSObject* jsObject = toJS(object);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
jsObject->setPrototype(jsValue->isObject() ? jsValue : jsNull());
}
JSObject* jsObject = toJS(object);
- JSValue* jsValue = jsObject->get(exec, propertyName->identifier(&exec->globalData()));
+ JSValuePtr jsValue = jsObject->get(exec, propertyName->identifier(&exec->globalData()));
if (exec->hadException()) {
if (exception)
*exception = toRef(exec->exception());
JSObject* jsObject = toJS(object);
Identifier name(propertyName->identifier(&exec->globalData()));
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
if (attributes && !jsObject->hasProperty(exec, name))
jsObject->putWithAttributes(exec, name, jsValue, attributes);
JSObject* jsObject = toJS(object);
- JSValue* jsValue = jsObject->get(exec, propertyIndex);
+ JSValuePtr jsValue = jsObject->get(exec, propertyIndex);
if (exec->hadException()) {
if (exception)
*exception = toRef(exec->exception());
JSLock lock(exec);
JSObject* jsObject = toJS(object);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
jsObject->put(exec, propertyIndex, jsValue);
if (exec->hadException()) {
JSType JSValueGetType(JSContextRef, JSValueRef value)
{
- JSC::JSValue* jsValue = toJS(value);
+ JSC::JSValuePtr jsValue = toJS(value);
if (jsValue->isUndefined())
return kJSTypeUndefined;
if (jsValue->isNull())
bool JSValueIsUndefined(JSContextRef, JSValueRef value)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->isUndefined();
}
bool JSValueIsNull(JSContextRef, JSValueRef value)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->isNull();
}
bool JSValueIsBoolean(JSContextRef, JSValueRef value)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->isBoolean();
}
bool JSValueIsNumber(JSContextRef, JSValueRef value)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->isNumber();
}
bool JSValueIsString(JSContextRef, JSValueRef value)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->isString();
}
bool JSValueIsObject(JSContextRef, JSValueRef value)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->isObject();
}
bool JSValueIsObjectOfClass(JSContextRef, JSValueRef value, JSClassRef jsClass)
{
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
if (JSObject* o = jsValue->getObject()) {
if (o->inherits(&JSCallbackObject<JSGlobalObject>::info))
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsA = toJS(a);
- JSValue* jsB = toJS(b);
+ JSValuePtr jsA = toJS(a);
+ JSValuePtr jsB = toJS(b);
bool result = equal(exec, jsA, jsB); // false if an exception is thrown
if (exec->hadException()) {
bool JSValueIsStrictEqual(JSContextRef, JSValueRef a, JSValueRef b)
{
- JSValue* jsA = toJS(a);
- JSValue* jsB = toJS(b);
+ JSValuePtr jsA = toJS(a);
+ JSValuePtr jsB = toJS(b);
bool result = strictEqual(jsA, jsB);
return result;
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
JSObject* jsConstructor = toJS(constructor);
if (!jsConstructor->structureID()->typeInfo().implementsHasInstance())
return false;
bool JSValueToBoolean(JSContextRef ctx, JSValueRef value)
{
ExecState* exec = toJS(ctx);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
return jsValue->toBoolean(exec);
}
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
double number = jsValue->toNumber(exec);
if (exec->hadException()) {
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
RefPtr<OpaqueJSString> stringRef(OpaqueJSString::create(jsValue->toString(exec)));
if (exec->hadException()) {
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
JSObjectRef objectRef = toRef(jsValue->toObject(exec));
if (exec->hadException()) {
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
gcProtect(jsValue);
}
exec->globalData().heap.registerThread();
JSLock lock(exec);
- JSValue* jsValue = toJS(value);
+ JSValuePtr jsValue = toJS(value);
gcUnprotect(jsValue);
}
2008-10-18 Darin Adler <darin@apple.com>
+ Reviewed by Cameron Zwarich.
+
+ - next step on https://bugs.webkit.org/show_bug.cgi?id=21732
+ improve performance by eliminating JSValue as a base class for JSCell
+
+ Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
+ changing JSValuePtr to be a class, and then eventually renaming it
+ to JSValue once that's done.
+
+ * JavaScriptCore.exp: Update entry points, since some now take JSValue*
+ instead of const JSValue*.
+
+ * API/APICast.h:
+ * API/JSCallbackConstructor.h:
+ * API/JSCallbackFunction.cpp:
+ * API/JSCallbackFunction.h:
+ * API/JSCallbackObject.h:
+ * API/JSCallbackObjectFunctions.h:
+ * API/JSContextRef.cpp:
+ * API/JSObjectRef.cpp:
+ * API/JSValueRef.cpp:
+ * VM/CTI.cpp:
+ * VM/CTI.h:
+ * VM/CodeBlock.cpp:
+ * VM/CodeBlock.h:
+ * VM/CodeGenerator.cpp:
+ * VM/CodeGenerator.h:
+ * VM/ExceptionHelpers.cpp:
+ * VM/ExceptionHelpers.h:
+ * VM/JSPropertyNameIterator.cpp:
+ * VM/JSPropertyNameIterator.h:
+ * VM/Machine.cpp:
+ * VM/Machine.h:
+ * VM/Register.h:
+ * kjs/ArgList.cpp:
+ * kjs/ArgList.h:
+ * kjs/Arguments.cpp:
+ * kjs/Arguments.h:
+ * kjs/ArrayConstructor.cpp:
+ * kjs/ArrayPrototype.cpp:
+ * kjs/BooleanConstructor.cpp:
+ * kjs/BooleanConstructor.h:
+ * kjs/BooleanObject.h:
+ * kjs/BooleanPrototype.cpp:
+ * kjs/CallData.cpp:
+ * kjs/CallData.h:
+ * kjs/ConstructData.cpp:
+ * kjs/ConstructData.h:
+ * kjs/DateConstructor.cpp:
+ * kjs/DateInstance.h:
+ * kjs/DatePrototype.cpp:
+ * kjs/DebuggerCallFrame.cpp:
+ * kjs/DebuggerCallFrame.h:
+ * kjs/ErrorConstructor.cpp:
+ * kjs/ErrorPrototype.cpp:
+ * kjs/ExecState.cpp:
+ * kjs/ExecState.h:
+ * kjs/FunctionConstructor.cpp:
+ * kjs/FunctionPrototype.cpp:
+ * kjs/GetterSetter.cpp:
+ * kjs/GetterSetter.h:
+ * kjs/InternalFunction.h:
+ * kjs/JSActivation.cpp:
+ * kjs/JSActivation.h:
+ * kjs/JSArray.cpp:
+ * kjs/JSArray.h:
+ * kjs/JSCell.cpp:
+ * kjs/JSCell.h:
+ * kjs/JSFunction.cpp:
+ * kjs/JSFunction.h:
+ * kjs/JSGlobalData.h:
+ * kjs/JSGlobalObject.cpp:
+ * kjs/JSGlobalObject.h:
+ * kjs/JSGlobalObjectFunctions.cpp:
+ * kjs/JSGlobalObjectFunctions.h:
+ * kjs/JSImmediate.cpp:
+ * kjs/JSImmediate.h:
+ * kjs/JSNotAnObject.cpp:
+ * kjs/JSNotAnObject.h:
+ * kjs/JSNumberCell.cpp:
+ * kjs/JSNumberCell.h:
+ * kjs/JSObject.cpp:
+ * kjs/JSObject.h:
+ * kjs/JSStaticScopeObject.cpp:
+ * kjs/JSStaticScopeObject.h:
+ * kjs/JSString.cpp:
+ * kjs/JSString.h:
+ * kjs/JSValue.h:
+ * kjs/JSVariableObject.h:
+ * kjs/JSWrapperObject.h:
+ * kjs/MathObject.cpp:
+ * kjs/NativeErrorConstructor.cpp:
+ * kjs/NumberConstructor.cpp:
+ * kjs/NumberConstructor.h:
+ * kjs/NumberObject.cpp:
+ * kjs/NumberObject.h:
+ * kjs/NumberPrototype.cpp:
+ * kjs/ObjectConstructor.cpp:
+ * kjs/ObjectPrototype.cpp:
+ * kjs/ObjectPrototype.h:
+ * kjs/PropertyMap.h:
+ * kjs/PropertySlot.cpp:
+ * kjs/PropertySlot.h:
+ * kjs/RegExpConstructor.cpp:
+ * kjs/RegExpConstructor.h:
+ * kjs/RegExpMatchesArray.h:
+ * kjs/RegExpObject.cpp:
+ * kjs/RegExpObject.h:
+ * kjs/RegExpPrototype.cpp:
+ * kjs/Shell.cpp:
+ * kjs/StringConstructor.cpp:
+ * kjs/StringObject.cpp:
+ * kjs/StringObject.h:
+ * kjs/StringObjectThatMasqueradesAsUndefined.h:
+ * kjs/StringPrototype.cpp:
+ * kjs/StructureID.cpp:
+ * kjs/StructureID.h:
+ * kjs/collector.cpp:
+ * kjs/collector.h:
+ * kjs/completion.h:
+ * kjs/grammar.y:
+ * kjs/interpreter.cpp:
+ * kjs/interpreter.h:
+ * kjs/lookup.cpp:
+ * kjs/lookup.h:
+ * kjs/nodes.h:
+ * kjs/operations.cpp:
+ * kjs/operations.h:
+ * kjs/protect.h:
+ * profiler/ProfileGenerator.cpp:
+ Replace JSValue* with JSValuePtr.
+
+2008-10-18 Darin Adler <darin@apple.com>
+
* VM/Machine.cpp:
(JSC::Machine::cti_op_call_eval): Removed stray parentheses from my
last check-in.
__ZN3JSC11Interpreter24setShouldPrintExceptionsEb
__ZN3JSC11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_10SourceCodeEPNS_7JSValueE
__ZN3JSC11JSImmediate12nonInlineNaNEv
-__ZN3JSC11JSImmediate8toObjectEPKNS_7JSValueEPNS_9ExecStateE
-__ZN3JSC11JSImmediate8toStringEPKNS_7JSValueE
-__ZN3JSC11JSImmediate9prototypeEPKNS_7JSValueEPNS_9ExecStateE
+__ZN3JSC11JSImmediate8toObjectEPNS_7JSValueEPNS_9ExecStateE
+__ZN3JSC11JSImmediate8toStringEPNS_7JSValueE
+__ZN3JSC11JSImmediate9prototypeEPNS_7JSValueEPNS_9ExecStateE
__ZN3JSC11ProfileNode4sortEPFbRKN3WTF6RefPtrIS0_EES5_E
__ZN3JSC11ProgramNode6createEPNS_12JSGlobalDataEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS6_INS5_6RefPtrINS_12FuncDeclNodeEEELm16EEERKNS_10SourceCodeEji
__ZN3JSC11PropertyMap3getERKNS_10IdentifierERj
__ZN3JSC4Heap24setGCProtectNeedsLockingEv
__ZN3JSC4Heap25protectedObjectTypeCountsEv
__ZN3JSC4Heap26protectedGlobalObjectCountEv
-__ZN3JSC4Heap4heapEPKNS_7JSValueE
+__ZN3JSC4Heap4heapEPNS_7JSValueE
__ZN3JSC4Heap4sizeEv
__ZN3JSC4Heap7collectEv
__ZN3JSC4Heap7protectEPNS_7JSValueE
extern "C" {
- __declspec(naked) JSValue* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*)
+ __declspec(naked) JSValuePtr ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValuePtr* exception, Profiler**, JSGlobalData*)
{
__asm {
push esi;
return src >= m_codeBlock->numVars && src < m_codeBlock->numVars + m_codeBlock->numConstants;
}
-ALWAYS_INLINE JSValue* CTI::getConstant(CallFrame* callFrame, int src)
+ALWAYS_INLINE JSValuePtr CTI::getConstant(CallFrame* callFrame, int src)
{
return m_codeBlock->constantRegisters[src - m_codeBlock->numVars].jsValue(callFrame);
}
-inline uintptr_t CTI::asInteger(JSValue* value)
+inline uintptr_t CTI::asInteger(JSValuePtr value)
{
return reinterpret_cast<uintptr_t>(value);
}
{
// TODO: we want to reuse values that are already in registers if we can - add a register allocator!
if (isConstant(src)) {
- JSValue* js = getConstant(m_callFrame, src);
+ JSValuePtr js = getConstant(m_callFrame, src);
m_jit.movl_i32r(asInteger(js), dst);
} else
m_jit.movl_mr(src * sizeof(Register), X86::edi, dst);
ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, X86Assembler::RegisterID scratch)
{
if (isConstant(src)) {
- JSValue* js = getConstant(m_callFrame, src);
+ JSValuePtr js = getConstant(m_callFrame, src);
m_jit.movl_i32m(asInteger(js), offset + sizeof(void*), X86::esp);
} else {
m_jit.movl_mr(src * sizeof(Register), X86::edi, scratch);
m_jit.movl_i32m(value, offset + sizeof(void*), X86::esp);
}
-ALWAYS_INLINE JSValue* CTI::getConstantImmediateNumericArg(unsigned src)
+ALWAYS_INLINE JSValuePtr CTI::getConstantImmediateNumericArg(unsigned src)
{
if (isConstant(src)) {
- JSValue* js = getConstant(m_callFrame, src);
+ JSValuePtr js = getConstant(m_callFrame, src);
return JSImmediate::isNumber(js) ? js : noValue();
}
return noValue();
{
char which1 = '*';
if (isConstant(src1)) {
- JSValue* js = getConstant(m_callFrame, src1);
+ JSValuePtr js = getConstant(m_callFrame, src1);
which1 =
JSImmediate::isImmediate(js) ?
(JSImmediate::isNumber(js) ? 'i' :
}
char which2 = '*';
if (isConstant(src2)) {
- JSValue* js = getConstant(m_callFrame, src2);
+ JSValuePtr js = getConstant(m_callFrame, src2);
which2 =
JSImmediate::isImmediate(js) ?
(JSImmediate::isNumber(js) ? 'i' :
emitJumpSlowCaseIfNotImmNum(X86::ecx, opcodeIndex);
}
-ALWAYS_INLINE unsigned CTI::getDeTaggedConstantImmediate(JSValue* imm)
+ALWAYS_INLINE unsigned CTI::getDeTaggedConstantImmediate(JSValuePtr imm)
{
ASSERT(JSImmediate::isNumber(imm));
return asInteger(imm) & ~JSImmediate::TagBitTypeInteger;
unsigned src1 = instruction[i + 2].u.operand;
unsigned src2 = instruction[i + 3].u.operand;
- if (JSValue* value = getConstantImmediateNumericArg(src1)) {
+ if (JSValuePtr value = getConstantImmediateNumericArg(src1)) {
emitGetArg(src2, X86::edx);
emitJumpSlowCaseIfNotImmNum(X86::edx, i);
m_jit.addl_i32r(getDeTaggedConstantImmediate(value), X86::edx);
m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), i));
emitPutResult(dst, X86::edx);
- } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
+ } else if (JSValuePtr value = getConstantImmediateNumericArg(src2)) {
emitGetArg(src1, X86::eax);
emitJumpSlowCaseIfNotImmNum(X86::eax, i);
m_jit.addl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
emitSlowScriptCheck(i);
unsigned target = instruction[i + 3].u.operand;
- JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
+ JSValuePtr src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
if (src2imm) {
emitGetArg(instruction[i + 1].u.operand, X86::edx);
emitJumpSlowCaseIfNotImmNum(X86::edx, i);
emitSlowScriptCheck(i);
unsigned target = instruction[i + 3].u.operand;
- JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
+ JSValuePtr src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
if (src2imm) {
emitGetArg(instruction[i + 1].u.operand, X86::edx);
emitJumpSlowCaseIfNotImmNum(X86::edx, i);
unsigned src2 = instruction[i + 3].u.operand;
// For now, only plant a fast int case if the constant operand is greater than zero.
- JSValue* src1Value = getConstantImmediateNumericArg(src1);
- JSValue* src2Value = getConstantImmediateNumericArg(src2);
+ JSValuePtr src1Value = getConstantImmediateNumericArg(src1);
+ JSValuePtr src2Value = getConstantImmediateNumericArg(src2);
int32_t value;
if (src1Value && ((value = JSImmediate::intValue(src1Value)) > 0)) {
emitGetArg(src2, X86::eax);
m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJbe(), i));
// Get the value from the vector
- m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::eax);
+ m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValuePtr), X86::eax);
emitPutResult(instruction[i + 1].u.operand);
i += 4;
break;
// This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location.
// FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff.
- m_jit.cmpl_i8m(0, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));
+ m_jit.cmpl_i8m(0, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValuePtr));
m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), i));
// All good - put the value into the array.
m_jit.link(inFastVector, m_jit.label());
emitGetArg(instruction[i + 3].u.operand, X86::eax);
- m_jit.movl_rm(X86::eax, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*));
+ m_jit.movl_rm(X86::eax, OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValuePtr));
i += 4;
break;
}
// Load cached property
m_jit.movl_mr(OBJECT_OFFSET(JSGlobalObject, m_propertyStorage), X86::eax, X86::eax);
m_jit.movl_mr(offsetAddr, X86::edx);
- m_jit.movl_mr(0, X86::eax, X86::edx, sizeof(JSValue*), X86::eax);
+ m_jit.movl_mr(0, X86::eax, X86::edx, sizeof(JSValuePtr), X86::eax);
emitPutResult(instruction[i + 1].u.operand);
X86Assembler::JmpSrc end = m_jit.emitUnlinkedJmp();
}
case op_jnless: {
unsigned target = instruction[i + 3].u.operand;
- JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
+ JSValuePtr src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
if (src2imm) {
emitGetArg(instruction[i + 1].u.operand, X86::edx);
emitJumpSlowCaseIfNotImmNum(X86::edx, i);
break;
}
case op_unexpected_load: {
- JSValue* v = m_codeBlock->unexpectedConstants[instruction[i + 2].u.operand];
+ JSValuePtr v = m_codeBlock->unexpectedConstants[instruction[i + 2].u.operand];
m_jit.movl_i32r(asInteger(v), X86::eax);
emitPutResult(instruction[i + 1].u.operand);
i += 3;
unsigned src1 = instruction[i + 2].u.operand;
unsigned src2 = instruction[i + 3].u.operand;
unsigned dst = instruction[i + 1].u.operand;
- if (JSValue* value = getConstantImmediateNumericArg(src1)) {
+ if (JSValuePtr value = getConstantImmediateNumericArg(src1)) {
emitGetArg(src2, X86::eax);
emitJumpSlowCaseIfNotImmNum(X86::eax, i);
m_jit.andl_i32r(asInteger(value), X86::eax); // FIXME: make it more obvious this is relying on the format of JSImmediate
emitPutResult(dst);
- } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
+ } else if (JSValuePtr value = getConstantImmediateNumericArg(src2)) {
emitGetArg(src1, X86::eax);
emitJumpSlowCaseIfNotImmNum(X86::eax, i);
m_jit.andl_i32r(asInteger(value), X86::eax);
break;
}
case op_new_error: {
- JSValue* message = m_codeBlock->unexpectedConstants[instruction[i + 3].u.operand];
+ JSValuePtr message = m_codeBlock->unexpectedConstants[instruction[i + 3].u.operand];
emitPutArgConstant(instruction[i + 2].u.operand, 0);
emitPutArgConstant(asInteger(message), 4);
emitPutArgConstant(m_codeBlock->lineNumberForVPC(&instruction[i]), 8);
unsigned dst = instruction[i + 1].u.operand;
unsigned src1 = instruction[i + 2].u.operand;
unsigned src2 = instruction[i + 3].u.operand;
- if (JSValue* value = getConstantImmediateNumericArg(src1)) {
+ if (JSValuePtr value = getConstantImmediateNumericArg(src1)) {
X86Assembler::JmpSrc notImm = iter->from;
m_jit.link((++iter)->from, m_jit.label());
m_jit.subl_i32r(getDeTaggedConstantImmediate(value), X86::edx);
emitPutArg(X86::edx, 4);
emitCTICall(i, Machine::cti_op_add);
emitPutResult(dst);
- } else if (JSValue* value = getConstantImmediateNumericArg(src2)) {
+ } else if (JSValuePtr value = getConstantImmediateNumericArg(src2)) {
X86Assembler::JmpSrc notImm = iter->from;
m_jit.link((++iter)->from, m_jit.label());
m_jit.subl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
m_jit.link(m_jit.emitUnlinkedJbe(), beginGetByValSlow);
// okay, missed the fast region, but it is still in the vector. Get the value.
- m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValue*), X86::ecx);
+ m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_vector[0]), X86::ecx, X86::edx, sizeof(JSValuePtr), X86::ecx);
// Check whether the value loaded is zero; if so we need to return undefined.
m_jit.testl_rr(X86::ecx, X86::ecx);
m_jit.link(m_jit.emitUnlinkedJe(), beginGetByValSlow);
emitSlowScriptCheck(i);
unsigned target = instruction[i + 3].u.operand;
- JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
+ JSValuePtr src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
if (src2imm) {
m_jit.link(iter->from, m_jit.label());
emitPutArg(X86::edx, 0);
emitSlowScriptCheck(i);
unsigned target = instruction[i + 3].u.operand;
- JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
+ JSValuePtr src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
if (src2imm) {
m_jit.link(iter->from, m_jit.label());
emitPutArg(X86::edx, 0);
}
case op_jnless: {
unsigned target = instruction[i + 3].u.operand;
- JSValue* src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
+ JSValuePtr src2imm = getConstantImmediateNumericArg(instruction[i + 2].u.operand);
if (src2imm) {
m_jit.link(iter->from, m_jit.label());
emitPutArg(X86::edx, 0);
int dst = instruction[i + 1].u.operand;
int src1 = instruction[i + 2].u.operand;
int src2 = instruction[i + 3].u.operand;
- JSValue* src1Value = getConstantImmediateNumericArg(src1);
- JSValue* src2Value = getConstantImmediateNumericArg(src2);
+ JSValuePtr src1Value = getConstantImmediateNumericArg(src1);
+ JSValuePtr src2Value = getConstantImmediateNumericArg(src2);
int32_t value;
if (src1Value && ((value = JSImmediate::intValue(src1Value)) > 0)) {
m_jit.link(iter->from, m_jit.label());
// Checks out okay! - getDirectOffset
m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
- m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::eax, X86::eax);
+ m_jit.movl_mr(cachedOffset * sizeof(JSValuePtr), X86::eax, X86::eax);
m_jit.ret();
void* code = m_jit.copy();
X86Assembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJne();
// Checks out okay! - getDirectOffset
- m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::ecx);
+ m_jit.movl_mr(cachedOffset * sizeof(JSValuePtr), X86::edx, X86::ecx);
X86Assembler::JmpSrc success = m_jit.emitUnlinkedJmp();
X86Assembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJne();
// Checks out okay! - getDirectOffset
- m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax);
+ m_jit.movl_mr(cachedOffset * sizeof(JSValuePtr), X86::edx, X86::eax);
m_jit.ret();
PropertyStorage* protoPropertyStorage = &protoObject->m_propertyStorage;
m_jit.movl_mr(static_cast<void*>(protoPropertyStorage), X86::edx);
- m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax);
+ m_jit.movl_mr(cachedOffset * sizeof(JSValuePtr), X86::edx, X86::eax);
m_jit.ret();
bucketsOfFail.append(m_jit.emitUnlinkedJmp());
// checks out okay! - putDirectOffset
m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
- m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax);
+ m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValuePtr), X86::eax);
m_jit.ret();
void* code = m_jit.copy();
extern "C" {
- static JSValue* resizePropertyStorage(JSObject* baseObject, size_t oldSize, size_t newSize)
+ static JSValuePtr resizePropertyStorage(JSObject* baseObject, size_t oldSize, size_t newSize)
{
baseObject->allocatePropertyStorageInline(oldSize, newSize);
return baseObject;
// write the value
m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
- m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax);
+ m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValuePtr), X86::eax);
m_jit.ret();
ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(Machine::cti_op_get_by_id_generic));
// Repatch the offset into the propoerty map to load from, then repatch the StructureID to look for.
- X86Assembler::repatchDisplacement(reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetGetByIdPropertyMapOffset, cachedOffset * sizeof(JSValue*));
+ X86Assembler::repatchDisplacement(reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetGetByIdPropertyMapOffset, cachedOffset * sizeof(JSValuePtr));
X86Assembler::repatchImmediate(reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetGetByIdStructureID, reinterpret_cast<uint32_t>(structureID));
}
ctiRepatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(Machine::cti_op_put_by_id_generic));
// Repatch the offset into the propoerty map to load from, then repatch the StructureID to look for.
- X86Assembler::repatchDisplacement(reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetPutByIdPropertyMapOffset, cachedOffset * sizeof(JSValue*));
+ X86Assembler::repatchDisplacement(reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetPutByIdPropertyMapOffset, cachedOffset * sizeof(JSValuePtr));
X86Assembler::repatchImmediate(reinterpret_cast<intptr_t>(info.hotPathBegin) + repatchOffsetPutByIdStructureID, reinterpret_cast<uint32_t>(structureID));
}
#define ARG_callFrame static_cast<CallFrame*>(ARGS[CTI_ARGS_callFrame])
#define ARG_registerFile static_cast<RegisterFile*>(ARGS[CTI_ARGS_registerFile])
-#define ARG_exception static_cast<JSValue**>(ARGS[CTI_ARGS_exception])
+#define ARG_exception static_cast<JSValuePtr*>(ARGS[CTI_ARGS_exception])
#define ARG_profilerReference static_cast<Profiler**>(ARGS[CTI_ARGS_profilerReference])
#define ARG_globalData static_cast<JSGlobalData*>(ARGS[CTI_ARGS_globalData])
#define ARG_setCallFrame(newCallFrame) (ARGS[CTI_ARGS_callFrame] = (newCallFrame))
-#define ARG_src1 static_cast<JSValue*>(ARGS[1])
-#define ARG_src2 static_cast<JSValue*>(ARGS[2])
-#define ARG_src3 static_cast<JSValue*>(ARGS[3])
-#define ARG_src4 static_cast<JSValue*>(ARGS[4])
-#define ARG_src5 static_cast<JSValue*>(ARGS[5])
+#define ARG_src1 static_cast<JSValuePtr>(ARGS[1])
+#define ARG_src2 static_cast<JSValuePtr>(ARGS[2])
+#define ARG_src3 static_cast<JSValuePtr>(ARGS[3])
+#define ARG_src4 static_cast<JSValuePtr>(ARGS[4])
+#define ARG_src5 static_cast<JSValuePtr>(ARGS[5])
#define ARG_id1 static_cast<Identifier*>(ARGS[1])
#define ARG_id2 static_cast<Identifier*>(ARGS[2])
#define ARG_id3 static_cast<Identifier*>(ARGS[3])
struct OperandTypes;
struct StructureStubInfo;
- typedef JSValue* (SFX_CALL *CTIHelper_j)(CTI_ARGS);
+ typedef JSValuePtr (SFX_CALL *CTIHelper_j)(CTI_ARGS);
typedef JSPropertyNameIterator* (SFX_CALL *CTIHelper_p)(CTI_ARGS);
typedef void (SFX_CALL *CTIHelper_v)(CTI_ARGS);
typedef void* (SFX_CALL *CTIHelper_s)(CTI_ARGS);
};
extern "C" {
- JSValue* ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValue** exception, Profiler**, JSGlobalData*);
+ JSValuePtr ctiTrampoline(void* code, RegisterFile*, CallFrame*, JSValuePtr* exception, Profiler**, JSGlobalData*);
void ctiVMThrowTrampoline();
};
static void linkCall(CodeBlock* callerCodeBlock, JSFunction* callee, CodeBlock* calleeCodeBlock, void* ctiCode, void* returnAddress, int callerArgCount);
static void unlinkCall(StructureStubInfo*);
- inline static JSValue* execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValue** exception)
+ inline static JSValuePtr execute(void* code, RegisterFile* registerFile, CallFrame* callFrame, JSGlobalData* globalData, JSValuePtr* exception)
{
return ctiTrampoline(code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData);
}
private:
CTI(Machine*, CallFrame*, CodeBlock*);
- static uintptr_t asInteger(JSValue*);
+ static uintptr_t asInteger(JSValuePtr);
bool isConstant(int src);
- JSValue* getConstant(CallFrame*, int src);
+ JSValuePtr getConstant(CallFrame*, int src);
void privateCompileMainPass();
void privateCompileLinkPass();
void emitPutToCallFrameHeader(X86Assembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry);
void emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, X86Assembler::RegisterID to);
- JSValue* getConstantImmediateNumericArg(unsigned src);
- unsigned getDeTaggedConstantImmediate(JSValue* imm);
+ JSValuePtr getConstantImmediateNumericArg(unsigned src);
+ unsigned getDeTaggedConstantImmediate(JSValuePtr imm);
void emitJumpSlowCaseIfIsJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex);
void emitJumpSlowCaseIfNotJSCell(X86Assembler::RegisterID reg, unsigned opcodeIndex);
return result;
}
-static UString valueToSourceString(ExecState* exec, JSValue* val)
+static UString valueToSourceString(ExecState* exec, JSValuePtr val)
{
if (val->isString()) {
UString result("\"");
return (UString("r") + UString::from(r)).UTF8String();
}
-static CString constantName(ExecState* exec, int k, JSValue* value)
+static CString constantName(ExecState* exec, int k, JSValuePtr value)
{
return (valueToSourceString(exec, value) + "(@k" + UString::from(k) + ")").UTF8String();
}
}
case op_resolve_global: {
int r0 = (++it)->u.operand;
- JSValue* scope = static_cast<JSValue*>((++it)->u.jsCell);
+ JSValuePtr scope = static_cast<JSValuePtr>((++it)->u.jsCell);
int id0 = (++it)->u.operand;
printf("[%4d] resolve_global\t %s, %s, %s\n", location, registerName(r0).c_str(), valueToSourceString(exec, scope).ascii(), idName(id0, identifiers[id0]).c_str());
it += 2;
}
case op_get_global_var: {
int r0 = (++it)->u.operand;
- JSValue* scope = static_cast<JSValue*>((++it)->u.jsCell);
+ JSValuePtr scope = static_cast<JSValuePtr>((++it)->u.jsCell);
int index = (++it)->u.operand;
printf("[%4d] get_global_var\t %s, %s, %d\n", location, registerName(r0).c_str(), valueToSourceString(exec, scope).ascii(), index);
break;
}
case op_put_global_var: {
- JSValue* scope = static_cast<JSValue*>((++it)->u.jsCell);
+ JSValuePtr scope = static_cast<JSValuePtr>((++it)->u.jsCell);
int index = (++it)->u.operand;
int r0 = (++it)->u.operand;
printf("[%4d] put_global_var\t %s, %d, %s\n", location, valueToSourceString(exec, scope).ascii(), index, registerName(r0).c_str());
class EvalCodeCache {
public:
- PassRefPtr<EvalNode> get(ExecState* exec, const UString& evalSource, ScopeChainNode* scopeChain, JSValue*& exceptionValue)
+ PassRefPtr<EvalNode> get(ExecState* exec, const UString& evalSource, ScopeChainNode* scopeChain, JSValuePtr& exceptionValue)
{
RefPtr<EvalNode> evalNode;
Vector<RefPtr<FuncDeclNode> > functions;
Vector<RefPtr<FuncExprNode> > functionExpressions;
Vector<Register> constantRegisters;
- Vector<JSValue*> unexpectedConstants;
+ Vector<JSValuePtr> unexpectedConstants;
Vector<RefPtr<RegExp> > regexps;
Vector<HandlerInfo> exceptionHandlers;
Vector<ExpressionRangeInfo> expressionInfo;
return result.first->second;
}
-RegisterID* CodeGenerator::addConstant(JSValue* v)
+RegisterID* CodeGenerator::addConstant(JSValuePtr v)
{
pair<JSValueMap::iterator, bool> result = m_jsValueMap.add(v, m_nextConstant);
if (result.second) {
return ®isterFor(result.first->second);
}
-unsigned CodeGenerator::addUnexpectedConstant(JSValue* v)
+unsigned CodeGenerator::addUnexpectedConstant(JSValuePtr v)
{
int index = m_codeBlock->unexpectedConstants.size();
m_codeBlock->unexpectedConstants.append(v);
// 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));
- JSValue*& valueInMap = m_numberMap.add(number, noValue()).first->second;
+ JSValuePtr& valueInMap = m_numberMap.add(number, noValue()).first->second;
if (!valueInMap)
valueInMap = jsNumber(globalData(), number);
return emitLoad(dst, valueInMap);
return emitLoad(dst, valueInMap);
}
-RegisterID* CodeGenerator::emitLoad(RegisterID* dst, JSValue* v)
+RegisterID* CodeGenerator::emitLoad(RegisterID* dst, JSValuePtr v)
{
RegisterID* constantID = addConstant(v);
if (dst)
return dst;
}
-RegisterID* CodeGenerator::emitGetScopedVar(RegisterID* dst, size_t depth, int index, JSValue* globalObject)
+RegisterID* CodeGenerator::emitGetScopedVar(RegisterID* dst, size_t depth, int index, JSValuePtr globalObject)
{
if (globalObject) {
emitOpcode(op_get_global_var);
return dst;
}
-RegisterID* CodeGenerator::emitPutScopedVar(size_t depth, int index, RegisterID* value, JSValue* globalObject)
+RegisterID* CodeGenerator::emitPutScopedVar(size_t depth, int index, RegisterID* value, JSValuePtr globalObject)
{
if (globalObject) {
emitOpcode(op_put_global_var);
return targetRegister;
}
-RegisterID* CodeGenerator::emitNewError(RegisterID* dst, ErrorType type, JSValue* message)
+RegisterID* CodeGenerator::emitNewError(RegisterID* dst, ErrorType type, JSValuePtr message)
{
emitOpcode(op_new_error);
instructions().append(dst->index());
RegisterID* emitLoad(RegisterID* dst, bool);
RegisterID* emitLoad(RegisterID* dst, double);
RegisterID* emitLoad(RegisterID* dst, const Identifier&);
- RegisterID* emitLoad(RegisterID* dst, JSValue*);
+ RegisterID* emitLoad(RegisterID* dst, JSValuePtr);
RegisterID* emitUnexpectedLoad(RegisterID* dst, bool);
RegisterID* emitUnexpectedLoad(RegisterID* dst, double);
RegisterID* emitIn(RegisterID* dst, RegisterID* property, RegisterID* base) { return emitBinaryOp(op_in, dst, property, base, OperandTypes()); }
RegisterID* emitResolve(RegisterID* dst, const Identifier& property);
- RegisterID* emitGetScopedVar(RegisterID* dst, size_t skip, int index, JSValue* globalObject);
- RegisterID* emitPutScopedVar(size_t skip, int index, RegisterID* value, JSValue* globalObject);
+ RegisterID* emitGetScopedVar(RegisterID* dst, size_t skip, int index, JSValuePtr globalObject);
+ RegisterID* emitPutScopedVar(size_t skip, int index, RegisterID* value, JSValuePtr globalObject);
RegisterID* emitResolveBase(RegisterID* dst, const Identifier& property);
RegisterID* emitResolveWithBase(RegisterID* baseDst, RegisterID* propDst, const Identifier& property);
RegisterID* emitCatch(RegisterID*, LabelID* start, LabelID* end);
void emitThrow(RegisterID* exc) { emitUnaryNoDstOp(op_throw, exc); }
- RegisterID* emitNewError(RegisterID* dst, ErrorType type, JSValue* message);
+ RegisterID* emitNewError(RegisterID* dst, ErrorType type, JSValuePtr message);
void emitPushNewScope(RegisterID* dst, Identifier& property, RegisterID* value);
RegisterID* emitPushScope(RegisterID* scope);
PassRefPtr<LabelID> emitComplexJumpScopes(LabelID* target, ControlFlowContext* topScope, ControlFlowContext* bottomScope);
- struct JSValueHashTraits : HashTraits<JSValue*> {
- static void constructDeletedValue(JSValue*& slot) { slot = JSImmediate::impossibleValue(); }
- static bool isDeletedValue(JSValue* value) { return value == JSImmediate::impossibleValue(); }
+ struct JSValueHashTraits : HashTraits<JSValuePtr> {
+ static void constructDeletedValue(JSValuePtr& slot) { slot = JSImmediate::impossibleValue(); }
+ static bool isDeletedValue(JSValuePtr value) { return value == JSImmediate::impossibleValue(); }
};
- typedef HashMap<JSValue*, unsigned, PtrHash<JSValue*>, JSValueHashTraits> JSValueMap;
+ typedef HashMap<JSValuePtr, unsigned, PtrHash<JSValuePtr>, JSValueHashTraits> JSValueMap;
struct IdentifierMapIndexHashTraits {
typedef int TraitType;
};
typedef HashMap<RefPtr<UString::Rep>, int, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap;
- typedef HashMap<double, JSValue*> NumberMap;
+ typedef HashMap<double, JSValuePtr> NumberMap;
typedef HashMap<UString::Rep*, JSString*, IdentifierRepHash> IdentifierStringMap;
RegisterID* emitCall(OpcodeID, RegisterID*, RegisterID*, RegisterID*, ArgumentsNode*, unsigned divot, unsigned startOffset, unsigned endOffset);
unsigned addConstant(FuncDeclNode*);
unsigned addConstant(FuncExprNode*);
unsigned addConstant(const Identifier&);
- RegisterID* addConstant(JSValue*);
- unsigned addUnexpectedConstant(JSValue*);
+ RegisterID* addConstant(JSValuePtr);
+ unsigned addUnexpectedConstant(JSValuePtr);
unsigned addRegExp(RegExp* r);
StructureID* addStructureID();
virtual bool isWatchdogException() const { return true; }
};
-JSValue* createInterruptedExecutionException(JSGlobalData* globalData)
+JSValuePtr createInterruptedExecutionException(JSGlobalData* globalData)
{
return new (globalData) InterruptedExecutionError(globalData);
}
-JSValue* createError(ExecState* exec, ErrorType e, const char* msg)
+JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg)
{
return Error::create(exec, e, msg, -1, -1, 0);
}
-JSValue* createError(ExecState* exec, ErrorType e, const char* msg, const Identifier& label)
+JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg, const Identifier& label)
{
UString message = msg;
substitute(message, label.ustring());
return Error::create(exec, e, message, -1, -1, 0);
}
-JSValue* createError(ExecState* exec, ErrorType e, const char* msg, JSValue* v)
+JSValuePtr createError(ExecState* exec, ErrorType e, const char* msg, JSValuePtr v)
{
UString message = msg;
substitute(message, v->toString(exec));
return Error::create(exec, e, message, -1, -1, 0);
}
-JSValue* createStackOverflowError(ExecState* exec)
+JSValuePtr createStackOverflowError(ExecState* exec)
{
return createError(exec, RangeError, "Maximum call stack size exceeded.");
}
-JSValue* createUndefinedVariableError(ExecState* exec, const Identifier& ident, const Instruction* vPC, CodeBlock* codeBlock)
+JSValuePtr createUndefinedVariableError(ExecState* exec, const Identifier& ident, const Instruction* vPC, CodeBlock* codeBlock)
{
int startOffset = 0;
int endOffset = 0;
bool isStrWhiteSpace(UChar c);
-static UString createErrorMessage(ExecState* exec, CodeBlock* codeBlock, int, int expressionStart, int expressionStop, JSValue* value, UString error)
+static UString createErrorMessage(ExecState* exec, CodeBlock* codeBlock, int, int expressionStart, int expressionStop, JSValuePtr value, UString error)
{
if (!expressionStop || expressionStart > codeBlock->source->length()) {
UString errorText = value->toString(exec);
return errorText;
}
-JSObject* createInvalidParamError(ExecState* exec, const char* op, JSValue* value, const Instruction* vPC, CodeBlock* codeBlock)
+JSObject* createInvalidParamError(ExecState* exec, const char* op, JSValuePtr value, const Instruction* vPC, CodeBlock* codeBlock)
{
UString message = "not a valid argument for '";
message.append(op);
return exception;
}
-JSObject* createNotAConstructorError(ExecState* exec, JSValue* value, const Instruction* vPC, CodeBlock* codeBlock)
+JSObject* createNotAConstructorError(ExecState* exec, JSValuePtr value, const Instruction* vPC, CodeBlock* codeBlock)
{
int startOffset = 0;
int endOffset = 0;
return exception;
}
-JSValue* createNotAFunctionError(ExecState* exec, JSValue* value, const Instruction* vPC, CodeBlock* codeBlock)
+JSValuePtr createNotAFunctionError(ExecState* exec, JSValuePtr value, const Instruction* vPC, CodeBlock* codeBlock)
{
int startOffset = 0;
int endOffset = 0;
#ifndef ExceptionHelpers_h
#define ExceptionHelpers_h
+#include "JSImmediate.h"
+
namespace JSC {
class CodeBlock;
class JSValue;
class Node;
- JSValue* createInterruptedExecutionException(JSGlobalData*);
- JSValue* createStackOverflowError(ExecState*);
- JSValue* createUndefinedVariableError(ExecState*, const Identifier&, const Instruction*, CodeBlock*);
+ JSValuePtr createInterruptedExecutionException(JSGlobalData*);
+ JSValuePtr createStackOverflowError(ExecState*);
+ JSValuePtr createUndefinedVariableError(ExecState*, const Identifier&, const Instruction*, CodeBlock*);
JSNotAnObjectErrorStub* createNotAnObjectErrorStub(ExecState*, bool isNull);
- JSObject* createInvalidParamError(ExecState*, const char* op, JSValue*, const Instruction*, CodeBlock*);
- JSObject* createNotAConstructorError(ExecState*, JSValue*, const Instruction*, CodeBlock*);
- JSValue* createNotAFunctionError(ExecState*, JSValue*, const Instruction*, CodeBlock*);
+ JSObject* createInvalidParamError(ExecState*, const char* op, JSValuePtr, const Instruction*, CodeBlock*);
+ JSObject* createNotAConstructorError(ExecState*, JSValuePtr, const Instruction*, CodeBlock*);
+ JSValuePtr createNotAFunctionError(ExecState*, JSValuePtr, const Instruction*, CodeBlock*);
JSObject* createNotAnObjectError(ExecState*, JSNotAnObjectErrorStub*, const Instruction*, CodeBlock*);
} // namespace JSC
{
}
-JSValue* JSPropertyNameIterator::toPrimitive(ExecState*, PreferredPrimitiveType) const
+JSValuePtr JSPropertyNameIterator::toPrimitive(ExecState*, PreferredPrimitiveType) const
{
ASSERT_NOT_REACHED();
return noValue();
}
-bool JSPropertyNameIterator::getPrimitiveNumber(ExecState*, double&, JSValue*&)
+bool JSPropertyNameIterator::getPrimitiveNumber(ExecState*, double&, JSValuePtr&)
{
ASSERT_NOT_REACHED();
return false;
class JSPropertyNameIterator : public JSCell {
public:
- static JSPropertyNameIterator* create(ExecState*, JSValue*);
+ static JSPropertyNameIterator* create(ExecState*, JSValuePtr);
virtual ~JSPropertyNameIterator();
- virtual JSValue* toPrimitive(ExecState*, PreferredPrimitiveType) const;
- virtual bool getPrimitiveNumber(ExecState*, double&, JSValue*&);
+ virtual JSValuePtr toPrimitive(ExecState*, PreferredPrimitiveType) const;
+ virtual bool getPrimitiveNumber(ExecState*, double&, JSValuePtr&);
virtual bool toBoolean(ExecState*) const;
virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const;
virtual void mark();
- JSValue* next(ExecState*);
+ JSValuePtr next(ExecState*);
void invalidate();
private:
{
}
-inline JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSValue* v)
+inline JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSValuePtr v)
{
if (v->isUndefinedOrNull())
return new (exec) JSPropertyNameIterator;
return new (exec) JSPropertyNameIterator(o, propertyNames.releaseData());
}
-inline JSValue* JSPropertyNameIterator::next(ExecState* exec)
+inline JSValuePtr JSPropertyNameIterator::next(ExecState* exec)
{
if (m_position == m_end)
return noValue();
// FIXME: This operation should be called "getNumber", not "isNumber" (as it is in JSValue.h).
// FIXME: There's no need to have a "slow" version of this. All versions should be fast.
-static ALWAYS_INLINE bool fastIsNumber(JSValue* value, double& arg)
+static ALWAYS_INLINE bool fastIsNumber(JSValuePtr value, double& arg)
{
if (JSImmediate::isNumber(value))
arg = JSImmediate::getTruncatedInt32(value);
return true;
}
-// FIXME: Why doesn't JSValue*::toInt32 have the Heap::isNumber optimization?
-static bool fastToInt32(JSValue* value, int32_t& arg)
+// FIXME: Why doesn't JSValuePtr::toInt32 have the Heap::isNumber optimization?
+static bool fastToInt32(JSValuePtr value, int32_t& arg)
{
if (JSImmediate::isNumber(value))
arg = JSImmediate::getTruncatedInt32(value);
return true;
}
-static ALWAYS_INLINE bool fastToUInt32(JSValue* value, uint32_t& arg)
+static ALWAYS_INLINE bool fastToUInt32(JSValuePtr value, uint32_t& arg)
{
if (JSImmediate::isNumber(value)) {
if (JSImmediate::getTruncatedUInt32(value, arg))
return true;
}
-static inline bool jsLess(CallFrame* callFrame, JSValue* v1, JSValue* v2)
+static inline bool jsLess(CallFrame* callFrame, JSValuePtr v1, JSValuePtr v2)
{
if (JSImmediate::areBothImmediateNumbers(v1, v2))
return JSImmediate::getTruncatedInt32(v1) < JSImmediate::getTruncatedInt32(v2);
if (machine->isJSString(v1) && machine->isJSString(v2))
return asString(v1)->value() < asString(v2)->value();
- JSValue* p1;
- JSValue* p2;
+ JSValuePtr p1;
+ JSValuePtr p2;
bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
return asString(p1)->value() < asString(p2)->value();
}
-static inline bool jsLessEq(CallFrame* callFrame, JSValue* v1, JSValue* v2)
+static inline bool jsLessEq(CallFrame* callFrame, JSValuePtr v1, JSValuePtr v2)
{
if (JSImmediate::areBothImmediateNumbers(v1, v2))
return JSImmediate::getTruncatedInt32(v1) <= JSImmediate::getTruncatedInt32(v2);
if (machine->isJSString(v1) && machine->isJSString(v2))
return !(asString(v2)->value() < asString(v1)->value());
- JSValue* p1;
- JSValue* p2;
+ JSValuePtr p1;
+ JSValuePtr p2;
bool wasNotString1 = v1->getPrimitiveNumber(callFrame, n1, p1);
bool wasNotString2 = v2->getPrimitiveNumber(callFrame, n2, p2);
return !(asString(p2)->value() < asString(p1)->value());
}
-static NEVER_INLINE JSValue* jsAddSlowCase(CallFrame* callFrame, JSValue* v1, JSValue* v2)
+static NEVER_INLINE JSValuePtr jsAddSlowCase(CallFrame* callFrame, JSValuePtr v1, JSValuePtr v2)
{
// exception for the Date exception in defaultValue()
- JSValue* p1 = v1->toPrimitive(callFrame);
- JSValue* p2 = v2->toPrimitive(callFrame);
+ JSValuePtr p1 = v1->toPrimitive(callFrame);
+ JSValuePtr p2 = v2->toPrimitive(callFrame);
if (p1->isString() || p2->isString()) {
RefPtr<UString::Rep> value = concatenate(p1->toString(callFrame).rep(), p2->toString(callFrame).rep());
// 13962 Add case: 5 3
// 4000 Add case: 3 5
-static ALWAYS_INLINE JSValue* jsAdd(CallFrame* callFrame, JSValue* v1, JSValue* v2)
+static ALWAYS_INLINE JSValuePtr jsAdd(CallFrame* callFrame, JSValuePtr v1, JSValuePtr v2)
{
double left;
double right = 0.0;
return jsAddSlowCase(callFrame, v1, v2);
}
-static JSValue* jsTypeStringForValue(CallFrame* callFrame, JSValue* v)
+static JSValuePtr jsTypeStringForValue(CallFrame* callFrame, JSValuePtr v)
{
if (v->isUndefined())
return jsNontrivialString(callFrame, "undefined");
return jsNontrivialString(callFrame, "object");
}
-static bool jsIsObjectType(JSValue* v)
+static bool jsIsObjectType(JSValuePtr v)
{
if (JSImmediate::isImmediate(v))
return v->isNull();
return true;
}
-static bool jsIsFunctionType(JSValue* v)
+static bool jsIsFunctionType(JSValuePtr v)
{
if (v->isObject()) {
CallData callData;
return false;
}
-NEVER_INLINE bool Machine::resolve(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolve(CallFrame* callFrame, Instruction* vPC, JSValuePtr& exceptionValue)
{
int dst = (vPC + 1)->u.operand;
int property = (vPC + 2)->u.operand;
JSObject* o = *iter;
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
exceptionValue = callFrame->globalData().exception;
if (exceptionValue)
return false;
return false;
}
-NEVER_INLINE bool Machine::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveSkip(CallFrame* callFrame, Instruction* vPC, JSValuePtr& exceptionValue)
{
CodeBlock* codeBlock = callFrame->codeBlock();
JSObject* o = *iter;
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
exceptionValue = callFrame->globalData().exception;
if (exceptionValue)
return false;
return false;
}
-NEVER_INLINE bool Machine::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveGlobal(CallFrame* callFrame, Instruction* vPC, JSValuePtr& exceptionValue)
{
int dst = (vPC + 1)->u.operand;
JSGlobalObject* globalObject = static_cast<JSGlobalObject*>((vPC + 2)->u.jsCell);
Identifier& ident = codeBlock->identifiers[property];
PropertySlot slot(globalObject);
if (globalObject->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
if (slot.isCacheable()) {
if (vPC[4].u.structureID)
vPC[4].u.structureID->deref();
return false;
}
-static ALWAYS_INLINE JSValue* inlineResolveBase(CallFrame* callFrame, Identifier& property, ScopeChainNode* scopeChain)
+static ALWAYS_INLINE JSValuePtr inlineResolveBase(CallFrame* callFrame, Identifier& property, ScopeChainNode* scopeChain)
{
ScopeChainIterator iter = scopeChain->begin();
ScopeChainIterator next = iter;
callFrame[dst] = inlineResolveBase(callFrame, callFrame->codeBlock()->identifiers[property], callFrame->scopeChain());
}
-NEVER_INLINE bool Machine::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveBaseAndProperty(CallFrame* callFrame, Instruction* vPC, JSValuePtr& exceptionValue)
{
int baseDst = (vPC + 1)->u.operand;
int propDst = (vPC + 2)->u.operand;
base = *iter;
PropertySlot slot(base);
if (base->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
exceptionValue = callFrame->globalData().exception;
if (exceptionValue)
return false;
return false;
}
-NEVER_INLINE bool Machine::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValue*& exceptionValue)
+NEVER_INLINE bool Machine::resolveBaseAndFunc(CallFrame* callFrame, Instruction* vPC, JSValuePtr& exceptionValue)
{
int baseDst = (vPC + 1)->u.operand;
int funcDst = (vPC + 2)->u.operand;
// that in host objects you always get a valid object for this.
// We also handle wrapper substitution for the global object at the same time.
JSObject* thisObj = base->toThisObject(callFrame);
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
exceptionValue = callFrame->globalData().exception;
if (exceptionValue)
return false;
return CallFrame::create(r);
}
-static NEVER_INLINE bool isNotObject(CallFrame* callFrame, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValue* value, JSValue*& exceptionData)
+static NEVER_INLINE bool isNotObject(CallFrame* callFrame, bool forInstanceOf, CodeBlock* codeBlock, const Instruction* vPC, JSValuePtr value, JSValuePtr& exceptionData)
{
if (value->isObject())
return false;
return true;
}
-NEVER_INLINE JSValue* Machine::callEval(CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, int argv, int argc, JSValue*& exceptionValue)
+NEVER_INLINE JSValuePtr Machine::callEval(CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, RegisterFile* registerFile, int argv, int argc, JSValuePtr& exceptionValue)
{
if (argc < 2)
return jsUndefined();
- JSValue* program = callFrame[argv + 1].jsValue(callFrame);
+ JSValuePtr program = callFrame[argv + 1].jsValue(callFrame);
if (!program->isString())
return program;
CodeBlock* codeBlock = callFrame->codeBlock();
RefPtr<EvalNode> evalNode = codeBlock->evalCodeCache.get(callFrame, programSource, scopeChain, exceptionValue);
- JSValue* result = jsUndefined();
+ JSValuePtr result = jsUndefined();
if (evalNode)
result = callFrame->globalData().machine->execute(evalNode.get(), callFrame, thisObj, callFrame->registers() - registerFile->start() + argv + 1 + RegisterFile::CallFrameHeaderSize, scopeChain, &exceptionValue);
#endif
}
-NEVER_INLINE bool Machine::unwindCallFrame(CallFrame*& callFrame, JSValue* exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock)
+NEVER_INLINE bool Machine::unwindCallFrame(CallFrame*& callFrame, JSValuePtr exceptionValue, const Instruction*& vPC, CodeBlock*& codeBlock)
{
CodeBlock* oldCodeBlock = codeBlock;
ScopeChainNode* scopeChain = callFrame->scopeChain();
return true;
}
-NEVER_INLINE Instruction* Machine::throwException(CallFrame*& callFrame, JSValue*& exceptionValue, const Instruction* vPC, bool explicitThrow)
+NEVER_INLINE Instruction* Machine::throwException(CallFrame*& callFrame, JSValuePtr& exceptionValue, const Instruction* vPC, bool explicitThrow)
{
// Set up the exception object
JSGlobalObject* m_savedDynamicGlobalObject;
};
-JSValue* Machine::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValue** exception)
+JSValuePtr Machine::execute(ProgramNode* programNode, CallFrame* callFrame, ScopeChainNode* scopeChain, JSObject* thisObj, JSValuePtr* exception)
{
ASSERT(!scopeChain->globalData->exception);
#if ENABLE(CTI)
if (!codeBlock->ctiCode)
CTI::compile(this, newCallFrame, codeBlock);
- JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
+ JSValuePtr result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
#else
- JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ JSValuePtr result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
#endif
m_reentryDepth--;
return result;
}
-JSValue* Machine::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValue** exception)
+JSValuePtr Machine::execute(FunctionBodyNode* functionBodyNode, CallFrame* callFrame, JSFunction* function, JSObject* thisObj, const ArgList& args, ScopeChainNode* scopeChain, JSValuePtr* exception)
{
ASSERT(!scopeChain->globalData->exception);
#if ENABLE(CTI)
if (!codeBlock->ctiCode)
CTI::compile(this, newCallFrame, codeBlock);
- JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
+ JSValuePtr result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
#else
- JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ JSValuePtr result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
#endif
m_reentryDepth--;
return result;
}
-JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception)
+JSValuePtr Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, ScopeChainNode* scopeChain, JSValuePtr* exception)
{
return execute(evalNode, callFrame, thisObj, m_registerFile.size() + evalNode->byteCode(scopeChain).numParameters + RegisterFile::CallFrameHeaderSize, scopeChain, exception);
}
-JSValue* Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValue** exception)
+JSValuePtr Machine::execute(EvalNode* evalNode, CallFrame* callFrame, JSObject* thisObj, int registerOffset, ScopeChainNode* scopeChain, JSValuePtr* exception)
{
ASSERT(!scopeChain->globalData->exception);
#if ENABLE(CTI)
if (!codeBlock->ctiCode)
CTI::compile(this, newCallFrame, codeBlock);
- JSValue* result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
+ JSValuePtr result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);
#else
- JSValue* result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
+ JSValuePtr result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);
#endif
m_reentryDepth--;
// We have to return a JSValue here, gcc seems to produce worse code if
// we attempt to return a bool
-ALWAYS_INLINE JSValue* Machine::checkTimeout(JSGlobalObject* globalObject)
+ALWAYS_INLINE JSValuePtr Machine::checkTimeout(JSGlobalObject* globalObject)
{
unsigned currentTime = getCPUTime();
int dst = (++vPC)->u.operand;
CodeBlock* codeBlock = callFrame->codeBlock();
Identifier& property = codeBlock->identifiers[(++vPC)->u.operand];
- JSValue* value = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr value = callFrame[(++vPC)->u.operand].jsValue(callFrame);
JSObject* scope = new (callFrame) JSStaticScopeObject(callFrame, property, value, DontDelete);
callFrame[dst] = scope;
static StructureIDChain* cachePrototypeChain(CallFrame* callFrame, StructureID* structureID)
{
- JSValue* prototype = structureID->prototypeForLookup(callFrame);
+ JSValuePtr prototype = structureID->prototypeForLookup(callFrame);
if (JSImmediate::isImmediate(prototype))
return 0;
RefPtr<StructureIDChain> chain = StructureIDChain::create(asObject(prototype)->structureID());
return structureID->cachedPrototypeChain();
}
-NEVER_INLINE void Machine::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const PutPropertySlot& slot)
+NEVER_INLINE void Machine::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValuePtr baseValue, const PutPropertySlot& slot)
{
// Recursive invocation may already have specialized this instruction.
if (vPC[0].u.opcode != getOpcode(op_put_by_id))
vPC[4] = 0;
}
-NEVER_INLINE void Machine::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
+NEVER_INLINE void Machine::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, Instruction* vPC, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot& slot)
{
// Recursive invocation may already have specialized this instruction.
if (vPC[0].u.opcode != getOpcode(op_get_by_id))
size_t count = 0;
JSObject* o = asObject(baseValue);
while (slot.slotBase() != o) {
- JSValue* v = o->structureID()->prototypeForLookup(callFrame);
+ JSValuePtr v = o->structureID()->prototypeForLookup(callFrame);
// If we didn't find base in baseValue's prototype chain, then baseValue
// must be a proxy for another object.
vPC[4] = 0;
}
-JSValue* Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValue** exception)
+JSValuePtr Machine::privateExecute(ExecutionFlag flag, RegisterFile* registerFile, CallFrame* callFrame, JSValuePtr* exception)
{
// One-time initialization of our address tables. We have to put this code
// here because our labels are only in scope inside this function.
#endif
JSGlobalData* globalData = &callFrame->globalData();
- JSValue* exceptionValue = noValue();
+ JSValuePtr exceptionValue = noValue();
Instruction* handlerVPC = 0;
Instruction* vPC = callFrame->codeBlock()->instructions.begin();
as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (JSImmediate::areBothImmediateNumbers(src1, src2))
callFrame[dst] = jsBoolean(src1 == src2);
else {
- JSValue* result = jsBoolean(equalSlowCase(callFrame, src1, src2));
+ JSValuePtr result = jsBoolean(equalSlowCase(callFrame, src1, src2));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
operator, and puts the result as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (src->isUndefinedOrNull()) {
callFrame[dst] = jsBoolean(true);
result as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (JSImmediate::areBothImmediateNumbers(src1, src2))
callFrame[dst] = jsBoolean(src1 != src2);
else {
- JSValue* result = jsBoolean(!equalSlowCase(callFrame, src1, src2));
+ JSValuePtr result = jsBoolean(!equalSlowCase(callFrame, src1, src2));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
operator, and puts the result as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (src->isUndefinedOrNull()) {
callFrame[dst] = jsBoolean(false);
result as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (JSImmediate::areBothImmediate(src1, src2))
callFrame[dst] = jsBoolean(src1 == src2);
else if (JSImmediate::isEitherImmediate(src1, src2) & (src1 != JSImmediate::zeroImmediate()) & (src2 != JSImmediate::zeroImmediate()))
puts the result as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (JSImmediate::areBothImmediate(src1, src2))
callFrame[dst] = jsBoolean(src1 != src2);
a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* result = jsBoolean(jsLess(callFrame, src1, src2));
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr result = jsBoolean(jsLess(callFrame, src1, src2));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
puts the result as a boolean in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* result = jsBoolean(jsLessEq(callFrame, src1, src2));
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr result = jsBoolean(jsLessEq(callFrame, src1, src2));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
back in register srcDst.
*/
int srcDst = (++vPC)->u.operand;
- JSValue* v = callFrame[srcDst].jsValue(callFrame);
+ JSValuePtr v = callFrame[srcDst].jsValue(callFrame);
if (JSImmediate::canDoFastAdditiveOperations(v))
callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
else {
- JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) + 1);
+ JSValuePtr result = jsNumber(callFrame, v->toNumber(callFrame) + 1);
VM_CHECK_EXCEPTION();
callFrame[srcDst] = result;
}
back in register srcDst.
*/
int srcDst = (++vPC)->u.operand;
- JSValue* v = callFrame[srcDst].jsValue(callFrame);
+ JSValuePtr v = callFrame[srcDst].jsValue(callFrame);
if (JSImmediate::canDoFastAdditiveOperations(v))
callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
else {
- JSValue* result = jsNumber(callFrame, v->toNumber(callFrame) - 1);
+ JSValuePtr result = jsNumber(callFrame, v->toNumber(callFrame) - 1);
VM_CHECK_EXCEPTION();
callFrame[srcDst] = result;
}
*/
int dst = (++vPC)->u.operand;
int srcDst = (++vPC)->u.operand;
- JSValue* v = callFrame[srcDst].jsValue(callFrame);
+ JSValuePtr v = callFrame[srcDst].jsValue(callFrame);
if (JSImmediate::canDoFastAdditiveOperations(v)) {
callFrame[dst] = v;
callFrame[srcDst] = JSImmediate::incImmediateNumber(v);
} else {
- JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
+ JSValuePtr number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
VM_CHECK_EXCEPTION();
callFrame[dst] = number;
callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() + 1);
*/
int dst = (++vPC)->u.operand;
int srcDst = (++vPC)->u.operand;
- JSValue* v = callFrame[srcDst].jsValue(callFrame);
+ JSValuePtr v = callFrame[srcDst].jsValue(callFrame);
if (JSImmediate::canDoFastAdditiveOperations(v)) {
callFrame[dst] = v;
callFrame[srcDst] = JSImmediate::decImmediateNumber(v);
} else {
- JSValue* number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
+ JSValuePtr number = callFrame[srcDst].jsValue(callFrame)->toJSNumber(callFrame);
VM_CHECK_EXCEPTION();
callFrame[dst] = number;
callFrame[srcDst] = jsNumber(callFrame, number->uncheckedGetNumber() - 1);
int dst = (++vPC)->u.operand;
int src = (++vPC)->u.operand;
- JSValue* srcVal = callFrame[src].jsValue(callFrame);
+ JSValuePtr srcVal = callFrame[src].jsValue(callFrame);
if (LIKELY(srcVal->isNumber()))
callFrame[dst] = callFrame[src];
else {
- JSValue* result = srcVal->toJSNumber(callFrame);
+ JSValuePtr result = srcVal->toJSNumber(callFrame);
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
result in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
double v;
if (fastIsNumber(src, v))
callFrame[dst] = jsNumber(callFrame, -v);
else {
- JSValue* result = jsNumber(callFrame, -src->toNumber(callFrame));
+ JSValuePtr result = jsNumber(callFrame, -src->toNumber(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
numeric add, depending on the types of the operands.)
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
callFrame[dst] = JSImmediate::addImmediateNumbers(src1, src2);
else {
- JSValue* result = jsAdd(callFrame, src1, src2);
+ JSValuePtr result = jsAdd(callFrame, src1, src2);
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
numbers), and puts the product in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
double left;
double right;
if (JSImmediate::areBothImmediateNumbers(src1, src2)) {
} else if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
callFrame[dst] = jsNumber(callFrame, left * right);
else {
- JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) * src2->toNumber(callFrame));
+ JSValuePtr result = jsNumber(callFrame, src1->toNumber(callFrame) * src2->toNumber(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
quotient in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* dividend = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* divisor = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr dividend = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr divisor = callFrame[(++vPC)->u.operand].jsValue(callFrame);
double left;
double right;
if (fastIsNumber(dividend, left) && fastIsNumber(divisor, right))
callFrame[dst] = jsNumber(callFrame, left / right);
else {
- JSValue* result = jsNumber(callFrame, dividend->toNumber(callFrame) / divisor->toNumber(callFrame));
+ JSValuePtr result = jsNumber(callFrame, dividend->toNumber(callFrame) / divisor->toNumber(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
int dividend = (++vPC)->u.operand;
int divisor = (++vPC)->u.operand;
- JSValue* dividendValue = callFrame[dividend].jsValue(callFrame);
- JSValue* divisorValue = callFrame[divisor].jsValue(callFrame);
+ JSValuePtr dividendValue = callFrame[dividend].jsValue(callFrame);
+ JSValuePtr divisorValue = callFrame[divisor].jsValue(callFrame);
if (JSImmediate::areBothImmediateNumbers(dividendValue, divisorValue) && divisorValue != JSImmediate::from(0)) {
callFrame[dst] = JSImmediate::from(JSImmediate::getTruncatedInt32(dividendValue) % JSImmediate::getTruncatedInt32(divisorValue));
}
double d = dividendValue->toNumber(callFrame);
- JSValue* result = jsNumber(callFrame, fmod(d, divisorValue->toNumber(callFrame)));
+ JSValuePtr result = jsNumber(callFrame, fmod(d, divisorValue->toNumber(callFrame)));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
++vPC;
register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
double left;
double right;
if (JSImmediate::canDoFastAdditiveOperations(src1) && JSImmediate::canDoFastAdditiveOperations(src2))
else if (fastIsNumber(src1, left) && fastIsNumber(src2, right))
callFrame[dst] = jsNumber(callFrame, left - right);
else {
- JSValue* result = jsNumber(callFrame, src1->toNumber(callFrame) - src2->toNumber(callFrame));
+ JSValuePtr result = jsNumber(callFrame, src1->toNumber(callFrame) - src2->toNumber(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int32_t left;
uint32_t right;
if (JSImmediate::areBothImmediateNumbers(val, shift))
else if (fastToInt32(val, left) && fastToUInt32(shift, right))
callFrame[dst] = jsNumber(callFrame, left << (right & 0x1f));
else {
- JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
+ JSValuePtr result = jsNumber(callFrame, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
uint32), and puts the result in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int32_t left;
uint32_t right;
if (JSImmediate::areBothImmediateNumbers(val, shift))
else if (fastToInt32(val, left) && fastToUInt32(shift, right))
callFrame[dst] = jsNumber(callFrame, left >> (right & 0x1f));
else {
- JSValue* result = jsNumber(callFrame, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
+ JSValuePtr result = jsNumber(callFrame, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
uint32), and puts the result in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr val = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr shift = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
callFrame[dst] = JSImmediate::rightShiftImmediateNumbers(val, shift);
else {
- JSValue* result = jsNumber(callFrame, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
+ JSValuePtr result = jsNumber(callFrame, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int32_t left;
int32_t right;
if (JSImmediate::areBothImmediateNumbers(src1, src2))
else if (fastToInt32(src1, left) && fastToInt32(src2, right))
callFrame[dst] = jsNumber(callFrame, left & right);
else {
- JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) & src2->toInt32(callFrame));
+ JSValuePtr result = jsNumber(callFrame, src1->toInt32(callFrame) & src2->toInt32(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int32_t left;
int32_t right;
if (JSImmediate::areBothImmediateNumbers(src1, src2))
else if (fastToInt32(src1, left) && fastToInt32(src2, right))
callFrame[dst] = jsNumber(callFrame, left ^ right);
else {
- JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
+ JSValuePtr result = jsNumber(callFrame, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
result in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int32_t left;
int32_t right;
if (JSImmediate::areBothImmediateNumbers(src1, src2))
else if (fastToInt32(src1, left) && fastToInt32(src2, right))
callFrame[dst] = jsNumber(callFrame, left | right);
else {
- JSValue* result = jsNumber(callFrame, src1->toInt32(callFrame) | src2->toInt32(callFrame));
+ JSValuePtr result = jsNumber(callFrame, src1->toInt32(callFrame) | src2->toInt32(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
and puts the result in register dst.
*/
int dst = (++vPC)->u.operand;
- JSValue* src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int32_t value;
if (fastToInt32(src, value))
callFrame[dst] = jsNumber(callFrame, ~value);
else {
- JSValue* result = jsNumber(callFrame, ~src->toInt32(callFrame));
+ JSValuePtr result = jsNumber(callFrame, ~src->toInt32(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
}
*/
int dst = (++vPC)->u.operand;
int src = (++vPC)->u.operand;
- JSValue* result = jsBoolean(!callFrame[src].jsValue(callFrame)->toBoolean(callFrame));
+ JSValuePtr result = jsBoolean(!callFrame[src].jsValue(callFrame)->toBoolean(callFrame));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
int base = (++vPC)->u.operand;
int baseProto = (++vPC)->u.operand;
- JSValue* baseVal = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseVal = callFrame[base].jsValue(callFrame);
if (isNotObject(callFrame, true, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
goto vm_throw;
*/
int dst = (++vPC)->u.operand;
int src = (++vPC)->u.operand;
- JSValue* v = callFrame[src].jsValue(callFrame);
+ JSValuePtr v = callFrame[src].jsValue(callFrame);
callFrame[dst] = jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
++vPC;
int property = (++vPC)->u.operand;
int base = (++vPC)->u.operand;
- JSValue* baseVal = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseVal = callFrame[base].jsValue(callFrame);
if (isNotObject(callFrame, false, callFrame->codeBlock(), vPC, baseVal, exceptionValue))
goto vm_throw;
JSObject* baseObj = asObject(baseVal);
- JSValue* propName = callFrame[property].jsValue(callFrame);
+ JSValuePtr propName = callFrame[property].jsValue(callFrame);
uint32_t i;
if (propName->getUInt32(i))
CodeBlock* codeBlock = callFrame->codeBlock();
Identifier& ident = codeBlock->identifiers[property];
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
PropertySlot slot(baseValue);
- JSValue* result = baseValue->get(callFrame, ident, slot);
+ JSValuePtr result = baseValue->get(callFrame, ident, slot);
VM_CHECK_EXCEPTION();
tryCacheGetByID(callFrame, codeBlock, vPC, baseValue, ident, slot);
op_get_by_id.
*/
int base = vPC[2].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
JSCell* baseCell = asCell(baseValue);
reverts to op_get_by_id.
*/
int base = vPC[2].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
JSCell* baseCell = asCell(baseValue);
reverts to op_get_by_id.
*/
int base = vPC[2].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
JSCell* baseCell = asCell(baseValue);
int property = vPC[3].u.operand;
Identifier& ident = callFrame->codeBlock()->identifiers[property];
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
PropertySlot slot(baseValue);
- JSValue* result = baseValue->get(callFrame, ident, slot);
+ JSValuePtr result = baseValue->get(callFrame, ident, slot);
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
*/
int base = vPC[2].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(isJSArray(baseValue))) {
int dst = vPC[1].u.operand;
callFrame[dst] = jsNumber(callFrame, asArray(baseValue)->length());
*/
int base = vPC[2].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(isJSString(baseValue))) {
int dst = vPC[1].u.operand;
callFrame[dst] = jsNumber(callFrame, asString(baseValue)->value().size());
int value = vPC[3].u.operand;
CodeBlock* codeBlock = callFrame->codeBlock();
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
Identifier& ident = codeBlock->identifiers[property];
PutPropertySlot slot;
baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
the register file.
*/
int base = vPC[1].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
JSCell* baseCell = asCell(baseValue);
RefPtr<StructureID>* it = vPC[6].u.structureIDChain->head();
- JSValue* proto = baseObject->structureID()->prototypeForLookup(callFrame);
+ JSValuePtr proto = baseObject->structureID()->prototypeForLookup(callFrame);
while (!proto->isNull()) {
if (UNLIKELY(asObject(proto)->structureID() != (*it).get())) {
uncachePutByID(callFrame->codeBlock(), vPC);
the register file.
*/
int base = vPC[1].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
if (LIKELY(!JSImmediate::isImmediate(baseValue))) {
JSCell* baseCell = asCell(baseValue);
int property = vPC[2].u.operand;
int value = vPC[3].u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
Identifier& ident = callFrame->codeBlock()->identifiers[property];
PutPropertySlot slot;
baseValue->put(callFrame, ident, callFrame[value].jsValue(callFrame), slot);
JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame);
Identifier& ident = callFrame->codeBlock()->identifiers[property];
- JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
+ JSValuePtr result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
VM_CHECK_EXCEPTION();
callFrame[dst] = result;
++vPC;
int base = (++vPC)->u.operand;
int property = (++vPC)->u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
- JSValue* subscript = callFrame[property].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr subscript = callFrame[property].jsValue(callFrame);
- JSValue* result;
+ JSValuePtr result;
unsigned i;
bool isUInt32 = JSImmediate::getUInt32(subscript, i);
int property = (++vPC)->u.operand;
int value = (++vPC)->u.operand;
- JSValue* baseValue = callFrame[base].jsValue(callFrame);
- JSValue* subscript = callFrame[property].jsValue(callFrame);
+ JSValuePtr baseValue = callFrame[base].jsValue(callFrame);
+ JSValuePtr subscript = callFrame[property].jsValue(callFrame);
unsigned i;
JSObject* baseObj = callFrame[base].jsValue(callFrame)->toObject(callFrame); // may throw
- JSValue* subscript = callFrame[property].jsValue(callFrame);
- JSValue* result;
+ JSValuePtr subscript = callFrame[property].jsValue(callFrame);
+ JSValuePtr result;
uint32_t i;
if (subscript->getUInt32(i))
result = jsBoolean(baseObj->deleteProperty(callFrame, i));
Additionally this loop instruction may terminate JS execution is
the JS timeout is reached.
*/
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int target = (++vPC)->u.operand;
bool result = jsLess(callFrame, src1, src2);
Additionally this loop instruction may terminate JS execution is
the JS timeout is reached.
*/
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int target = (++vPC)->u.operand;
bool result = jsLessEq(callFrame, src1, src2);
target from the current instruction, if and only if the
result of the comparison is false.
*/
- JSValue* src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
- JSValue* src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src1 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr src2 = callFrame[(++vPC)->u.operand].jsValue(callFrame);
int target = (++vPC)->u.operand;
bool result = jsLess(callFrame, src1, src2);
*/
int tableIndex = (++vPC)->u.operand;
int defaultOffset = (++vPC)->u.operand;
- JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (!JSImmediate::isNumber(scrutinee))
vPC += defaultOffset;
else {
*/
int tableIndex = (++vPC)->u.operand;
int defaultOffset = (++vPC)->u.operand;
- JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (!scrutinee->isString())
vPC += defaultOffset;
else {
*/
int tableIndex = (++vPC)->u.operand;
int defaultOffset = (++vPC)->u.operand;
- JSValue* scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
+ JSValuePtr scrutinee = callFrame[(++vPC)->u.operand].jsValue(callFrame);
if (!scrutinee->isString())
vPC += defaultOffset;
else
int argCount = (++vPC)->u.operand;
++vPC; // registerOffset
- JSValue* funcVal = callFrame[func].jsValue(callFrame);
- JSValue* baseVal = callFrame[thisVal].jsValue(callFrame);
+ JSValuePtr funcVal = callFrame[func].jsValue(callFrame);
+ JSValuePtr baseVal = callFrame[thisVal].jsValue(callFrame);
ScopeChainNode* scopeChain = callFrame->scopeChain();
if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
JSObject* thisObject = asObject(callFrame[callFrame->codeBlock()->thisRegister].jsValue(callFrame));
- JSValue* result = callEval(callFrame, thisObject, scopeChain, registerFile, firstArg, argCount, exceptionValue);
+ JSValuePtr result = callEval(callFrame, thisObject, scopeChain, registerFile, firstArg, argCount, exceptionValue);
if (exceptionValue)
goto vm_throw;
int argCount = (++vPC)->u.operand;
int registerOffset = (++vPC)->u.operand;
- JSValue* v = callFrame[func].jsValue(callFrame);
+ JSValuePtr v = callFrame[func].jsValue(callFrame);
CallData callData;
CallType callType = v->getCallData(callData);
}
if (callType == CallTypeHost) {
- JSValue* thisValue = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
+ JSValuePtr thisValue = thisVal == missingThisObjectMarker() ? callFrame->globalThisValue() : callFrame[thisVal].jsValue(callFrame);
ArgList args(callFrame->registers() + firstArg + 1, argCount - 1);
ScopeChainNode* scopeChain = callFrame->scopeChain();
MACHINE_SAMPLING_callingHostFunction();
- JSValue* returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args);
+ JSValuePtr returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args);
VM_CHECK_EXCEPTION();
callFrame[dst] = returnValue;
if (callFrame->codeBlock()->needsFullScopeChain)
callFrame->scopeChain()->deref();
- JSValue* returnValue = callFrame[result].jsValue(callFrame);
+ JSValuePtr returnValue = callFrame[result].jsValue(callFrame);
vPC = callFrame->returnPC();
int dst = callFrame->returnValueRegister();
}
BEGIN_OPCODE(op_convert_this) {
int thisRegister = (++vPC)->u.operand;
- JSValue* thisVal = callFrame[thisRegister].getJSValue();
+ JSValuePtr thisVal = callFrame[thisRegister].getJSValue();
if (thisVal->needsThisConversion())
callFrame[thisRegister] = thisVal->toThisObject(callFrame);
int argCount = (++vPC)->u.operand;
int registerOffset = (++vPC)->u.operand;
- JSValue* v = callFrame[constr].jsValue(callFrame);
+ JSValuePtr v = callFrame[constr].jsValue(callFrame);
ConstructData constructData;
ConstructType constructType = v->getConstructData(constructData);
CodeBlock* newCodeBlock = &functionBodyNode->byteCode(callDataScopeChain);
StructureID* structure;
- JSValue* prototype = callFrame[constrProto].jsValue(callFrame);
+ JSValuePtr prototype = callFrame[constrProto].jsValue(callFrame);
if (prototype->isObject())
structure = asObject(prototype)->inheritorID();
else
MACHINE_SAMPLING_callingHostFunction();
- JSValue* returnValue = constructData.native.function(callFrame, asObject(v), args);
+ JSValuePtr returnValue = constructData.native.function(callFrame, asObject(v), args);
callFrame = CallFrame::create(callFrame->registers() - registerOffset);
VM_CHECK_EXCEPTION();
of the current scope chain.
*/
int scope = (++vPC)->u.operand;
- JSValue* v = callFrame[scope].jsValue(callFrame);
+ JSValuePtr v = callFrame[scope].jsValue(callFrame);
JSObject* o = v->toObject(callFrame);
VM_CHECK_EXCEPTION();
int target = (++vPC)->u.operand;
JSPropertyNameIterator* it = callFrame[iter].propertyNameIterator();
- if (JSValue* temp = it->next(callFrame)) {
+ if (JSValuePtr temp = it->next(callFrame)) {
CHECK_FOR_TIMEOUT();
callFrame[dst] = temp;
vPC += target;
#undef CHECK_FOR_TIMEOUT
}
-JSValue* Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const
+JSValuePtr Machine::retrieveArguments(CallFrame* callFrame, JSFunction* function) const
{
CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
if (!functionCallFrame)
return arguments;
}
-JSValue* Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const
+JSValuePtr Machine::retrieveCaller(CallFrame* callFrame, InternalFunction* function) const
{
CallFrame* functionCallFrame = findFunctionCallFrame(callFrame, function);
if (!functionCallFrame)
if (callerFrame->hasHostCallFrameFlag())
return jsNull();
- JSValue* caller = callerFrame->callee();
+ JSValuePtr caller = callerFrame->callee();
if (!caller)
return jsNull();
return caller;
}
-void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const
+void Machine::retrieveLastCaller(CallFrame* callFrame, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValuePtr& function) const
{
function = noValue();
lineNumber = -1;
#if ENABLE(CTI)
-NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const PutPropertySlot& slot)
+NEVER_INLINE void Machine::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValuePtr baseValue, const PutPropertySlot& slot)
{
// The interpreter checks for recursion here; I do not believe this can occur in CTI.
return m_ctiStringLengthTrampoline;
}
-NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot& slot)
+NEVER_INLINE void Machine::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot& slot)
{
// FIXME: Write a test that proves we need to check for recursion here just
// like the interpreter does, then add a check for recursion.
size_t count = 0;
JSObject* o = asObject(baseValue);
while (slot.slotBase() != o) {
- JSValue* v = o->structureID()->prototypeForLookup(callFrame);
+ JSValuePtr v = o->structureID()->prototypeForLookup(callFrame);
// If we didn't find slotBase in baseValue's prototype chain, then baseValue
// must be a proxy for another object.
} \
} while (0)
-JSValue* Machine::cti_op_convert_this(CTI_ARGS)
+JSValuePtr Machine::cti_op_convert_this(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* v1 = ARG_src1;
+ JSValuePtr v1 = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
JSObject* result = v1->toThisObject(callFrame);
scopeChain->deref();
}
-JSValue* Machine::cti_op_add(CTI_ARGS)
+JSValuePtr Machine::cti_op_add(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* v1 = ARG_src1;
- JSValue* v2 = ARG_src2;
+ JSValuePtr v1 = ARG_src1;
+ JSValuePtr v2 = ARG_src2;
double left;
double right = 0.0;
}
// All other cases are pretty uncommon
- JSValue* result = jsAddSlowCase(callFrame, v1, v2);
+ JSValuePtr result = jsAddSlowCase(callFrame, v1, v2);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_pre_inc(CTI_ARGS)
+JSValuePtr Machine::cti_op_pre_inc(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* v = ARG_src1;
+ JSValuePtr v = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1);
+ JSValuePtr result = jsNumber(ARG_globalData, v->toNumber(callFrame) + 1);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
bool result = jsLess(callFrame, src1, src2);
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
bool result = jsLessEq(callFrame, src1, src2);
return result;
}
-JSValue* Machine::cti_op_new_object(CTI_ARGS)
+JSValuePtr Machine::cti_op_new_object(CTI_ARGS)
{
CTI_STACK_HACK();
VM_CHECK_EXCEPTION_AT_END();
}
-JSValue* Machine::cti_op_get_by_id(CTI_ARGS)
+JSValuePtr Machine::cti_op_get_by_id(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
Identifier& ident = *ARG_id2;
- JSValue* baseValue = ARG_src1;
+ JSValuePtr baseValue = ARG_src1;
PropertySlot slot(baseValue);
- JSValue* result = baseValue->get(callFrame, ident, slot);
+ JSValuePtr result = baseValue->get(callFrame, ident, slot);
ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_id_second));
return result;
}
-JSValue* Machine::cti_op_get_by_id_second(CTI_ARGS)
+JSValuePtr Machine::cti_op_get_by_id_second(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
Identifier& ident = *ARG_id2;
- JSValue* baseValue = ARG_src1;
+ JSValuePtr baseValue = ARG_src1;
PropertySlot slot(baseValue);
- JSValue* result = baseValue->get(callFrame, ident, slot);
+ JSValuePtr result = baseValue->get(callFrame, ident, slot);
ARG_globalData->machine->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), CTI_RETURN_ADDRESS, baseValue, ident, slot);
return result;
}
-JSValue* Machine::cti_op_get_by_id_generic(CTI_ARGS)
+JSValuePtr Machine::cti_op_get_by_id_generic(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
Identifier& ident = *ARG_id2;
- JSValue* baseValue = ARG_src1;
+ JSValuePtr baseValue = ARG_src1;
PropertySlot slot(baseValue);
- JSValue* result = baseValue->get(callFrame, ident, slot);
+ JSValuePtr result = baseValue->get(callFrame, ident, slot);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_get_by_id_fail(CTI_ARGS)
+JSValuePtr Machine::cti_op_get_by_id_fail(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
Identifier& ident = *ARG_id2;
- JSValue* baseValue = ARG_src1;
+ JSValuePtr baseValue = ARG_src1;
PropertySlot slot(baseValue);
- JSValue* result = baseValue->get(callFrame, ident, slot);
+ JSValuePtr result = baseValue->get(callFrame, ident, slot);
// should probably uncacheGetByID() ... this would mean doing a vPC lookup - might be worth just bleeding this until the end.
ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_id_generic));
return result;
}
-JSValue* Machine::cti_op_instanceof(CTI_ARGS)
+JSValuePtr Machine::cti_op_instanceof(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
- JSValue* value = ARG_src1;
- JSValue* baseVal = ARG_src2;
- JSValue* proto = ARG_src3;
+ JSValuePtr value = ARG_src1;
+ JSValuePtr baseVal = ARG_src2;
+ JSValuePtr proto = ARG_src3;
JSCell* valueCell = asCell(value);
JSCell* baseCell = asCell(baseVal);
JSCell* protoCell = asCell(proto);
if (!value->isObject())
return jsBoolean(false);
- JSValue* result = jsBoolean(asObject(baseCell)->hasInstance(callFrame, valueCell, protoCell));
+ JSValuePtr result = jsBoolean(asObject(baseCell)->hasInstance(callFrame, valueCell, protoCell));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_del_by_id(CTI_ARGS)
+JSValuePtr Machine::cti_op_del_by_id(CTI_ARGS)
{
CTI_STACK_HACK();
JSObject* baseObj = ARG_src1->toObject(callFrame);
- JSValue* result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
+ JSValuePtr result = jsBoolean(baseObj->deleteProperty(callFrame, ident));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_mul(CTI_ARGS)
+JSValuePtr Machine::cti_op_mul(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
double left;
double right;
return jsNumber(ARG_globalData, left * right);
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, src1->toNumber(callFrame) * src2->toNumber(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_new_func(CTI_ARGS)
+JSValuePtr Machine::cti_op_new_func(CTI_ARGS)
{
CTI_STACK_HACK();
return codeBlock->ctiCode;
}
-JSValue* Machine::cti_op_push_activation(CTI_ARGS)
+JSValuePtr Machine::cti_op_push_activation(CTI_ARGS)
{
CTI_STACK_HACK();
return activation;
}
-JSValue* Machine::cti_op_call_NotJSFunction(CTI_ARGS)
+JSValuePtr Machine::cti_op_call_NotJSFunction(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* funcVal = ARG_src1;
+ JSValuePtr funcVal = ARG_src1;
CallData callData;
CallType callType = funcVal->getCallData(callData);
CTI_MACHINE_SAMPLING_callingHostFunction();
- JSValue* returnValue = callData.native.function(callFrame, asObject(funcVal), argv[0].jsValue(callFrame), argList);
+ JSValuePtr returnValue = callData.native.function(callFrame, asObject(funcVal), argv[0].jsValue(callFrame), argList);
ARG_setCallFrame(previousCallFrame);
VM_CHECK_EXCEPTION();
ARG_callFrame->scopeChain()->deref();
}
-JSValue* Machine::cti_op_new_array(CTI_ARGS)
+JSValuePtr Machine::cti_op_new_array(CTI_ARGS)
{
CTI_STACK_HACK();
return constructArray(ARG_callFrame, argList);
}
-JSValue* Machine::cti_op_resolve(CTI_ARGS)
+JSValuePtr Machine::cti_op_resolve(CTI_ARGS)
{
CTI_STACK_HACK();
JSObject* o = *iter;
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
VM_THROW_EXCEPTION();
}
-JSValue* Machine::cti_op_construct_JSConstructFast(CTI_ARGS)
+JSValuePtr Machine::cti_op_construct_JSConstructFast(CTI_ARGS)
{
CTI_STACK_HACK();
JSFunction* constructor = asFunction(ARG_src1);
int registerOffset = ARG_int2;
int argCount = ARG_int3;
- JSValue* constrProtoVal = ARG_src5;
+ JSValuePtr constrProtoVal = ARG_src5;
int firstArg = ARG_int6;
#ifndef NDEBUG
return pair;
}
-JSValue* Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
+JSValuePtr Machine::cti_op_construct_NotJSConstruct(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
- JSValue* constrVal = ARG_src1;
+ JSValuePtr constrVal = ARG_src1;
int argCount = ARG_int3;
int firstArg = ARG_int6;
CTI_MACHINE_SAMPLING_callingHostFunction();
- JSValue* returnValue = constructData.native.function(callFrame, constructor, argList);
+ JSValuePtr returnValue = constructData.native.function(callFrame, constructor, argList);
VM_CHECK_EXCEPTION();
if (*ARG_profilerReference)
VM_THROW_EXCEPTION();
}
-JSValue* Machine::cti_op_get_by_val(CTI_ARGS)
+JSValuePtr Machine::cti_op_get_by_val(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
Machine* machine = ARG_globalData->machine;
- JSValue* baseValue = ARG_src1;
- JSValue* subscript = ARG_src2;
+ JSValuePtr baseValue = ARG_src1;
+ JSValuePtr subscript = ARG_src2;
- JSValue* result;
+ JSValuePtr result;
unsigned i;
bool isUInt32 = JSImmediate::getUInt32(subscript, i);
// that in host objects you always get a valid object for this.
// We also handle wrapper substitution for the global object at the same time.
JSObject* thisObj = base->toThisObject(callFrame);
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
VM_CHECK_EXCEPTION_AT_END();
VoidPtrPair pair = { thisObj, asPointer(result) };
VM_THROW_EXCEPTION_2();
}
-JSValue* Machine::cti_op_sub(CTI_ARGS)
+JSValuePtr Machine::cti_op_sub(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
double left;
double right;
return jsNumber(ARG_globalData, left - right);
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, src1->toNumber(callFrame) - src2->toNumber(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
CallFrame* callFrame = ARG_callFrame;
Machine* machine = ARG_globalData->machine;
- JSValue* baseValue = ARG_src1;
- JSValue* subscript = ARG_src2;
- JSValue* value = ARG_src3;
+ JSValuePtr baseValue = ARG_src1;
+ JSValuePtr subscript = ARG_src2;
+ JSValuePtr value = ARG_src3;
unsigned i;
CallFrame* callFrame = ARG_callFrame;
- JSValue* baseValue = ARG_src1;
+ JSValuePtr baseValue = ARG_src1;
int i = ARG_int2;
- JSValue* value = ARG_src3;
+ JSValuePtr value = ARG_src3;
ASSERT(ARG_globalData->machine->isJSArray(baseValue));
VM_CHECK_EXCEPTION_AT_END();
}
-JSValue* Machine::cti_op_lesseq(CTI_ARGS)
+JSValuePtr Machine::cti_op_lesseq(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2));
+ JSValuePtr result = jsBoolean(jsLessEq(callFrame, ARG_src1, ARG_src2));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
+ JSValuePtr src1 = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
return result;
}
-JSValue* Machine::cti_op_negate(CTI_ARGS)
+JSValuePtr Machine::cti_op_negate(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src = ARG_src1;
+ JSValuePtr src = ARG_src1;
double v;
if (fastIsNumber(src, v))
return jsNumber(ARG_globalData, -v);
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, -src->toNumber(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, -src->toNumber(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_resolve_base(CTI_ARGS)
+JSValuePtr Machine::cti_op_resolve_base(CTI_ARGS)
{
CTI_STACK_HACK();
return inlineResolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain());
}
-JSValue* Machine::cti_op_resolve_skip(CTI_ARGS)
+JSValuePtr Machine::cti_op_resolve_skip(CTI_ARGS)
{
CTI_STACK_HACK();
JSObject* o = *iter;
PropertySlot slot(o);
if (o->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
VM_THROW_EXCEPTION();
}
-JSValue* Machine::cti_op_resolve_global(CTI_ARGS)
+JSValuePtr Machine::cti_op_resolve_global(CTI_ARGS)
{
CTI_STACK_HACK();
PropertySlot slot(globalObject);
if (globalObject->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
if (slot.isCacheable()) {
if (vPC[4].u.structureID)
vPC[4].u.structureID->deref();
VM_THROW_EXCEPTION();
}
-JSValue* Machine::cti_op_div(CTI_ARGS)
+JSValuePtr Machine::cti_op_div(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
double left;
double right;
return jsNumber(ARG_globalData, left / right);
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, src1->toNumber(callFrame) / src2->toNumber(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_pre_dec(CTI_ARGS)
+JSValuePtr Machine::cti_op_pre_dec(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* v = ARG_src1;
+ JSValuePtr v = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1);
+ JSValuePtr result = jsNumber(ARG_globalData, v->toNumber(callFrame) - 1);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
bool result = jsLess(callFrame, src1, src2);
return result;
}
-JSValue* Machine::cti_op_not(CTI_ARGS)
+JSValuePtr Machine::cti_op_not(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src = ARG_src1;
+ JSValuePtr src = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsBoolean(!src->toBoolean(callFrame));
+ JSValuePtr result = jsBoolean(!src->toBoolean(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
+ JSValuePtr src1 = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
{
CTI_STACK_HACK();
- JSValue* v = ARG_src1;
+ JSValuePtr v = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
- JSValue* number = v->toJSNumber(callFrame);
+ JSValuePtr number = v->toJSNumber(callFrame);
VM_CHECK_EXCEPTION_AT_END();
VoidPtrPair pair = { asPointer(number), asPointer(jsNumber(ARG_globalData, number->uncheckedGetNumber() + 1)) };
return pair;
}
-JSValue* Machine::cti_op_eq(CTI_ARGS)
+JSValuePtr Machine::cti_op_eq(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
- JSValue* result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2));
+ JSValuePtr result = jsBoolean(equalSlowCaseInline(callFrame, src1, src2));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_lshift(CTI_ARGS)
+JSValuePtr Machine::cti_op_lshift(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* val = ARG_src1;
- JSValue* shift = ARG_src2;
+ JSValuePtr val = ARG_src1;
+ JSValuePtr shift = ARG_src2;
int32_t left;
uint32_t right;
return jsNumber(ARG_globalData, left << (right & 0x1f));
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
+ JSValuePtr result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) << (shift->toUInt32(callFrame) & 0x1f));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_bitand(CTI_ARGS)
+JSValuePtr Machine::cti_op_bitand(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
int32_t left;
int32_t right;
return jsNumber(ARG_globalData, left & right);
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, src1->toInt32(callFrame) & src2->toInt32(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_rshift(CTI_ARGS)
+JSValuePtr Machine::cti_op_rshift(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* val = ARG_src1;
- JSValue* shift = ARG_src2;
+ JSValuePtr val = ARG_src1;
+ JSValuePtr shift = ARG_src2;
int32_t left;
uint32_t right;
return jsNumber(ARG_globalData, left >> (right & 0x1f));
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
+ JSValuePtr result = jsNumber(ARG_globalData, (val->toInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_bitnot(CTI_ARGS)
+JSValuePtr Machine::cti_op_bitnot(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src = ARG_src1;
+ JSValuePtr src = ARG_src1;
int value;
if (fastToInt32(src, value))
return jsNumber(ARG_globalData, ~value);
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, ~src->toInt32(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, ~src->toInt32(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
base = *iter;
PropertySlot slot(base);
if (base->getPropertySlot(callFrame, ident, slot)) {
- JSValue* result = slot.getValue(callFrame, ident);
+ JSValuePtr result = slot.getValue(callFrame, ident);
VM_CHECK_EXCEPTION_AT_END();
VoidPtrPair pair = { base, asPointer(result) };
VM_THROW_EXCEPTION_2();
}
-JSValue* Machine::cti_op_new_func_exp(CTI_ARGS)
+JSValuePtr Machine::cti_op_new_func_exp(CTI_ARGS)
{
CTI_STACK_HACK();
return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
}
-JSValue* Machine::cti_op_mod(CTI_ARGS)
+JSValuePtr Machine::cti_op_mod(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* dividendValue = ARG_src1;
- JSValue* divisorValue = ARG_src2;
+ JSValuePtr dividendValue = ARG_src1;
+ JSValuePtr divisorValue = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
double d = dividendValue->toNumber(callFrame);
- JSValue* result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame)));
+ JSValuePtr result = jsNumber(ARG_globalData, fmod(d, divisorValue->toNumber(callFrame)));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_less(CTI_ARGS)
+JSValuePtr Machine::cti_op_less(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2));
+ JSValuePtr result = jsBoolean(jsLess(callFrame, ARG_src1, ARG_src2));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_neq(CTI_ARGS)
+JSValuePtr Machine::cti_op_neq(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
ASSERT(!JSImmediate::areBothImmediateNumbers(src1, src2));
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2));
+ JSValuePtr result = jsBoolean(!equalSlowCaseInline(callFrame, src1, src2));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
{
CTI_STACK_HACK();
- JSValue* v = ARG_src1;
+ JSValuePtr v = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
- JSValue* number = v->toJSNumber(callFrame);
+ JSValuePtr number = v->toJSNumber(callFrame);
VM_CHECK_EXCEPTION_AT_END();
VoidPtrPair pair = { asPointer(number), asPointer(jsNumber(ARG_globalData, number->uncheckedGetNumber() - 1)) };
return pair;
}
-JSValue* Machine::cti_op_urshift(CTI_ARGS)
+JSValuePtr Machine::cti_op_urshift(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* val = ARG_src1;
- JSValue* shift = ARG_src2;
+ JSValuePtr val = ARG_src1;
+ JSValuePtr shift = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
if (JSImmediate::areBothImmediateNumbers(val, shift) && !JSImmediate::isNegative(val))
return JSImmediate::rightShiftImmediateNumbers(val, shift);
else {
- JSValue* result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
+ JSValuePtr result = jsNumber(ARG_globalData, (val->toUInt32(callFrame)) >> (shift->toUInt32(callFrame) & 0x1f));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
}
-JSValue* Machine::cti_op_bitxor(CTI_ARGS)
+JSValuePtr Machine::cti_op_bitxor(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, src1->toInt32(callFrame) ^ src2->toInt32(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_new_regexp(CTI_ARGS)
+JSValuePtr Machine::cti_op_new_regexp(CTI_ARGS)
{
CTI_STACK_HACK();
return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1);
}
-JSValue* Machine::cti_op_bitor(CTI_ARGS)
+JSValuePtr Machine::cti_op_bitor(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame));
+ JSValuePtr result = jsNumber(ARG_globalData, src1->toInt32(callFrame) | src2->toInt32(callFrame));
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_call_eval(CTI_ARGS)
+JSValuePtr Machine::cti_op_call_eval(CTI_ARGS)
{
CTI_STACK_HACK();
Machine* machine = ARG_globalData->machine;
- JSValue* funcVal = ARG_src1;
+ JSValuePtr funcVal = ARG_src1;
int registerOffset = ARG_int2;
int argCount = ARG_int3;
- JSValue* baseVal = ARG_src5;
+ JSValuePtr baseVal = ARG_src5;
if (baseVal == scopeChain->globalObject() && funcVal == scopeChain->globalObject()->evalFunction()) {
JSObject* thisObject = asObject(callFrame[codeBlock->thisRegister].jsValue(callFrame));
- JSValue* exceptionValue = noValue();
- JSValue* result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
+ JSValuePtr exceptionValue = noValue();
+ JSValuePtr result = machine->callEval(callFrame, thisObject, scopeChain, registerFile, registerOffset - RegisterFile::CallFrameHeaderSize - argCount, argCount, exceptionValue);
if (UNLIKELY(exceptionValue != noValue())) {
ARG_globalData->exception = exceptionValue;
VM_THROW_EXCEPTION_AT_END();
return JSImmediate::impossibleValue();
}
-JSValue* Machine::cti_op_throw(CTI_ARGS)
+JSValuePtr Machine::cti_op_throw(CTI_ARGS)
{
CTI_STACK_HACK();
ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(CTI_RETURN_ADDRESS));
unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(CTI_RETURN_ADDRESS);
- JSValue* exceptionValue = ARG_src1;
+ JSValuePtr exceptionValue = ARG_src1;
ASSERT(exceptionValue);
Instruction* handlerVPC = ARG_globalData->machine->throwException(callFrame, exceptionValue, codeBlock->instructions.begin() + vPCIndex, true);
return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1);
}
-JSValue* Machine::cti_op_next_pname(CTI_ARGS)
+JSValuePtr Machine::cti_op_next_pname(CTI_ARGS)
{
CTI_STACK_HACK();
JSPropertyNameIterator* it = ARG_pni1;
- JSValue* temp = it->next(ARG_callFrame);
+ JSValuePtr temp = it->next(ARG_callFrame);
if (!temp)
it->invalidate();
return temp;
ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->pop());
}
-JSValue* Machine::cti_op_typeof(CTI_ARGS)
+JSValuePtr Machine::cti_op_typeof(CTI_ARGS)
{
CTI_STACK_HACK();
return jsTypeStringForValue(ARG_callFrame, ARG_src1);
}
-JSValue* Machine::cti_op_is_undefined(CTI_ARGS)
+JSValuePtr Machine::cti_op_is_undefined(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* v = ARG_src1;
+ JSValuePtr v = ARG_src1;
return jsBoolean(JSImmediate::isImmediate(v) ? v->isUndefined() : v->asCell()->structureID()->typeInfo().masqueradesAsUndefined());
}
-JSValue* Machine::cti_op_is_boolean(CTI_ARGS)
+JSValuePtr Machine::cti_op_is_boolean(CTI_ARGS)
{
CTI_STACK_HACK();
return jsBoolean(ARG_src1->isBoolean());
}
-JSValue* Machine::cti_op_is_number(CTI_ARGS)
+JSValuePtr Machine::cti_op_is_number(CTI_ARGS)
{
CTI_STACK_HACK();
return jsBoolean(ARG_src1->isNumber());
}
-JSValue* Machine::cti_op_is_string(CTI_ARGS)
+JSValuePtr Machine::cti_op_is_string(CTI_ARGS)
{
CTI_STACK_HACK();
return jsBoolean(ARG_globalData->machine->isJSString(ARG_src1));
}
-JSValue* Machine::cti_op_is_object(CTI_ARGS)
+JSValuePtr Machine::cti_op_is_object(CTI_ARGS)
{
CTI_STACK_HACK();
return jsBoolean(jsIsObjectType(ARG_src1));
}
-JSValue* Machine::cti_op_is_function(CTI_ARGS)
+JSValuePtr Machine::cti_op_is_function(CTI_ARGS)
{
CTI_STACK_HACK();
return jsBoolean(jsIsFunctionType(ARG_src1));
}
-JSValue* Machine::cti_op_stricteq(CTI_ARGS)
+JSValuePtr Machine::cti_op_stricteq(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
// handled inline as fast cases
ASSERT(!JSImmediate::areBothImmediate(src1, src2));
return jsBoolean(strictEqualSlowCaseInline(src1, src2));
}
-JSValue* Machine::cti_op_nstricteq(CTI_ARGS)
+JSValuePtr Machine::cti_op_nstricteq(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src1 = ARG_src1;
- JSValue* src2 = ARG_src2;
+ JSValuePtr src1 = ARG_src1;
+ JSValuePtr src2 = ARG_src2;
// handled inline as fast cases
ASSERT(!JSImmediate::areBothImmediate(src1, src2));
return jsBoolean(!strictEqualSlowCaseInline(src1, src2));
}
-JSValue* Machine::cti_op_to_jsnumber(CTI_ARGS)
+JSValuePtr Machine::cti_op_to_jsnumber(CTI_ARGS)
{
CTI_STACK_HACK();
- JSValue* src = ARG_src1;
+ JSValuePtr src = ARG_src1;
CallFrame* callFrame = ARG_callFrame;
- JSValue* result = src->toJSNumber(callFrame);
+ JSValuePtr result = src->toJSNumber(callFrame);
VM_CHECK_EXCEPTION_AT_END();
return result;
}
-JSValue* Machine::cti_op_in(CTI_ARGS)
+JSValuePtr Machine::cti_op_in(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
- JSValue* baseVal = ARG_src2;
+ JSValuePtr baseVal = ARG_src2;
if (!baseVal->isObject()) {
CallFrame* callFrame = ARG_callFrame;
VM_THROW_EXCEPTION();
}
- JSValue* propName = ARG_src1;
+ JSValuePtr propName = ARG_src1;
JSObject* baseObj = asObject(baseVal);
uint32_t i;
return jsBoolean(baseObj->hasProperty(callFrame, property));
}
-JSValue* Machine::cti_op_push_new_scope(CTI_ARGS)
+JSValuePtr Machine::cti_op_push_new_scope(CTI_ARGS)
{
CTI_STACK_HACK();
{
CTI_STACK_HACK();
- JSValue* scrutinee = ARG_src1;
+ JSValuePtr scrutinee = ARG_src1;
unsigned tableIndex = ARG_int2;
CallFrame* callFrame = ARG_callFrame;
CodeBlock* codeBlock = callFrame->codeBlock();
{
CTI_STACK_HACK();
- JSValue* scrutinee = ARG_src1;
+ JSValuePtr scrutinee = ARG_src1;
unsigned tableIndex = ARG_int2;
CallFrame* callFrame = ARG_callFrame;
CodeBlock* codeBlock = callFrame->codeBlock();
{
CTI_STACK_HACK();
- JSValue* scrutinee = ARG_src1;
+ JSValuePtr scrutinee = ARG_src1;
unsigned tableIndex = ARG_int2;
CallFrame* callFrame = ARG_callFrame;
CodeBlock* codeBlock = callFrame->codeBlock();
return result;
}
-JSValue* Machine::cti_op_del_by_val(CTI_ARGS)
+JSValuePtr Machine::cti_op_del_by_val(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
- JSValue* baseValue = ARG_src1;
+ JSValuePtr baseValue = ARG_src1;
JSObject* baseObj = baseValue->toObject(callFrame); // may throw
- JSValue* subscript = ARG_src2;
- JSValue* result;
+ JSValuePtr subscript = ARG_src2;
+ JSValuePtr result;
uint32_t i;
if (subscript->getUInt32(i))
result = jsBoolean(baseObj->deleteProperty(callFrame, i));
baseObj->defineSetter(callFrame, ident, asObject(ARG_src3));
}
-JSValue* Machine::cti_op_new_error(CTI_ARGS)
+JSValuePtr Machine::cti_op_new_error(CTI_ARGS)
{
CTI_STACK_HACK();
CallFrame* callFrame = ARG_callFrame;
CodeBlock* codeBlock = callFrame->codeBlock();
unsigned type = ARG_int1;
- JSValue* message = ARG_src2;
+ JSValuePtr message = ARG_src2;
unsigned lineNumber = ARG_int3;
return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode->sourceID(), codeBlock->ownerNode->sourceURL());
ARG_globalData->machine->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
}
-JSValue* Machine::cti_vm_throw(CTI_ARGS)
+JSValuePtr Machine::cti_vm_throw(CTI_ARGS)
{
CTI_STACK_HACK();
ASSERT(codeBlock->ctiReturnAddressVPCMap.contains(ARG_globalData->throwReturnAddress));
unsigned vPCIndex = codeBlock->ctiReturnAddressVPCMap.get(ARG_globalData->throwReturnAddress);
- JSValue* exceptionValue = ARG_globalData->exception;
+ JSValuePtr exceptionValue = ARG_globalData->exception;
ASSERT(exceptionValue);
ARG_globalData->exception = noValue();
bool isOpcode(Opcode opcode);
- JSValue* execute(ProgramNode*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValue** exception);
- JSValue* execute(FunctionBodyNode*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValue** exception);
- JSValue* execute(EvalNode* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValue** exception);
+ JSValuePtr execute(ProgramNode*, CallFrame*, ScopeChainNode*, JSObject* thisObj, JSValuePtr* exception);
+ JSValuePtr execute(FunctionBodyNode*, CallFrame*, JSFunction*, JSObject* thisObj, const ArgList& args, ScopeChainNode*, JSValuePtr* exception);
+ JSValuePtr execute(EvalNode* evalNode, CallFrame* exec, JSObject* thisObj, ScopeChainNode* scopeChain, JSValuePtr* exception);
- JSValue* retrieveArguments(CallFrame*, JSFunction*) const;
- JSValue* retrieveCaller(CallFrame*, InternalFunction*) const;
- void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValue*& function) const;
+ JSValuePtr retrieveArguments(CallFrame*, JSFunction*) const;
+ JSValuePtr retrieveCaller(CallFrame*, InternalFunction*) const;
+ void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValuePtr& function) const;
void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; }
static void SFX_CALL cti_timeout_check(CTI_ARGS);
static void SFX_CALL cti_register_file_check(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_convert_this(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_convert_this(CTI_ARGS);
static void SFX_CALL cti_op_end(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_add(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_pre_inc(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_add(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_pre_inc(CTI_ARGS);
static int SFX_CALL cti_op_loop_if_less(CTI_ARGS);
static int SFX_CALL cti_op_loop_if_lesseq(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_new_object(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_new_object(CTI_ARGS);
static void SFX_CALL cti_op_put_by_id(CTI_ARGS);
static void SFX_CALL cti_op_put_by_id_second(CTI_ARGS);
static void SFX_CALL cti_op_put_by_id_generic(CTI_ARGS);
static void SFX_CALL cti_op_put_by_id_fail(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_get_by_id(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_get_by_id_second(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_get_by_id_generic(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_get_by_id_fail(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_del_by_id(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_instanceof(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_mul(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_new_func(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_get_by_id(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_get_by_id_second(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_get_by_id_generic(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_get_by_id_fail(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_del_by_id(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_instanceof(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_mul(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_new_func(CTI_ARGS);
static VoidPtrPair SFX_CALL cti_op_call_JSFunction(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_call_NotJSFunction(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_call_NotJSFunction(CTI_ARGS);
static void SFX_CALL cti_op_create_arguments(CTI_ARGS);
static void SFX_CALL cti_op_create_arguments_no_params(CTI_ARGS);
static void SFX_CALL cti_op_tear_off_activation(CTI_ARGS);
static void SFX_CALL cti_op_tear_off_arguments(CTI_ARGS);
static void SFX_CALL cti_op_ret_scopeChain(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_new_array(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_resolve(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_resolve_global(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_construct_JSConstructFast(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_new_array(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_resolve(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_resolve_global(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_construct_JSConstructFast(CTI_ARGS);
static VoidPtrPair SFX_CALL cti_op_construct_JSConstruct(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_construct_NotJSConstruct(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_get_by_val(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_construct_NotJSConstruct(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_get_by_val(CTI_ARGS);
static VoidPtrPair SFX_CALL cti_op_resolve_func(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_sub(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_sub(CTI_ARGS);
static void SFX_CALL cti_op_put_by_val(CTI_ARGS);
static void SFX_CALL cti_op_put_by_val_array(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_lesseq(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_lesseq(CTI_ARGS);
static int SFX_CALL cti_op_loop_if_true(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_resolve_base(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_negate(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_resolve_skip(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_div(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_pre_dec(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_resolve_base(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_negate(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_resolve_skip(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_div(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_pre_dec(CTI_ARGS);
static int SFX_CALL cti_op_jless(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_not(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_not(CTI_ARGS);
static int SFX_CALL cti_op_jtrue(CTI_ARGS);
static VoidPtrPair SFX_CALL cti_op_post_inc(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_eq(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_lshift(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_bitand(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_rshift(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_bitnot(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_eq(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_lshift(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_bitand(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_rshift(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_bitnot(CTI_ARGS);
static VoidPtrPair SFX_CALL cti_op_resolve_with_base(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_new_func_exp(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_mod(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_less(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_neq(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_new_func_exp(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_mod(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_less(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_neq(CTI_ARGS);
static VoidPtrPair SFX_CALL cti_op_post_dec(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_urshift(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_bitxor(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_new_regexp(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_bitor(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_call_eval(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_throw(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_urshift(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_bitxor(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_new_regexp(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_bitor(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_call_eval(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_throw(CTI_ARGS);
static JSPropertyNameIterator* SFX_CALL cti_op_get_pnames(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_next_pname(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_next_pname(CTI_ARGS);
static void SFX_CALL cti_op_push_scope(CTI_ARGS);
static void SFX_CALL cti_op_pop_scope(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_typeof(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_is_undefined(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_is_boolean(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_is_number(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_is_string(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_is_object(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_is_function(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_stricteq(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_nstricteq(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_to_jsnumber(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_in(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_push_new_scope(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_typeof(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_is_undefined(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_is_boolean(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_is_number(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_is_string(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_is_object(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_is_function(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_stricteq(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_nstricteq(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_to_jsnumber(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_in(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_push_new_scope(CTI_ARGS);
static void SFX_CALL cti_op_jmp_scopes(CTI_ARGS);
static void SFX_CALL cti_op_put_by_index(CTI_ARGS);
static void* SFX_CALL cti_op_switch_imm(CTI_ARGS);
static void* SFX_CALL cti_op_switch_char(CTI_ARGS);
static void* SFX_CALL cti_op_switch_string(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_del_by_val(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_del_by_val(CTI_ARGS);
static void SFX_CALL cti_op_put_getter(CTI_ARGS);
static void SFX_CALL cti_op_put_setter(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_new_error(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_new_error(CTI_ARGS);
static void SFX_CALL cti_op_debug(CTI_ARGS);
static void SFX_CALL cti_op_call_profiler(CTI_ARGS);
static void SFX_CALL cti_op_ret_profiler(CTI_ARGS);
- static JSValue* SFX_CALL cti_vm_throw(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_vm_throw(CTI_ARGS);
static void* SFX_CALL cti_vm_compile(CTI_ARGS);
static void* SFX_CALL cti_vm_lazyLinkCall(CTI_ARGS);
- static JSValue* SFX_CALL cti_op_push_activation(CTI_ARGS);
+ static JSValuePtr SFX_CALL cti_op_push_activation(CTI_ARGS);
#endif // ENABLE(CTI)
// Default number of ticks before a timeout check should be done.
static const int initialTickCountThreshold = 1024;
- bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }
- bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }
+ bool isJSArray(JSValuePtr v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }
+ bool isJSString(JSValuePtr v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }
private:
enum ExecutionFlag { Normal, InitializeAndReturn };
- NEVER_INLINE JSValue* callEval(CallFrame*, JSObject* thisObject, ScopeChainNode*, RegisterFile*, int argv, int argc, JSValue*& exceptionValue);
- JSValue* execute(EvalNode*, CallFrame*, JSObject* thisObject, int registerOffset, ScopeChainNode*, JSValue** exception);
+ NEVER_INLINE JSValuePtr callEval(CallFrame*, JSObject* thisObject, ScopeChainNode*, RegisterFile*, int argv, int argc, JSValuePtr& exceptionValue);
+ JSValuePtr execute(EvalNode*, CallFrame*, JSObject* thisObject, int registerOffset, ScopeChainNode*, JSValuePtr* exception);
NEVER_INLINE void debug(CallFrame*, DebugHookID, int firstLine, int lastLine);
- NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValue*& exceptionValue);
- NEVER_INLINE bool resolveSkip(CallFrame*, Instruction*, JSValue*& exceptionValue);
- NEVER_INLINE bool resolveGlobal(CallFrame*, Instruction*, JSValue*& exceptionValue);
+ NEVER_INLINE bool resolve(CallFrame*, Instruction*, JSValuePtr& exceptionValue);
+ NEVER_INLINE bool resolveSkip(CallFrame*, Instruction*, JSValuePtr& exceptionValue);
+ NEVER_INLINE bool resolveGlobal(CallFrame*, Instruction*, JSValuePtr& exceptionValue);
NEVER_INLINE void resolveBase(CallFrame*, Instruction* vPC);
- NEVER_INLINE bool resolveBaseAndProperty(CallFrame*, Instruction*, JSValue*& exceptionValue);
+ NEVER_INLINE bool resolveBaseAndProperty(CallFrame*, Instruction*, JSValuePtr& exceptionValue);
NEVER_INLINE ScopeChainNode* createExceptionScope(CallFrame*, const Instruction* vPC);
- NEVER_INLINE bool unwindCallFrame(CallFrame*&, JSValue*, const Instruction*&, CodeBlock*&);
- NEVER_INLINE Instruction* throwException(CallFrame*&, JSValue*&, const Instruction*, bool);
- NEVER_INLINE bool resolveBaseAndFunc(CallFrame*, Instruction*, JSValue*& exceptionValue);
+ NEVER_INLINE bool unwindCallFrame(CallFrame*&, JSValuePtr, const Instruction*&, CodeBlock*&);
+ NEVER_INLINE Instruction* throwException(CallFrame*&, JSValuePtr&, const Instruction*, bool);
+ NEVER_INLINE bool resolveBaseAndFunc(CallFrame*, Instruction*, JSValuePtr& exceptionValue);
static ALWAYS_INLINE CallFrame* slideRegisterWindowForCall(CodeBlock*, RegisterFile*, CallFrame*, size_t registerOffset, int argc);
static CallFrame* findFunctionCallFrame(CallFrame*, InternalFunction*);
- JSValue* privateExecute(ExecutionFlag, RegisterFile*, CallFrame*, JSValue** exception);
+ JSValuePtr privateExecute(ExecutionFlag, RegisterFile*, CallFrame*, JSValuePtr* exception);
void dumpCallFrame(const RegisterFile*, CallFrame*);
void dumpRegisters(const RegisterFile*, CallFrame*);
- JSValue* checkTimeout(JSGlobalObject*);
+ JSValuePtr checkTimeout(JSGlobalObject*);
void resetTimeoutCheck();
- void tryCacheGetByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
+ void tryCacheGetByID(CallFrame*, CodeBlock*, Instruction*, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot&);
void uncacheGetByID(CodeBlock*, Instruction* vPC);
- void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValue* baseValue, const PutPropertySlot&);
+ void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValuePtr baseValue, const PutPropertySlot&);
void uncachePutByID(CodeBlock*, Instruction* vPC);
#if ENABLE(CTI)
static void throwStackOverflowPreviousFrame(CallFrame*, JSGlobalData*, void*& returnAddress);
- void tryCTICacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&);
- void tryCTICachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValue* baseValue, const PutPropertySlot&);
+ void tryCTICacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot&);
+ void tryCTICachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValuePtr baseValue, const PutPropertySlot&);
void* getCTIArrayLengthTrampoline(CallFrame*, CodeBlock*);
void* getCTIStringLengthTrampoline(CallFrame*, CodeBlock*);
class Register {
public:
Register();
- Register(JSValue*);
+ Register(JSValuePtr);
- JSValue* jsValue(CallFrame*) const;
- JSValue* getJSValue() const;
+ JSValuePtr jsValue(CallFrame*) const;
+ JSValuePtr getJSValue() const;
bool marked() const;
void mark();
union {
intptr_t i;
void* v;
- JSValue* value;
+ JSValuePtr value;
JSActivation* activation;
Arguments* arguments;
#endif
}
- ALWAYS_INLINE Register::Register(JSValue* v)
+ ALWAYS_INLINE Register::Register(JSValuePtr v)
{
SET_TYPE(ValueType);
u.value = v;
}
// This function is scaffolding for legacy clients. It will eventually go away.
- ALWAYS_INLINE JSValue* Register::jsValue(CallFrame*) const
+ ALWAYS_INLINE JSValuePtr Register::jsValue(CallFrame*) const
{
- // Once registers hold doubles, this function will allocate a JSValue*
+ // Once registers hold doubles, this function will allocate a JSValuePtr
// if the register doesn't hold one already.
ASSERT_TYPE(ValueType);
return u.value;
}
- ALWAYS_INLINE JSValue* Register::getJSValue() const
+ ALWAYS_INLINE JSValuePtr Register::getJSValue() const
{
ASSERT_TYPE(JSValueType);
return u.value;
}
}
-void ArgList::slowAppend(JSValue* v)
+void ArgList::slowAppend(JSValuePtr v)
{
// As long as our size stays within our Vector's inline
// capacity, all our values are allocated on the stack, and
size_t size() const { return m_size; }
bool isEmpty() const { return !m_size; }
- JSValue* at(ExecState* exec, size_t i) const
+ JSValuePtr at(ExecState* exec, size_t i) const
{
if (i < m_size)
return m_buffer[i].jsValue(exec);
m_size = 0;
}
- void append(JSValue* v)
+ void append(JSValuePtr v)
{
ASSERT(!m_isReadOnly);
static void markLists(ListSet&);
private:
- void slowAppend(JSValue*);
+ void slowAppend(JSValuePtr);
Register* m_buffer;
size_t m_size;
return JSObject::getOwnPropertySlot(exec, propertyName, slot);
}
-void Arguments::put(ExecState* exec, unsigned i, JSValue* value, PutPropertySlot& slot)
+void Arguments::put(ExecState* exec, unsigned i, JSValuePtr value, PutPropertySlot& slot)
{
if (i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
if (i < d->numParameters)
JSObject::put(exec, Identifier(exec, UString::from(i)), value, slot);
}
-void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue* value, PutPropertySlot& slot)
+void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
{
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(&isArrayIndex);
void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
- virtual void put(ExecState*, const Identifier& propertyName, JSValue*, PutPropertySlot&);
- virtual void put(ExecState*, unsigned propertyName, JSValue*, PutPropertySlot&);
+ virtual void put(ExecState*, const Identifier& propertyName, JSValuePtr, PutPropertySlot&);
+ virtual void put(ExecState*, unsigned propertyName, JSValuePtr, PutPropertySlot&);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
virtual bool deleteProperty(ExecState*, unsigned propertyName);
OwnPtr<ArgumentsData> d;
};
- Arguments* asArguments(JSValue*);
+ Arguments* asArguments(JSValuePtr);
- inline Arguments* asArguments(JSValue* value)
+ inline Arguments* asArguments(JSValuePtr value)
{
ASSERT(asObject(value)->inherits(&Arguments::info));
return static_cast<Arguments*>(asObject(value));
return ConstructTypeHost;
}
-static JSValue* callArrayConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+static JSValuePtr callArrayConstructor(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
{
return constructArrayWithSizeQuirk(exec, args);
}
ASSERT_CLASS_FITS_IN_CELL(ArrayPrototype);
-static JSValue* arrayProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncConcat(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncJoin(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncPop(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncPush(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncReverse(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncShift(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncSlice(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncSort(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncSplice(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncUnShift(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncEvery(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncForEach(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncSome(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncIndexOf(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncFilter(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncMap(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* arrayProtoFuncLastIndexOf(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValuePtr arrayProtoFuncToString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncToLocaleString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncConcat(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncJoin(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncPop(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncPush(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncReverse(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncShift(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncSlice(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncSort(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncSplice(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncUnShift(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncEvery(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncForEach(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncSome(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncIndexOf(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncFilter(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncMap(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr arrayProtoFuncLastIndexOf(ExecState*, JSObject*, JSValuePtr, const ArgList&);
}
// ------------------------------ Array Functions ----------------------------
// Helper function
-static JSValue* getProperty(ExecState* exec, JSObject* obj, unsigned index)
+static JSValuePtr getProperty(ExecState* exec, JSObject* obj, unsigned index)
{
PropertySlot slot(obj);
if (!obj->getPropertySlot(exec, index, slot))
return slot.getValue(exec, index);
}
-static void putProperty(ExecState* exec, JSObject* obj, const Identifier& propertyName, JSValue* value)
+static void putProperty(ExecState* exec, JSObject* obj, const Identifier& propertyName, JSValuePtr value)
{
PutPropertySlot slot;
obj->put(exec, propertyName, value, slot);
}
-JSValue* arrayProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr arrayProtoFuncToString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&JSArray::info))
return throwError(exec, TypeError);
break;
}
- JSValue* element = thisObj->get(exec, k);
+ JSValuePtr element = thisObj->get(exec, k);
if (element->isUndefinedOrNull())
continue;
return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
}
-JSValue* arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr arrayProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&JSArray::info))
return throwError(exec, TypeError);
break;
}
- JSValue* element = thisObj->get(exec, k);
+ JSValuePtr element = thisObj->get(exec, k);
if (element->isUndefinedOrNull())
continue;
JSObject* o = element->toObject(exec);
- JSValue* conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
+ JSValuePtr conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
UString str;
CallData callData;
CallType callType = conversionFunction->getCallData(callData);
return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
}
-JSValue* arrayProtoFuncJoin(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncJoin(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
break;
}
- JSValue* element = thisObj->get(exec, k);
+ JSValuePtr element = thisObj->get(exec, k);
if (element->isUndefinedOrNull())
continue;
return jsString(exec, UString(strBuffer.data(), strBuffer.data() ? strBuffer.size() : 0));
}
-JSValue* arrayProtoFuncConcat(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncConcat(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSArray* arr = constructEmptyArray(exec);
int n = 0;
- JSValue* curArg = thisValue->toThisObject(exec);
+ JSValuePtr curArg = thisValue->toThisObject(exec);
ArgList::const_iterator it = args.begin();
ArgList::const_iterator end = args.end();
while (1) {
JSArray* curArray = asArray(curArg);
unsigned length = curArray->length();
for (unsigned k = 0; k < length; ++k) {
- if (JSValue* v = getProperty(exec, curArray, k))
+ if (JSValuePtr v = getProperty(exec, curArray, k))
arr->put(exec, n, v);
n++;
}
return arr;
}
-JSValue* arrayProtoFuncPop(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr arrayProtoFuncPop(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (exec->machine()->isJSArray(thisValue))
return asArray(thisValue)->pop();
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* result;
+ JSValuePtr result;
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
if (length == 0) {
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(exec, length));
return result;
}
-JSValue* arrayProtoFuncPush(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncPush(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
if (exec->machine()->isJSArray(thisValue) && args.size() == 1) {
JSArray* array = asArray(thisValue);
return jsNumber(exec, length);
}
-JSValue* arrayProtoFuncReverse(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr arrayProtoFuncReverse(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
JSObject* thisObj = thisValue->toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
for (unsigned k = 0; k < middle; k++) {
unsigned lk1 = length - k - 1;
- JSValue* obj2 = getProperty(exec, thisObj, lk1);
- JSValue* obj = getProperty(exec, thisObj, k);
+ JSValuePtr obj2 = getProperty(exec, thisObj, lk1);
+ JSValuePtr obj = getProperty(exec, thisObj, k);
if (obj2)
thisObj->put(exec, k, obj2);
return thisObj;
}
-JSValue* arrayProtoFuncShift(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr arrayProtoFuncShift(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* result;
+ JSValuePtr result;
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
if (length == 0) {
} else {
result = thisObj->get(exec, 0);
for (unsigned k = 1; k < length; k++) {
- if (JSValue* obj = getProperty(exec, thisObj, k))
+ if (JSValuePtr obj = getProperty(exec, thisObj, k))
thisObj->put(exec, k - 1, obj);
else
thisObj->deleteProperty(exec, k - 1);
return result;
}
-JSValue* arrayProtoFuncSlice(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncSlice(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
// http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
// We return a new array
JSArray* resObj = constructEmptyArray(exec);
- JSValue* result = resObj;
+ JSValuePtr result = resObj;
double begin = args.at(exec, 0)->toInteger(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
if (begin >= 0) {
int b = static_cast<int>(begin);
int e = static_cast<int>(end);
for (int k = b; k < e; k++, n++) {
- if (JSValue* v = getProperty(exec, thisObj, k))
+ if (JSValuePtr v = getProperty(exec, thisObj, k))
resObj->put(exec, n, v);
}
resObj->setLength(n);
return result;
}
-JSValue* arrayProtoFuncSort(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncSort(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* function = args.at(exec, 0);
+ JSValuePtr function = args.at(exec, 0);
CallData callData;
CallType callType = function->getCallData(callData);
// "Min" sort. Not the fastest, but definitely less code than heapsort
// or quicksort, and much less swapping than bubblesort/insertionsort.
for (unsigned i = 0; i < length - 1; ++i) {
- JSValue* iObj = thisObj->get(exec, i);
+ JSValuePtr iObj = thisObj->get(exec, i);
unsigned themin = i;
- JSValue* minObj = iObj;
+ JSValuePtr minObj = iObj;
for (unsigned j = i + 1; j < length; ++j) {
- JSValue* jObj = thisObj->get(exec, j);
+ JSValuePtr jObj = thisObj->get(exec, j);
double compareResult;
if (jObj->isUndefined())
compareResult = 1; // don't check minObj because there's no need to differentiate == (0) from > (1)
return thisObj;
}
-JSValue* arrayProtoFuncSplice(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncSplice(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
// 15.4.4.12
JSArray* resObj = constructEmptyArray(exec);
- JSValue* result = resObj;
+ JSValuePtr result = resObj;
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
if (!args.size())
return jsUndefined();
deleteCount = length - begin;
for (unsigned k = 0; k < deleteCount; k++) {
- if (JSValue* v = getProperty(exec, thisObj, k + begin))
+ if (JSValuePtr v = getProperty(exec, thisObj, k + begin))
resObj->put(exec, k, v);
}
resObj->setLength(deleteCount);
if (additionalArgs != deleteCount) {
if (additionalArgs < deleteCount) {
for (unsigned k = begin; k < length - deleteCount; ++k) {
- if (JSValue* v = getProperty(exec, thisObj, k + deleteCount))
+ if (JSValuePtr v = getProperty(exec, thisObj, k + deleteCount))
thisObj->put(exec, k + additionalArgs, v);
else
thisObj->deleteProperty(exec, k + additionalArgs);
thisObj->deleteProperty(exec, k - 1);
} else {
for (unsigned k = length - deleteCount; (int)k > begin; --k) {
- if (JSValue* obj = getProperty(exec, thisObj, k + deleteCount - 1))
+ if (JSValuePtr obj = getProperty(exec, thisObj, k + deleteCount - 1))
thisObj->put(exec, k + additionalArgs - 1, obj);
else
thisObj->deleteProperty(exec, k + additionalArgs - 1);
return result;
}
-JSValue* arrayProtoFuncUnShift(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncUnShift(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
unsigned nrArgs = args.size();
if (nrArgs) {
for (unsigned k = length; k > 0; --k) {
- if (JSValue* v = getProperty(exec, thisObj, k - 1))
+ if (JSValuePtr v = getProperty(exec, thisObj, k - 1))
thisObj->put(exec, k + nrArgs - 1, v);
else
thisObj->deleteProperty(exec, k + nrArgs - 1);
}
for (unsigned k = 0; k < nrArgs; ++k)
thisObj->put(exec, k, args.at(exec, k));
- JSValue* result = jsNumber(exec, length + nrArgs);
+ JSValuePtr result = jsNumber(exec, length + nrArgs);
putProperty(exec, thisObj, exec->propertyNames().length, result);
return result;
}
-JSValue* arrayProtoFuncFilter(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncFilter(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* function = args.at(exec, 0);
+ JSValuePtr function = args.at(exec, 0);
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone)
if (!thisObj->getPropertySlot(exec, k, slot))
continue;
- JSValue* v = slot.getValue(exec, k);
+ JSValuePtr v = slot.getValue(exec, k);
ArgList eachArguments;
eachArguments.append(jsNumber(exec, k));
eachArguments.append(thisObj);
- JSValue* result = call(exec, function, callType, callData, applyThis, eachArguments);
+ JSValuePtr result = call(exec, function, callType, callData, applyThis, eachArguments);
if (result->toBoolean(exec))
resultArray->put(exec, filterIndex++, v);
return resultArray;
}
-JSValue* arrayProtoFuncMap(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncMap(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* function = args.at(exec, 0);
+ JSValuePtr function = args.at(exec, 0);
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone)
if (!thisObj->getPropertySlot(exec, k, slot))
continue;
- JSValue* v = slot.getValue(exec, k);
+ JSValuePtr v = slot.getValue(exec, k);
ArgList eachArguments;
eachArguments.append(jsNumber(exec, k));
eachArguments.append(thisObj);
- JSValue* result = call(exec, function, callType, callData, applyThis, eachArguments);
+ JSValuePtr result = call(exec, function, callType, callData, applyThis, eachArguments);
resultArray->put(exec, k, result);
}
// http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
// http://developer-test.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:some
-JSValue* arrayProtoFuncEvery(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncEvery(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* function = args.at(exec, 0);
+ JSValuePtr function = args.at(exec, 0);
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone)
JSObject* applyThis = args.at(exec, 1)->isUndefinedOrNull() ? exec->globalThisValue() : args.at(exec, 1)->toObject(exec);
- JSValue* result = jsBoolean(true);
+ JSValuePtr result = jsBoolean(true);
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
return result;
}
-JSValue* arrayProtoFuncForEach(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncForEach(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* function = args.at(exec, 0);
+ JSValuePtr function = args.at(exec, 0);
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone)
return jsUndefined();
}
-JSValue* arrayProtoFuncSome(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncSome(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
JSObject* thisObj = thisValue->toThisObject(exec);
- JSValue* function = args.at(exec, 0);
+ JSValuePtr function = args.at(exec, 0);
CallData callData;
CallType callType = function->getCallData(callData);
if (callType == CallTypeNone)
JSObject* applyThis = args.at(exec, 1)->isUndefinedOrNull() ? exec->globalThisValue() : args.at(exec, 1)->toObject(exec);
- JSValue* result = jsBoolean(false);
+ JSValuePtr result = jsBoolean(false);
unsigned length = thisObj->get(exec, exec->propertyNames().length)->toUInt32(exec);
for (unsigned k = 0; k < length && !exec->hadException(); ++k) {
return result;
}
-JSValue* arrayProtoFuncIndexOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncIndexOf(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
// JavaScript 1.5 Extension by Mozilla
// Documentation: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf
index = static_cast<unsigned>(d);
}
- JSValue* searchElement = args.at(exec, 0);
+ JSValuePtr searchElement = args.at(exec, 0);
for (; index < length; ++index) {
- JSValue* e = getProperty(exec, thisObj, index);
+ JSValuePtr e = getProperty(exec, thisObj, index);
if (!e)
continue;
if (strictEqual(searchElement, e))
return jsNumber(exec, -1);
}
-JSValue* arrayProtoFuncLastIndexOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr arrayProtoFuncLastIndexOf(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
// JavaScript 1.6 Extension by Mozilla
// Documentation: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:lastIndexOf
if (d < length)
index = static_cast<int>(d);
- JSValue* searchElement = args.at(exec, 0);
+ JSValuePtr searchElement = args.at(exec, 0);
for (; index >= 0; --index) {
- JSValue* e = getProperty(exec, thisObj, index);
+ JSValuePtr e = getProperty(exec, thisObj, index);
if (!e)
continue;
if (strictEqual(searchElement, e))
}
// ECMA 15.6.1
-static JSValue* callBooleanConstructor(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+static JSValuePtr callBooleanConstructor(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
{
return jsBoolean(args.at(exec, 0)->toBoolean(exec));
}
return CallTypeHost;
}
-JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValue* immediateBooleanValue)
+JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValuePtr immediateBooleanValue)
{
BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure());
obj->setInternalValue(immediateBooleanValue);
virtual CallType getCallData(CallData&);
};
- JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSValue*);
+ JSObject* constructBooleanFromImmediateBoolean(ExecState*, JSValuePtr);
JSObject* constructBoolean(ExecState*, const ArgList&);
} // namespace JSC
static const ClassInfo info;
};
- BooleanObject* asBooleanObject(JSValue*);
+ BooleanObject* asBooleanObject(JSValuePtr);
- inline BooleanObject* asBooleanObject(JSValue* value)
+ inline BooleanObject* asBooleanObject(JSValuePtr value)
{
ASSERT(asObject(value)->inherits(&BooleanObject::info));
return static_cast<BooleanObject*>(asObject(value));
ASSERT_CLASS_FITS_IN_CELL(BooleanPrototype);
// Functions
-static JSValue* booleanProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* booleanProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValuePtr booleanProtoFuncToString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr booleanProtoFuncValueOf(ExecState*, JSObject*, JSValuePtr, const ArgList&);
// ECMA 15.6.4
// ECMA 15.6.4.2 + 15.6.4.3
-JSValue* booleanProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr booleanProtoFuncToString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (thisValue == jsBoolean(false))
return jsNontrivialString(exec, "false");
return jsNontrivialString(exec, "true");
}
-JSValue* booleanProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr booleanProtoFuncValueOf(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (JSImmediate::isBoolean(thisValue))
return thisValue;
namespace JSC {
-JSValue* call(ExecState* exec, JSValue* functionObject, CallType callType, const CallData& callData, JSValue* thisValue, const ArgList& args)
+JSValuePtr call(ExecState* exec, JSValuePtr functionObject, CallType callType, const CallData& callData, JSValuePtr thisValue, const ArgList& args)
{
if (callType == CallTypeHost)
return callData.native.function(exec, asObject(functionObject), thisValue, args);
#ifndef CallData_h
#define CallData_h
+#include "JSImmediate.h"
+
namespace JSC {
class ArgList;
CallTypeJS
};
- typedef JSValue* (*NativeFunction)(ExecState*, JSObject*, JSValue* thisValue, const ArgList&);
+ typedef JSValuePtr (*NativeFunction)(ExecState*, JSObject*, JSValuePtr thisValue, const ArgList&);
union CallData {
struct {
} js;
};
- JSValue* call(ExecState*, JSValue* functionObject, CallType, const CallData&, JSValue* thisValue, const ArgList&);
+ JSValuePtr call(ExecState*, JSValuePtr functionObject, CallType, const CallData&, JSValuePtr thisValue, const ArgList&);
} // namespace JSC
namespace JSC {
-JSObject* construct(ExecState* exec, JSValue* object, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
+JSObject* construct(ExecState* exec, JSValuePtr object, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
{
if (constructType == ConstructTypeHost)
return constructData.native.function(exec, asObject(object), args);
} js;
};
- JSObject* construct(ExecState*, JSValue* constructor, ConstructType, const ConstructData&, const ArgList&);
+ JSObject* construct(ExecState*, JSValuePtr constructor, ConstructType, const ConstructData&, const ArgList&);
} // namespace JSC
ASSERT_CLASS_FITS_IN_CELL(DateConstructor);
-static JSValue* dateParse(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateNow(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateUTC(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValuePtr dateParse(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateNow(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateUTC(ExecState*, JSObject*, JSValuePtr, const ArgList&);
DateConstructor::DateConstructor(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure, DatePrototype* datePrototype)
: InternalFunction(&exec->globalData(), structure, Identifier(exec, datePrototype->classInfo()->className))
if (args.at(exec, 0)->isObject(&DateInstance::info))
value = asDateInstance(args.at(exec, 0))->internalNumber();
else {
- JSValue* primitive = args.at(exec, 0)->toPrimitive(exec);
+ JSValuePtr primitive = args.at(exec, 0)->toPrimitive(exec);
if (primitive->isString())
value = parseDate(primitive->getString());
else
}
// ECMA 15.9.2
-static JSValue* callDate(ExecState* exec, JSObject*, JSValue*, const ArgList&)
+static JSValuePtr callDate(ExecState* exec, JSObject*, JSValuePtr, const ArgList&)
{
time_t localTime = time(0);
tm localTM;
return CallTypeHost;
}
-static JSValue* dateParse(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+static JSValuePtr dateParse(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
{
return jsNumber(exec, parseDate(args.at(exec, 0)->toString(exec)));
}
-static JSValue* dateNow(ExecState* exec, JSObject*, JSValue*, const ArgList&)
+static JSValuePtr dateNow(ExecState* exec, JSObject*, JSValuePtr, const ArgList&)
{
return jsNumber(exec, getCurrentUTCTime());
}
-static JSValue* dateUTC(ExecState* exec, JSObject*, JSValue*, const ArgList& args)
+static JSValuePtr dateUTC(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
{
int n = args.size();
if (isnan(args.at(exec, 0)->toNumber(exec))
mutable Cache* m_cache;
};
- DateInstance* asDateInstance(JSValue*);
+ DateInstance* asDateInstance(JSValuePtr);
- inline DateInstance* asDateInstance(JSValue* value)
+ inline DateInstance* asDateInstance(JSValuePtr value)
{
ASSERT(asObject(value)->inherits(&DateInstance::info));
return static_cast<DateInstance*>(asObject(value));
ASSERT_CLASS_FITS_IN_CELL(DatePrototype);
-static JSValue* dateProtoFuncGetDate(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetDay(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetHours(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetMilliSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetTime(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetTimezoneOffset(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCDate(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCDay(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCHours(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCMilliseconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetUTCSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncGetYear(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetDate(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetHours(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetMilliSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetTime(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCDate(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCFullYear(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCHours(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCMilliseconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCMinutes(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCMonth(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetUTCSeconds(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncSetYear(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToDateString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToGMTString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToLocaleDateString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToLocaleTimeString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToTimeString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncToUTCString(ExecState*, JSObject*, JSValue*, const ArgList&);
-static JSValue* dateProtoFuncValueOf(ExecState*, JSObject*, JSValue*, const ArgList&);
+static JSValuePtr dateProtoFuncGetDate(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetDay(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetFullYear(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetHours(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetMilliSeconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetMinutes(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetMonth(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetSeconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetTime(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetTimezoneOffset(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCDate(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCDay(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCFullYear(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCHours(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCMilliseconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCMinutes(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCMonth(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetUTCSeconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncGetYear(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetDate(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetFullYear(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetHours(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetMilliSeconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetMinutes(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetMonth(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetSeconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetTime(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCDate(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCFullYear(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCHours(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCMilliseconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCMinutes(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCMonth(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetUTCSeconds(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncSetYear(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToDateString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToGMTString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToLocaleDateString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToLocaleString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToLocaleTimeString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToTimeString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncToUTCString(ExecState*, JSObject*, JSValuePtr, const ArgList&);
+static JSValuePtr dateProtoFuncValueOf(ExecState*, JSObject*, JSValuePtr, const ArgList&);
}
// Functions
-JSValue* dateProtoFuncToString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncToString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNontrivialString(exec, formatDate(t) + " " + formatTime(t, utc));
}
-JSValue* dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncToUTCString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, utc));
}
-JSValue* dateProtoFuncToDateString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncToDateString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNontrivialString(exec, formatDate(t));
}
-JSValue* dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncToTimeString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNontrivialString(exec, formatTime(t, utc));
}
-JSValue* dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr dateProtoFuncToLocaleString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
#endif
}
-JSValue* dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr dateProtoFuncToLocaleDateString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
#endif
}
-JSValue* dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr dateProtoFuncToLocaleTimeString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
#endif
}
-JSValue* dateProtoFuncValueOf(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncValueOf(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, milli);
}
-JSValue* dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetTime(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, milli);
}
-JSValue* dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetFullYear(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, 1900 + t.year);
}
-JSValue* dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCFullYear(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, 1900 + t.year);
}
-JSValue* dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncToGMTString(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNontrivialString(exec, formatDateUTCVariant(t) + " " + formatTime(t, utc));
}
-JSValue* dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetMonth(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.month);
}
-JSValue* dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCMonth(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.month);
}
-JSValue* dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetDate(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.monthDay);
}
-JSValue* dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCDate(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.monthDay);
}
-JSValue* dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetDay(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.weekDay);
}
-JSValue* dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCDay(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.weekDay);
}
-JSValue* dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetHours(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.hour);
}
-JSValue* dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCHours(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.hour);
}
-JSValue* dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetMinutes(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.minute);
}
-JSValue* dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCMinutes(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.minute);
}
-JSValue* dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetSeconds(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.second);
}
-JSValue* dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCSeconds(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, t.second);
}
-JSValue* dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetMilliSeconds(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, ms);
}
-JSValue* dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetUTCMilliseconds(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, ms);
}
-JSValue* dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList&)
+JSValuePtr dateProtoFuncGetTimezoneOffset(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList&)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
return jsNumber(exec, -gmtoffset(t) / minutesPerHour);
}
-JSValue* dateProtoFuncSetTime(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
+JSValuePtr dateProtoFuncSetTime(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
if (!thisValue->isObject(&DateInstance::info))
return throwError(exec, TypeError);
DateInstance* thisDateObj = asDateInstance(thisValue);
double m