Commit 2f6dfdf7 authored by mrowe@apple.com's avatar mrowe@apple.com

Merge squirrelfish branch into trunk.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f3330d64
......@@ -108,7 +108,6 @@ inline JSContextRef toRef(KJS::ExecState* e)
inline JSGlobalContextRef toGlobalRef(KJS::ExecState* e)
{
ASSERT(!e->callingExecState());
return reinterpret_cast<JSGlobalContextRef>(e);
}
......
......@@ -44,8 +44,10 @@ JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef th
JSObject* jsThisObject = toJS(thisObject);
UString::Rep* scriptRep = toJS(script);
UString::Rep* sourceURLRep = sourceURL ? toJS(sourceURL) : &UString::Rep::null;
// Interpreter::evaluate sets "this" to the global object if it is NULL
Completion completion = Interpreter::evaluate(exec->dynamicGlobalObject()->globalExec(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject);
JSGlobalObject* globalObject = exec->dynamicGlobalObject();
Completion completion = Interpreter::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject);
if (completion.complType() == Throw) {
if (exception)
......
......@@ -56,9 +56,9 @@ bool JSCallbackConstructor::implementsHasInstance() const
return true;
}
bool JSCallbackConstructor::implementsConstruct() const
ConstructType JSCallbackConstructor::getConstructData(ConstructData&)
{
return true;
return ConstructTypeNative;
}
JSObject* JSCallbackConstructor::construct(ExecState* exec, const List &args)
......
......@@ -32,16 +32,15 @@
namespace KJS {
class JSCallbackConstructor : public JSObject
{
class JSCallbackConstructor : public JSObject {
public:
JSCallbackConstructor(ExecState* exec, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback);
virtual ~JSCallbackConstructor();
virtual bool implementsHasInstance() const;
virtual bool implementsConstruct() const;
virtual JSObject* construct(ExecState*, const List &args);
virtual ConstructType getConstructData(ConstructData&);
virtual JSObject* construct(ExecState*, const List& args);
virtual const ClassInfo *classInfo() const { return &info; }
static const ClassInfo info;
......
......@@ -53,13 +53,13 @@ public:
virtual bool deleteProperty(ExecState*, const Identifier&);
virtual bool deleteProperty(ExecState*, unsigned);
virtual bool implementsConstruct() const;
virtual ConstructType getConstructData(ConstructData&);
virtual JSObject* construct(ExecState*, const List& args);
virtual bool implementsHasInstance() const;
virtual bool hasInstance(ExecState *exec, JSValue *value);
virtual bool implementsCall() const;
virtual CallType getCallData(CallData&);
virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List &args);
virtual void getPropertyNames(ExecState*, PropertyNameArray&);
......
......@@ -237,13 +237,13 @@ bool JSCallbackObject<Base>::deleteProperty(ExecState* exec, unsigned propertyNa
}
template <class Base>
bool JSCallbackObject<Base>::implementsConstruct() const
ConstructType JSCallbackObject<Base>::getConstructData(ConstructData&)
{
for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass)
if (jsClass->callAsConstructor)
return true;
return ConstructTypeNative;
return false;
return ConstructTypeNone;
}
template <class Base>
......@@ -263,7 +263,7 @@ JSObject* JSCallbackObject<Base>::construct(ExecState* exec, const List& args)
}
}
ASSERT(0); // implementsConstruct should prevent us from reaching here
ASSERT(0); // getConstructData should prevent us from reaching here
return 0;
}
......@@ -293,15 +293,14 @@ bool JSCallbackObject<Base>::hasInstance(ExecState *exec, JSValue *value)
return 0;
}
template <class Base>
bool JSCallbackObject<Base>::implementsCall() const
CallType JSCallbackObject<Base>::getCallData(CallData&)
{
for (JSClassRef jsClass = m_class; jsClass; jsClass = jsClass->parentClass)
if (jsClass->callAsFunction)
return true;
return CallTypeNative;
return false;
return CallTypeNone;
}
template <class Base>
......@@ -322,7 +321,7 @@ JSValue* JSCallbackObject<Base>::callAsFunction(ExecState* exec, JSObject* thisO
}
}
ASSERT_NOT_REACHED(); // implementsCall should prevent us from reaching here
ASSERT_NOT_REACHED(); // getCallData should prevent us from reaching here
return 0;
}
......@@ -367,6 +366,11 @@ void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray
template <class Base>
double JSCallbackObject<Base>::toNumber(ExecState* exec) const
{
// We need this check to guard against the case where this object is rhs of
// a binary expression where lhs threw an exception in its conversion to
// primitive
if (exec->hadException())
return NaN;
JSContextRef ctx = toRef(exec);
JSObjectRef thisRef = toRef(this);
......
......@@ -298,7 +298,8 @@ JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObject
bool JSObjectIsConstructor(JSContextRef, JSObjectRef object)
{
JSObject* jsObject = toJS(object);
return jsObject->implementsConstruct();
ConstructData constructData;
return jsObject->getConstructData(constructData) != ConstructTypeNone;
}
JSObjectRef JSObjectCallAsConstructor(JSContextRef ctx, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
......
......@@ -134,13 +134,13 @@ bool JSValueIsEqual(JSContextRef ctx, JSValueRef a, JSValueRef b, JSValueRef* ex
bool JSValueIsStrictEqual(JSContextRef ctx, JSValueRef a, JSValueRef b)
{
UNUSED_PARAM(ctx);
JSLock lock;
ExecState* exec = toJS(ctx);
JSValue* jsA = toJS(a);
JSValue* jsB = toJS(b);
bool result = strictEqual(exec, jsA, jsB); // can't throw because it doesn't perform value conversion
ASSERT(!exec->hadException());
bool result = strictEqual(jsA, jsB);
return result;
}
......
This diff is collapsed.
......@@ -26,7 +26,9 @@
VPATH = \
$(JavaScriptCore)/kjs \
$(JavaScriptCore)/VM \
$(JavaScriptCore)/pcre \
$(JavaScriptCore)/docs \
#
.PHONY : all
......@@ -40,6 +42,7 @@ all : \
number_object.lut.h \
regexp_object.lut.h \
string_object.lut.h \
$(JavaScriptCore)/docs/bytecode.html \
#
# lookup tables for classes
......@@ -63,3 +66,7 @@ grammar.cpp: grammar.y
chartables.c : dftables
$^ $@
$(JavaScriptCore)/docs/bytecode.html: make-bytecode-docs.pl Machine.cpp
perl $^ $@
......@@ -83,12 +83,11 @@ __ZN3KJS10Identifier5equalEPKNS_7UString3RepEPKc
__ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeE
__ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeEPKc
__ZN3KJS10throwErrorEPNS_9ExecStateENS_9ErrorTypeERKNS_7UStringE
__ZN3KJS11Interpreter11checkSyntaxEPNS_9ExecStateERKNS_7UStringEiPKti
__ZN3KJS11Interpreter11checkSyntaxEPNS_9ExecStateERKNS_7UStringEiS5_
__ZN3KJS11Interpreter21shouldPrintExceptionsEv
__ZN3KJS11Interpreter24setShouldPrintExceptionsEb
__ZN3KJS11Interpreter8evaluateEPNS_9ExecStateERKNS_7UStringEiPKtiPNS_7JSValueE
__ZN3KJS11Interpreter8evaluateEPNS_9ExecStateERKNS_7UStringEiS5_PNS_7JSValueE
__ZN3KJS11JSImmediate4typeEPKNS_7JSValueE
__ZN3KJS11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_7UStringEiN3WTF10PassRefPtrINS_14SourceProviderEEEPNS_7JSValueE
__ZN3KJS11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_7UStringEiS7_PNS_7JSValueE
__ZN3KJS11JSImmediate8toObjectEPKNS_7JSValueEPNS_9ExecStateE
__ZN3KJS11JSImmediate8toStringEPKNS_7JSValueE
__ZN3KJS11ProfileNode18sortCallsAscendingEv
......@@ -101,12 +100,15 @@ __ZN3KJS11ProfileNode25sortFunctionNameAscendingEv
__ZN3KJS11ProfileNode26sortFunctionNameDescendingEv
__ZN3KJS11ProgramNode6createEPNS_14SourceElementsEPN3WTF6VectorISt4pairINS_10IdentifierEjELm16EEEPNS4_IPNS_12FuncDeclNodeELm16EEEbb
__ZN3KJS11PropertyMap11getLocationERKNS_10IdentifierE
__ZN3KJS11PropertyMap11getLocationERKNS_10IdentifierERb
__ZN3KJS11PropertyMap3putERKNS_10IdentifierEPNS_7JSValueEjb
__ZN3KJS11PropertyMap5clearEv
__ZN3KJS11PropertyMapD1Ev
__ZN3KJS12DateInstance4infoE
__ZN3KJS12PropertySlot15undefinedGetterEPNS_9ExecStateEPNS_8JSObjectERKNS_10IdentifierERKS0_
__ZN3KJS12jsNumberCellEd
__ZN3KJS13ArrayInstance4infoE
__ZN3KJS13CodeGenerator21setDumpsGeneratedCodeEb
__ZN3KJS13StatementNode6setLocEii
__ZN3KJS13jsOwnedStringERKNS_7UStringE
__ZN3KJS14JSGlobalObject10globalExecEv
......@@ -127,8 +129,6 @@ __ZN3KJS14StringInstance3putEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueE
__ZN3KJS14StringInstance4infoE
__ZN3KJS14StringInstanceC1EPNS_8JSObjectERKNS_7UStringE
__ZN3KJS14StringInstanceC2EPNS_8JSObjectERKNS_7UStringE
__ZN3KJS15GlobalExecStateC1EPNS_14JSGlobalObjectEPNS_8JSObjectE
__ZN3KJS15GlobalExecStateD1Ev
__ZN3KJS15JSWrapperObject4markEv
__ZN3KJS16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZN3KJS16JSVariableObject16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE
......@@ -137,13 +137,16 @@ __ZN3KJS16ParserRefCounted5derefEv
__ZN3KJS17PropertyNameArray3addEPNS_7UString3RepE
__ZN3KJS17PrototypeFunctionC1EPNS_9ExecStateEPNS_17FunctionPrototypeEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectERKNS_4ListEE
__ZN3KJS17PrototypeFunctionC1EPNS_9ExecStateEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectERKNS_4ListEE
__ZN3KJS17RegisterFileStack20allocateRegisterFileEmPS0_
__ZN3KJS19InternalFunctionImp11getCallDataERNS_8CallDataE
__ZN3KJS19InternalFunctionImp4infoE
__ZN3KJS19InternalFunctionImpC2EPNS_17FunctionPrototypeERKNS_10IdentifierE
__ZN3KJS19initializeThreadingEv
__ZN3KJS23objectProtoFuncToStringEPNS_9ExecStateEPNS_8JSObjectERKNS_4ListE
__ZN3KJS4evalEPNS_9ExecStateERKNS_10ScopeChainEPNS_16JSVariableObjectEPNS_14JSGlobalObjectEPNS_8JSObjectERKNS_4ListE
__ZN3KJS4List15expandAndAppendEPNS_7JSValueE
__ZN3KJS4List7markSetEv
__ZN3KJS6JSCell11getCallDataERNS_8CallDataE
__ZN3KJS6JSCell16getConstructDataERNS_13ConstructDataE
__ZN3KJS6JSCell9getObjectEv
__ZN3KJS6JSCellnwEm
__ZN3KJS6JSLock12DropAllLocksC1Ev
......@@ -152,11 +155,12 @@ __ZN3KJS6JSLock14registerThreadEv
__ZN3KJS6JSLock4lockEv
__ZN3KJS6JSLock6unlockEv
__ZN3KJS6JSLock9lockCountEv
__ZN3KJS6Parser5parseEiPKtjPiS3_PNS_7UStringE
__ZN3KJS6Parser5parseEPNS_9ExecStateERKNS_7UStringEiN3WTF10PassRefPtrINS_14SourceProviderEEEPiSA_PS3_
__ZN3KJS6parserEv
__ZN3KJS6strtodEPKcPPc
__ZN3KJS7CStringD1Ev
__ZN3KJS7CStringaSERKS0_
__ZN3KJS7Machine13dumpCallFrameEPKNS_9CodeBlockEPNS_14ScopeChainNodeEPNS_12RegisterFileEPKNS_8RegisterE
__ZN3KJS7UString3Rep11computeHashEPKti
__ZN3KJS7UString3Rep4nullE
__ZN3KJS7UString3Rep7destroyEv
......@@ -167,10 +171,8 @@ __ZN3KJS7UStringC1EPKc
__ZN3KJS7UStringC1EPKti
__ZN3KJS7UStringC1ERKS0_S2_
__ZN3KJS7UStringaSEPKc
__ZN3KJS8Debugger12sourceUnusedEPNS_9ExecStateEi
__ZN3KJS8Debugger6attachEPNS_14JSGlobalObjectE
__ZN3KJS8Debugger6detachEPNS_14JSGlobalObjectE
__ZN3KJS8Debugger9exceptionEPNS_9ExecStateEiiPNS_7JSValueE
__ZN3KJS8DebuggerC2Ev
__ZN3KJS8DebuggerD2Ev
__ZN3KJS8JSObject11hasInstanceEPNS_9ExecStateEPNS_7JSValueE
......@@ -182,6 +184,7 @@ __ZN3KJS8JSObject12removeDirectERKNS_10IdentifierE
__ZN3KJS8JSObject14callAsFunctionEPNS_9ExecStateEPS0_RKNS_4ListE
__ZN3KJS8JSObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZN3KJS8JSObject14deletePropertyEPNS_9ExecStateEj
__ZN3KJS8JSObject14implementsCallEv
__ZN3KJS8JSObject16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE
__ZN3KJS8JSObject17putDirectFunctionEPNS_19InternalFunctionImpEi
__ZN3KJS8JSObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueEj
......@@ -195,11 +198,10 @@ __ZN3KJS8JSObject4callEPNS_9ExecStateEPS0_RKNS_4ListE
__ZN3KJS8JSObject4markEv
__ZN3KJS8JSObject9constructEPNS_9ExecStateERKNS_4ListE
__ZN3KJS8JSObject9constructEPNS_9ExecStateERKNS_4ListERKNS_10IdentifierERKNS_7UStringEi
__ZN3KJS8JSObject9putDirectERKNS_10IdentifierEPNS_7JSValueEi
__ZN3KJS8JSObject9putDirectERKNS_10IdentifierEii
__ZN3KJS8Profiler8profilerEv
__ZN3KJS8jsStringEPKc
__ZN3KJS8jsStringERKNS_7UStringE
__ZN3KJS9Collector12heapAllocateILNS0_8HeapTypeE1EEEPvm
__ZN3KJS9Collector15recordExtraCostEm
__ZN3KJS9Collector17globalObjectCountEv
__ZN3KJS9Collector20protectedObjectCountEv
......@@ -212,6 +214,7 @@ __ZN3KJS9Collector4sizeEv
__ZN3KJS9Collector7collectEv
__ZN3KJS9Collector7protectEPNS_7JSValueE
__ZN3KJS9Collector9unprotectEPNS_7JSValueE
__ZN3KJS9ExecStateC1EPNS_14JSGlobalObjectEPNS_8JSObjectEPNS_14ScopeChainNodeE
__ZN3KJSeqERKNS_7UStringEPKc
__ZN3WTF10fastCallocEmm
__ZN3WTF10fastMallocEm
......@@ -249,7 +252,9 @@ __ZNK3KJS14JSGlobalObject14isDynamicScopeEv
__ZNK3KJS14JSGlobalObject14toGlobalObjectEPNS_9ExecStateE
__ZNK3KJS16JSVariableObject16isVariableObjectEv
__ZNK3KJS16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj
__ZNK3KJS19InternalFunctionImp14implementsCallEv
__ZNK3KJS17DebuggerCallFrame10thisObjectEv
__ZNK3KJS17DebuggerCallFrame12functionNameEv
__ZNK3KJS17DebuggerCallFrame8evaluateERKNS_7UStringERPNS_7JSValueE
__ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv
__ZNK3KJS4List8getSliceEiRS0_
__ZNK3KJS4Node8toStringEv
......@@ -268,19 +273,16 @@ __ZNK3KJS7UString10UTF8StringEb
__ZNK3KJS7UString14toStrictUInt32EPb
__ZNK3KJS7UString5asciiEv
__ZNK3KJS7UString6is8BitEv
__ZNK3KJS7UString6substrEii
__ZNK3KJS7UString8toUInt32EPb
__ZNK3KJS7UString8toUInt32EPbb
__ZNK3KJS8JSObject11hasPropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZNK3KJS8JSObject11hasPropertyEPNS_9ExecStateEj
__ZNK3KJS8JSObject12defaultValueEPNS_9ExecStateENS_6JSTypeE
__ZNK3KJS8JSObject12toThisObjectEPNS_9ExecStateE
__ZNK3KJS8JSObject14implementsCallEv
__ZNK3KJS8JSObject14toGlobalObjectEPNS_9ExecStateE
__ZNK3KJS8JSObject19implementsConstructEv
__ZNK3KJS8JSObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj
__ZNK3KJS8JSObject21implementsHasInstanceEv
__ZNK3KJS8JSObject3getEPNS_9ExecStateERKNS_10IdentifierE
__ZNK3KJS8JSObject3getEPNS_9ExecStateEj
__ZNK3KJS8JSObject4typeEv
__ZNK3KJS8JSObject8toNumberEPNS_9ExecStateE
__ZNK3KJS8JSObject8toObjectEPNS_9ExecStateE
......@@ -288,7 +290,7 @@ __ZNK3KJS8JSObject8toStringEPNS_9ExecStateE
__ZNK3KJS8JSObject9classInfoEv
__ZNK3KJS8JSObject9classNameEv
__ZNK3KJS8JSObject9toBooleanEPNS_9ExecStateE
__ZNK3KJS9ExecState19lexicalGlobalObjectEv
__ZNK3KJS9ExecState14isGlobalObjectEPNS_8JSObjectE
__ZNK3KJS9HashTable11createTableEv
__ZNK3WTF8Collator7collateEPKtmS2_m
__ZTVN3KJS14JSGlobalObjectE
......@@ -297,6 +299,7 @@ __ZTVN3KJS15JSWrapperObjectE
__ZTVN3KJS16JSVariableObjectE
__ZTVN3KJS19InternalFunctionImpE
__ZTVN3KJS8JSObjectE
__ZTVN3KJS9NumberImpE
_jscore_collector_introspection
_jscore_fastmalloc_introspection
_kJSClassDefinitionEmpty
......@@ -2,8 +2,8 @@
VPATH += $$PWD
INCLUDEPATH += tmp
INCLUDEPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode
DEPENDPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode
INCLUDEPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode $$PWD/VM
DEPENDPATH += $$PWD $$PWD/kjs $$PWD/wtf $$PWD/wtf/unicode $$PWD/VM
DEFINES -= KJS_IDENTIFIER_HIDE_GLOBALS
DEFINES += BUILDING_QT__
......@@ -45,7 +45,21 @@ SOURCES += \
API/JSValueRef.cpp \
kjs/InitializeThreading.cpp \
kjs/JSGlobalObject.cpp \
kjs/JSVariableObject.cpp
kjs/JSVariableObject.cpp \
kjs/JSActivation.cpp \
kjs/JSNotAnObject.cpp \
VM/CodeBlock.cpp \
VM/CodeGenerator.cpp \
VM/ExceptionHelpers.cpp \
VM/Instruction.cpp \
VM/JSPropertyNameIterator.cpp \
VM/LabelID.cpp \
VM/Machine.cpp \
VM/Opcode.cpp \
VM/Register.cpp \
VM/RegisterFile.cpp \
VM/RegisterFileStack.cpp \
VM/RegisterID.cpp
# AllInOneFile.cpp helps gcc analize and optimize code
# Other compilers may be able to do this at link time
......
......@@ -39,7 +39,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../kjs/;../../wtf/;&quot;$(WebKitLibrariesDir)\include\icu&quot;;../../../icu/include;&quot;$(WebKitLibrariesDir)\include&quot;"
AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../kjs/;../../VM/;../../wtf/;&quot;$(WebKitLibrariesDir)\include\icu&quot;;../../../icu/include;&quot;$(WebKitLibrariesDir)\include&quot;"
PreprocessorDefinitions="HAVE_CONFIG_H;__STD_C"
/>
<Tool
......@@ -109,7 +109,7 @@
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../kjs/;../../wtf/;&quot;$(WebKitLibrariesDir)\include\icu&quot;;../../../icu/include;&quot;$(WebKitLibrariesDir)\include&quot;"
AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\JavaScriptCore\$(ConfigurationName)\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;