Commit 65606f2c authored by weinig@apple.com's avatar weinig@apple.com

2008-07-11 Sam Weinig <sam@webkit.org>

        Rubber-stamped by Darin Adler.

        Move call function to CallData.cpp and construct to ConstructData.cpp.

        * GNUmakefile.am:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * kjs/AllInOneFile.cpp:
        * kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
        * kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
        * kjs/JSValue.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 468f0364
2008-07-11 Sam Weinig <sam@webkit.org>
Rubber-stamped by Darin Adler.
Move call function to CallData.cpp and construct to ConstructData.cpp.
* GNUmakefile.am:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* kjs/AllInOneFile.cpp:
* kjs/CallData.cpp: Copied from kjs/JSValue.cpp.
* kjs/ConstructData.cpp: Copied from kjs/JSValue.cpp.
* kjs/JSValue.cpp:
2008-07-10 Mark Rowe <mrowe@apple.com>
Reviewed by Sam Weinig.
......@@ -83,8 +83,10 @@ javascriptcore_sources += \
JavaScriptCore/kjs/BooleanConstructor.cpp \
JavaScriptCore/kjs/BooleanObject.cpp \
JavaScriptCore/kjs/BooleanPrototype.cpp \
JavaScriptCore/kjs/CallData.cpp \
JavaScriptCore/kjs/collector.cpp \
JavaScriptCore/kjs/CommonIdentifiers.cpp \
JavaScriptCore/kjs/ConstructData.cpp \
JavaScriptCore/kjs/DateConstructor.cpp \
JavaScriptCore/kjs/DateInstance.cpp \
JavaScriptCore/kjs/DateMath.cpp \
......
......@@ -68,8 +68,10 @@ SOURCES += \
kjs/BooleanConstructor.cpp \
kjs/BooleanObject.cpp \
kjs/BooleanPrototype.cpp \
kjs/CallData.cpp \
kjs/collector.cpp \
kjs/CommonIdentifiers.cpp \
kjs/ConstructData.cpp \
kjs/DateConstructor.cpp \
kjs/DateInstance.cpp \
kjs/DateMath.cpp \
......
......@@ -324,6 +324,14 @@
RelativePath="..\..\kjs\BooleanPrototype.h"
>
</File>
<File
RelativePath="..\..\kjs\CallData.cpp"
>
</File>
<File
RelativePath="..\..\kjs\CallData.h"
>
</File>
<File
RelativePath="..\..\kjs\ClassInfo.h"
>
......@@ -356,6 +364,14 @@
RelativePath="..\..\kjs\config.h"
>
</File>
<File
RelativePath="..\..\kjs\ConstructData.cpp"
>
</File>
<File
RelativePath="..\..\kjs\ConstructData.h"
>
</File>
<File
RelativePath="..\..\kjs\DateConstructor.cpp"
>
......
......@@ -676,6 +676,8 @@
BC7F8FBA0E19D1EF008632C0 /* JSCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCell.cpp; sourceTree = "<group>"; };
BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConstructData.h; sourceTree = "<group>"; };
BC9BB95B0E19680600DF8855 /* InternalFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InternalFunction.cpp; sourceTree = "<group>"; };
BCA62DFE0E2826230004F30D /* CallData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallData.cpp; sourceTree = "<group>"; };
BCA62DFF0E2826310004F30D /* ConstructData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstructData.cpp; sourceTree = "<group>"; };
BCD202BD0E1706A7002C7E82 /* RegExpConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpConstructor.cpp; sourceTree = "<group>"; };
BCD202BE0E1706A7002C7E82 /* RegExpConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpConstructor.h; sourceTree = "<group>"; };
BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpPrototype.cpp; sourceTree = "<group>"; };
......@@ -1083,6 +1085,7 @@
704FD35305697E6D003DBED9 /* BooleanObject.h */,
BC7952340E15EB5600A898AB /* BooleanPrototype.cpp */,
BC7952350E15EB5600A898AB /* BooleanPrototype.h */,
BCA62DFE0E2826230004F30D /* CallData.cpp */,
145C507F0D9DF63B0088F6B9 /* CallData.h */,
BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */,
F692A8520255597D01FF60F7 /* collector.cpp */,
......@@ -1091,6 +1094,7 @@
65EA73630BAE35D1001BB560 /* CommonIdentifiers.h */,
F5BB2BC5030F772101FCFE1D /* completion.h */,
F68EBB8C0255D4C601FF60F7 /* config.h */,
BCA62DFF0E2826310004F30D /* ConstructData.cpp */,
BC8F3CCF0DAF17BA00577A80 /* ConstructData.h */,
F692A8540255597D01FF60F7 /* create_hash_table */,
BCD203450E17135E002C7E82 /* DateConstructor.cpp */,
......
......@@ -50,8 +50,10 @@ Source files for JSCore.
kjs/BooleanConstructor.cpp
kjs/BooleanObject.cpp
kjs/BooleanPrototype.cpp
kjs/CallData.cpp
kjs/collector.cpp
kjs/CommonIdentifiers.cpp
kjs/ConstructData.cpp
kjs/DateConstructor.cpp
kjs/DateInstance.cpp
kjs/DateMath.cpp
......
......@@ -93,6 +93,8 @@
#include "StringPrototype.cpp"
#include "ustring.cpp"
#include "JSValue.cpp"
#include "CallData.cpp"
#include "ConstructData.cpp"
#include "JSCell.cpp"
#include "JSVariableObject.cpp"
#include "wtf/FastMalloc.cpp"
......
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "CallData.h"
#include "JSFunction.h"
namespace KJS {
JSValue* call(ExecState* exec, JSValue* functionObject, CallType callType, const CallData& callData, JSValue* thisValue, const ArgList& args)
{
if (callType == CallTypeNative)
return callData.native.function(exec, static_cast<JSObject*>(functionObject), thisValue, args);
ASSERT(callType == CallTypeJS);
// FIXME: Can this be done more efficiently using the callData?
return static_cast<JSFunction*>(functionObject)->call(exec, thisValue, args);
}
} // namespace KJS
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "ConstructData.h"
#include "JSFunction.h"
namespace KJS {
JSObject* construct(ExecState* exec, JSValue* object, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
{
if (constructType == ConstructTypeNative)
return constructData.native.function(exec, static_cast<JSObject*>(object), args);
ASSERT(constructType == ConstructTypeJS);
// FIXME: Can this be done more efficiently using the constructData?
return static_cast<JSFunction*>(object)->construct(exec, args);
}
} // namespace KJS
......@@ -101,24 +101,4 @@ float JSValue::toFloat(ExecState* exec) const
return static_cast<float>(toNumber(exec));
}
// Declared in CallData.h
JSValue* call(ExecState* exec, JSValue* functionObject, CallType callType, const CallData& callData, JSValue* thisValue, const ArgList& args)
{
if (callType == CallTypeNative)
return callData.native.function(exec, static_cast<JSObject*>(functionObject), thisValue, args);
ASSERT(callType == CallTypeJS);
// FIXME: Can this be done more efficiently using the callData?
return static_cast<JSFunction*>(functionObject)->call(exec, thisValue, args);
}
// Declared in ConstructData.h
JSObject* construct(ExecState* exec, JSValue* object, ConstructType constructType, const ConstructData& constructData, const ArgList& args)
{
if (constructType == ConstructTypeNative)
return constructData.native.function(exec, static_cast<JSObject*>(object), args);
ASSERT(constructType == ConstructTypeJS);
// FIXME: Can this be done more efficiently using the constructData?
return static_cast<JSFunction*>(object)->construct(exec, args);
}
} // namespace KJS
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment