Commit 951b1454 authored by cwzwarich@webkit.org's avatar cwzwarich@webkit.org

2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>

        Reviewed by Oliver Hunt.

        Bug 20711: Change KJS prefix on preprocessor macros to JSC
        <https://bugs.webkit.org/show_bug.cgi?id=20711>

        JavaScriptCore:

        * kjs/CommonIdentifiers.cpp:
        (JSC::CommonIdentifiers::CommonIdentifiers):
        * kjs/CommonIdentifiers.h:
        * kjs/PropertySlot.h:
        (JSC::PropertySlot::getValue):
        (JSC::PropertySlot::putValue):
        (JSC::PropertySlot::setValueSlot):
        (JSC::PropertySlot::setValue):
        (JSC::PropertySlot::setRegisterSlot):
        * kjs/lookup.h:
        * kjs/nodes.cpp:
        * kjs/nodes.h:
        (JSC::Node::):
        (JSC::ExpressionNode::):
        (JSC::StatementNode::):
        (JSC::NullNode::):
        (JSC::BooleanNode::):
        (JSC::NumberNode::):
        (JSC::ImmediateNumberNode::):
        (JSC::StringNode::):
        (JSC::RegExpNode::):
        (JSC::ThisNode::):
        (JSC::ResolveNode::):
        (JSC::ElementNode::):
        (JSC::ArrayNode::):
        (JSC::PropertyNode::):
        (JSC::PropertyListNode::):
        (JSC::ObjectLiteralNode::):
        (JSC::BracketAccessorNode::):
        (JSC::DotAccessorNode::):
        (JSC::ArgumentListNode::):
        (JSC::ArgumentsNode::):
        (JSC::NewExprNode::):
        (JSC::EvalFunctionCallNode::):
        (JSC::FunctionCallValueNode::):
        (JSC::FunctionCallResolveNode::):
        (JSC::FunctionCallBracketNode::):
        (JSC::FunctionCallDotNode::):
        (JSC::PrePostResolveNode::):
        (JSC::PostfixResolveNode::):
        (JSC::PostfixBracketNode::):
        (JSC::PostfixDotNode::):
        (JSC::PostfixErrorNode::):
        (JSC::DeleteResolveNode::):
        (JSC::DeleteBracketNode::):
        (JSC::DeleteDotNode::):
        (JSC::DeleteValueNode::):
        (JSC::VoidNode::):
        (JSC::TypeOfResolveNode::):
        (JSC::TypeOfValueNode::):
        (JSC::PrefixResolveNode::):
        (JSC::PrefixBracketNode::):
        (JSC::PrefixDotNode::):
        (JSC::PrefixErrorNode::):
        (JSC::UnaryPlusNode::):
        (JSC::NegateNode::):
        (JSC::BitwiseNotNode::):
        (JSC::LogicalNotNode::):
        (JSC::MultNode::):
        (JSC::DivNode::):
        (JSC::ModNode::):
        (JSC::AddNode::):
        (JSC::SubNode::):
        (JSC::LeftShiftNode::):
        (JSC::RightShiftNode::):
        (JSC::UnsignedRightShiftNode::):
        (JSC::LessNode::):
        (JSC::GreaterNode::):
        (JSC::LessEqNode::):
        (JSC::GreaterEqNode::):
        (JSC::ThrowableBinaryOpNode::):
        (JSC::InstanceOfNode::):
        (JSC::InNode::):
        (JSC::EqualNode::):
        (JSC::NotEqualNode::):
        (JSC::StrictEqualNode::):
        (JSC::NotStrictEqualNode::):
        (JSC::BitAndNode::):
        (JSC::BitOrNode::):
        (JSC::BitXOrNode::):
        (JSC::LogicalOpNode::):
        (JSC::ConditionalNode::):
        (JSC::ReadModifyResolveNode::):
        (JSC::AssignResolveNode::):
        (JSC::ReadModifyBracketNode::):
        (JSC::AssignBracketNode::):
        (JSC::AssignDotNode::):
        (JSC::ReadModifyDotNode::):
        (JSC::AssignErrorNode::):
        (JSC::CommaNode::):
        (JSC::VarDeclCommaNode::):
        (JSC::ConstDeclNode::):
        (JSC::ConstStatementNode::):
        (JSC::EmptyStatementNode::):
        (JSC::DebuggerStatementNode::):
        (JSC::ExprStatementNode::):
        (JSC::VarStatementNode::):
        (JSC::IfNode::):
        (JSC::IfElseNode::):
        (JSC::DoWhileNode::):
        (JSC::WhileNode::):
        (JSC::ForNode::):
        (JSC::ContinueNode::):
        (JSC::BreakNode::):
        (JSC::ReturnNode::):
        (JSC::WithNode::):
        (JSC::LabelNode::):
        (JSC::ThrowNode::):
        (JSC::TryNode::):
        (JSC::ParameterNode::):
        (JSC::ScopeNode::):
        (JSC::ProgramNode::):
        (JSC::EvalNode::):
        (JSC::FunctionBodyNode::):
        (JSC::FuncExprNode::):
        (JSC::FuncDeclNode::):
        (JSC::CaseClauseNode::):
        (JSC::ClauseListNode::):
        (JSC::CaseBlockNode::):
        (JSC::SwitchNode::):

        WebCore:

        * bindings/js/JSEventTargetBase.h:
        * bindings/js/JSHTMLInputElementBase.cpp:
        * bindings/js/JSHTMLInputElementBase.h:
        * bindings/scripts/CodeGeneratorJS.pm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3f782f6a
2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver Hunt.
Bug 20711: Change KJS prefix on preprocessor macros to JSC
<https://bugs.webkit.org/show_bug.cgi?id=20711>
* kjs/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::CommonIdentifiers):
* kjs/CommonIdentifiers.h:
* kjs/PropertySlot.h:
(JSC::PropertySlot::getValue):
(JSC::PropertySlot::putValue):
(JSC::PropertySlot::setValueSlot):
(JSC::PropertySlot::setValue):
(JSC::PropertySlot::setRegisterSlot):
* kjs/lookup.h:
* kjs/nodes.cpp:
* kjs/nodes.h:
(JSC::Node::):
(JSC::ExpressionNode::):
(JSC::StatementNode::):
(JSC::NullNode::):
(JSC::BooleanNode::):
(JSC::NumberNode::):
(JSC::ImmediateNumberNode::):
(JSC::StringNode::):
(JSC::RegExpNode::):
(JSC::ThisNode::):
(JSC::ResolveNode::):
(JSC::ElementNode::):
(JSC::ArrayNode::):
(JSC::PropertyNode::):
(JSC::PropertyListNode::):
(JSC::ObjectLiteralNode::):
(JSC::BracketAccessorNode::):
(JSC::DotAccessorNode::):
(JSC::ArgumentListNode::):
(JSC::ArgumentsNode::):
(JSC::NewExprNode::):
(JSC::EvalFunctionCallNode::):
(JSC::FunctionCallValueNode::):
(JSC::FunctionCallResolveNode::):
(JSC::FunctionCallBracketNode::):
(JSC::FunctionCallDotNode::):
(JSC::PrePostResolveNode::):
(JSC::PostfixResolveNode::):
(JSC::PostfixBracketNode::):
(JSC::PostfixDotNode::):
(JSC::PostfixErrorNode::):
(JSC::DeleteResolveNode::):
(JSC::DeleteBracketNode::):
(JSC::DeleteDotNode::):
(JSC::DeleteValueNode::):
(JSC::VoidNode::):
(JSC::TypeOfResolveNode::):
(JSC::TypeOfValueNode::):
(JSC::PrefixResolveNode::):
(JSC::PrefixBracketNode::):
(JSC::PrefixDotNode::):
(JSC::PrefixErrorNode::):
(JSC::UnaryPlusNode::):
(JSC::NegateNode::):
(JSC::BitwiseNotNode::):
(JSC::LogicalNotNode::):
(JSC::MultNode::):
(JSC::DivNode::):
(JSC::ModNode::):
(JSC::AddNode::):
(JSC::SubNode::):
(JSC::LeftShiftNode::):
(JSC::RightShiftNode::):
(JSC::UnsignedRightShiftNode::):
(JSC::LessNode::):
(JSC::GreaterNode::):
(JSC::LessEqNode::):
(JSC::GreaterEqNode::):
(JSC::ThrowableBinaryOpNode::):
(JSC::InstanceOfNode::):
(JSC::InNode::):
(JSC::EqualNode::):
(JSC::NotEqualNode::):
(JSC::StrictEqualNode::):
(JSC::NotStrictEqualNode::):
(JSC::BitAndNode::):
(JSC::BitOrNode::):
(JSC::BitXOrNode::):
(JSC::LogicalOpNode::):
(JSC::ConditionalNode::):
(JSC::ReadModifyResolveNode::):
(JSC::AssignResolveNode::):
(JSC::ReadModifyBracketNode::):
(JSC::AssignBracketNode::):
(JSC::AssignDotNode::):
(JSC::ReadModifyDotNode::):
(JSC::AssignErrorNode::):
(JSC::CommaNode::):
(JSC::VarDeclCommaNode::):
(JSC::ConstDeclNode::):
(JSC::ConstStatementNode::):
(JSC::EmptyStatementNode::):
(JSC::DebuggerStatementNode::):
(JSC::ExprStatementNode::):
(JSC::VarStatementNode::):
(JSC::IfNode::):
(JSC::IfElseNode::):
(JSC::DoWhileNode::):
(JSC::WhileNode::):
(JSC::ForNode::):
(JSC::ContinueNode::):
(JSC::BreakNode::):
(JSC::ReturnNode::):
(JSC::WithNode::):
(JSC::LabelNode::):
(JSC::ThrowNode::):
(JSC::TryNode::):
(JSC::ParameterNode::):
(JSC::ScopeNode::):
(JSC::ProgramNode::):
(JSC::EvalNode::):
(JSC::FunctionBodyNode::):
(JSC::FuncExprNode::):
(JSC::FuncDeclNode::):
(JSC::CaseClauseNode::):
(JSC::ClauseListNode::):
(JSC::CaseBlockNode::):
(JSC::SwitchNode::):
2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej Stachowiak.
......
......@@ -31,7 +31,7 @@ CommonIdentifiers::CommonIdentifiers(JSGlobalData* globalData)
: nullIdentifier(globalData, nullCString)
, underscoreProto(globalData, "__proto__")
, thisIdentifier(globalData, "this")
KJS_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PROPERTY_NAME)
JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PROPERTY_NAME)
{
}
......
......@@ -26,7 +26,7 @@
// ArgList of property names, passed to a macro so we can do set them up various
// ways without repeating the list.
#define KJS_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
#define JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
macro(__defineGetter__) \
macro(__defineSetter__) \
macro(__lookupGetter__) \
......@@ -77,9 +77,9 @@ namespace JSC {
const Identifier underscoreProto;
const Identifier thisIdentifier;
#define KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
KJS_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
#undef KJS_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
#define JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL(name) const Identifier name;
JSC_COMMON_IDENTIFIERS_EACH_PROPERTY_NAME(JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL)
#undef JSC_IDENTIFIER_DECLARE_PROPERTY_NAME_GLOBAL
};
} // namespace JSC
......
......@@ -33,8 +33,8 @@ namespace JSC {
class JSObject;
struct HashEntry;
#define KJS_VALUE_SLOT_MARKER 0
#define KJS_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1)
#define JSC_VALUE_SLOT_MARKER 0
#define JSC_REGISTER_SLOT_MARKER reinterpret_cast<GetValueFunc>(1)
class PropertySlot {
public:
......@@ -56,18 +56,18 @@ namespace JSC {
JSValue* getValue(ExecState* exec, const Identifier& propertyName) const
{
if (m_getValue == KJS_VALUE_SLOT_MARKER)
if (m_getValue == JSC_VALUE_SLOT_MARKER)
return *m_data.valueSlot;
if (m_getValue == KJS_REGISTER_SLOT_MARKER)
if (m_getValue == JSC_REGISTER_SLOT_MARKER)
return (*m_data.registerSlot).jsValue(exec);
return m_getValue(exec, propertyName, *this);
}
JSValue* getValue(ExecState* exec, unsigned propertyName) const
{
if (m_getValue == KJS_VALUE_SLOT_MARKER)
if (m_getValue == JSC_VALUE_SLOT_MARKER)
return *m_data.valueSlot;
if (m_getValue == KJS_REGISTER_SLOT_MARKER)
if (m_getValue == JSC_REGISTER_SLOT_MARKER)
return (*m_data.registerSlot).jsValue(exec);
return m_getValue(exec, Identifier::from(exec, propertyName), *this);
}
......@@ -81,18 +81,18 @@ namespace JSC {
void putValue(JSValue* value)
{
if (m_getValue == KJS_VALUE_SLOT_MARKER) {
if (m_getValue == JSC_VALUE_SLOT_MARKER) {
*m_data.valueSlot = value;
return;
}
ASSERT(m_getValue == KJS_REGISTER_SLOT_MARKER);
ASSERT(m_getValue == JSC_REGISTER_SLOT_MARKER);
*m_data.registerSlot = value;
}
void setValueSlot(JSValue** valueSlot)
{
ASSERT(valueSlot);
m_getValue = KJS_VALUE_SLOT_MARKER;
m_getValue = JSC_VALUE_SLOT_MARKER;
clearBase();
m_data.valueSlot = valueSlot;
}
......@@ -100,7 +100,7 @@ namespace JSC {
void setValueSlot(JSValue* slotBase, JSValue** valueSlot)
{
ASSERT(valueSlot);
m_getValue = KJS_VALUE_SLOT_MARKER;
m_getValue = JSC_VALUE_SLOT_MARKER;
m_slotBase = slotBase;
m_data.valueSlot = valueSlot;
}
......@@ -108,7 +108,7 @@ namespace JSC {
void setValueSlot(JSValue* slotBase, JSValue** valueSlot, size_t offset)
{
ASSERT(valueSlot);
m_getValue = KJS_VALUE_SLOT_MARKER;
m_getValue = JSC_VALUE_SLOT_MARKER;
m_slotBase = slotBase;
m_data.valueSlot = valueSlot;
m_offset = offset;
......@@ -117,7 +117,7 @@ namespace JSC {
void setValue(JSValue* value)
{
ASSERT(value);
m_getValue = KJS_VALUE_SLOT_MARKER;
m_getValue = JSC_VALUE_SLOT_MARKER;
clearBase();
m_value = value;
m_data.valueSlot = &m_value;
......@@ -126,7 +126,7 @@ namespace JSC {
void setRegisterSlot(Register* registerSlot)
{
ASSERT(registerSlot);
m_getValue = KJS_REGISTER_SLOT_MARKER;
m_getValue = JSC_REGISTER_SLOT_MARKER;
clearBase();
m_data.registerSlot = registerSlot;
}
......
......@@ -255,15 +255,15 @@ namespace JSC {
* not one in each derived class. So we link the (unique) prototypes between them.
*
* Using those macros is very simple: define the hashtable (e.g. "DOMNodePrototypeTable"), then
* KJS_DEFINE_PROTOTYPE(DOMNodePrototype)
* KJS_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodePrototype, DOMNodePrototypeFunction)
* JSC_DEFINE_PROTOTYPE(DOMNodePrototype)
* JSC_IMPLEMENT_PROTOTYPE("DOMNode", DOMNodePrototype, DOMNodePrototypeFunction)
* and use DOMNodePrototype::self(exec) as prototype in the DOMNode constructor.
* If the prototype has a "parent prototype", e.g. DOMElementPrototype falls back on DOMNodePrototype,
* then the first line will use KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE, with DOMNodePrototype as the second argument.
* then the first line will use JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE, with DOMNodePrototype as the second argument.
*/
// These macros assume that a prototype's only properties are functions
#define KJS_DEFINE_PROTOTYPE(ClassPrototype) \
#define JSC_DEFINE_PROTOTYPE(ClassPrototype) \
class ClassPrototype : public JSC::JSObject { \
public: \
static JSC::JSObject* self(JSC::ExecState* exec); \
......@@ -275,7 +275,7 @@ namespace JSC {
\
};
#define KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(ClassPrototype, ClassPrototypePrototype) \
#define JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE(ClassPrototype, ClassPrototypePrototype) \
class ClassPrototype : public JSC::JSObject { \
public: \
static JSC::JSObject* self(JSC::ExecState* exec); \
......@@ -287,7 +287,7 @@ namespace JSC {
\
};
#define KJS_IMPLEMENT_PROTOTYPE(ClassName, ClassPrototype) \
#define JSC_IMPLEMENT_PROTOTYPE(ClassName, ClassPrototype) \
const ClassInfo ClassPrototype::info = { ClassName"Prototype", 0, &ClassPrototype##Table, 0 }; \
JSObject* ClassPrototype::self(ExecState* exec) \
{ \
......
......@@ -153,7 +153,7 @@ Node::Node(JSGlobalData* globalData, JSType expectedReturn)
m_line = globalData->lexer->lineNo();
}
static void substitute(UString& string, const UString& substring) KJS_FAST_CALL;
static void substitute(UString& string, const UString& substring) JSC_FAST_CALL;
static void substitute(UString& string, const UString& substring)
{
int position = string.find("%s");
......
This diff is collapsed.
2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Oliver Hunt.
Bug 20711: Change KJS prefix on preprocessor macros to JSC
<https://bugs.webkit.org/show_bug.cgi?id=20711>
* bindings/js/JSEventTargetBase.h:
* bindings/js/JSHTMLInputElementBase.cpp:
* bindings/js/JSHTMLInputElementBase.h:
* bindings/scripts/CodeGeneratorJS.pm:
2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
Reviewed by Maciej Stachowiak.
......
......@@ -100,8 +100,8 @@ namespace WebCore {
}
};
// This class is a modified version of the code the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE
// and KJS_IMPLEMENT_PROTOTYPE macros produce - the idea is that classes like JSEventTargetNode
// This class is a modified version of the code the JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE
// and JSC_IMPLEMENT_PROTOTYPE macros produce - the idea is that classes like JSEventTargetNode
// and JSEventTargetSVGElementInstance can share a single prototype just differing in the
// naming "EventTargetNodePrototype" vs "EventTargetSVGElementInstancePrototype". Above mentioned
// macros force the existance of several prototype tables for each of the classes - avoid that.
......
......@@ -48,7 +48,7 @@ namespace WebCore {
@end
*/
KJS_IMPLEMENT_PROTOTYPE("HTMLInputElementBase", JSHTMLInputElementBasePrototype)
JSC_IMPLEMENT_PROTOTYPE("HTMLInputElementBase", JSHTMLInputElementBasePrototype)
// SetSelectionRange is implemented on the class instead of on the prototype
// to make it easier to enable/disable lookup of the function based on input type.
......
......@@ -27,7 +27,7 @@ namespace WebCore {
class HTMLInputElement;
KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(JSHTMLInputElementBasePrototype, JSHTMLElementPrototype)
JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE(JSHTMLInputElementBasePrototype, JSHTMLElementPrototype)
class JSHTMLInputElementBase : public JSHTMLElement {
public:
......
......@@ -636,7 +636,7 @@ sub GenerateHeader
}
push(@headerContent, "\n");
# Add prototype declaration -- code adopted from the KJS_DEFINE_PROTOTYPE and KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macros
# Add prototype declaration -- code adopted from the JSC_DEFINE_PROTOTYPE and JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE macros
push(@headerContent, "class ${className}Prototype : public JSC::JSObject {\n");
push(@headerContent, "public:\n");
if ($interfaceName eq "DOMWindow") {
......
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