Changeset 20310 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Mar 18, 2007, 10:43:47 PM (18 years ago)
Author:
mjs
Message:

JavaScriptCore:

Reviewed by Mark.


  • avoid static construction (and global variable access) in a smarter, more portable way, to later enable MUTLI_THREAD mode to work on other platforms and compilers.


  • kjs/CommonIdentifiers.cpp: Added. New class to hold all the shared identifiers. (KJS::CommonIdentifiers::CommonIdentifiers): (KJS::CommonIdentifiers::shared):
  • kjs/CommonIdentifiers.h: Added.
  • kjs/ExecState.h: (KJS::ExecState::propertyNames): Hand the CommonIdentifiers instance here for easy access. (KJS::ExecState::ExecState):
  • API/JSObjectRef.cpp: (JSObjectMakeConstructor):
  • CMakeLists.txt:
  • JavaScriptCore.exp:
  • JavaScriptCore.pri:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • bindings/runtime_array.cpp: (RuntimeArray::getOwnPropertySlot): (RuntimeArray::put):
  • bindings/runtime_method.cpp: (RuntimeMethod::getOwnPropertySlot):
  • kjs/array_object.cpp: (ArrayInstance::getOwnPropertySlot): (ArrayInstance::put): (ArrayInstance::deleteProperty): (ArrayProtoFunc::ArrayProtoFunc): (ArrayProtoFunc::callAsFunction): (ArrayObjectImp::ArrayObjectImp):
  • kjs/bool_object.cpp: (BooleanPrototype::BooleanPrototype): (BooleanProtoFunc::BooleanProtoFunc): (BooleanProtoFunc::callAsFunction): (BooleanObjectImp::BooleanObjectImp):
  • kjs/completion.h: (KJS::Completion::Completion):
  • kjs/date_object.cpp: (KJS::DateProtoFunc::DateProtoFunc): (KJS::DateObjectImp::DateObjectImp): (KJS::DateObjectFuncImp::DateObjectFuncImp):
  • kjs/error_object.cpp: (ErrorPrototype::ErrorPrototype): (ErrorProtoFunc::ErrorProtoFunc): (ErrorProtoFunc::callAsFunction): (ErrorObjectImp::ErrorObjectImp): (ErrorObjectImp::construct): (NativeErrorPrototype::NativeErrorPrototype): (NativeErrorImp::NativeErrorImp): (NativeErrorImp::construct): (NativeErrorImp::callAsFunction):
  • kjs/function.cpp: (KJS::FunctionImp::getOwnPropertySlot): (KJS::FunctionImp::put): (KJS::FunctionImp::deleteProperty): (KJS::FunctionImp::getParameterName): (KJS::DeclaredFunctionImp::construct): (KJS::IndexToNameMap::unMap): (KJS::Arguments::Arguments): (KJS::ActivationImp::getOwnPropertySlot): (KJS::ActivationImp::deleteProperty): (KJS::GlobalFuncImp::GlobalFuncImp):
  • kjs/function_object.cpp: (FunctionPrototype::FunctionPrototype): (FunctionProtoFunc::FunctionProtoFunc): (FunctionProtoFunc::callAsFunction): (FunctionObjectImp::FunctionObjectImp): (FunctionObjectImp::construct):
  • kjs/grammar.y:
  • kjs/identifier.cpp:
  • kjs/identifier.h:
  • kjs/interpreter.cpp: (KJS::Interpreter::init): (KJS::Interpreter::initGlobalObject):
  • kjs/interpreter.h:
  • kjs/lookup.h:
  • kjs/math_object.cpp: (MathFuncImp::MathFuncImp):
  • kjs/nodes.cpp: (ArrayNode::evaluate): (FuncDeclNode::processFuncDecl): (FuncExprNode::evaluate):
  • kjs/number_object.cpp: (NumberPrototype::NumberPrototype): (NumberProtoFunc::NumberProtoFunc): (NumberObjectImp::NumberObjectImp):
  • kjs/object.cpp: (KJS::JSObject::put): (KJS::JSObject::defaultValue): (KJS::JSObject::hasInstance):
  • kjs/object.h: (KJS::JSObject::getOwnPropertySlot):
  • kjs/object_object.cpp: (ObjectPrototype::ObjectPrototype): (ObjectProtoFunc::ObjectProtoFunc): (ObjectObjectImp::ObjectObjectImp):
  • kjs/regexp_object.cpp: (RegExpPrototype::RegExpPrototype): (RegExpProtoFunc::RegExpProtoFunc): (RegExpObjectImp::RegExpObjectImp):
  • kjs/string_object.cpp: (KJS::StringInstance::getOwnPropertySlot): (KJS::StringInstance::put): (KJS::StringInstance::deleteProperty): (KJS::StringPrototype::StringPrototype): (KJS::StringProtoFunc::StringProtoFunc): (KJS::StringProtoFunc::callAsFunction): (KJS::StringObjectImp::StringObjectImp): (KJS::StringObjectFuncImp::StringObjectFuncImp):
  • kjs/testkjs.cpp: (TestFunctionImp::TestFunctionImp):

WebCore:

Reviewed by Mark.

  • avoid static construction (and global variable access) in a smarter, more portable way, to later enable MUTLI_THREAD mode to work on other platforms and compilers.


  • bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
  • bindings/js/JSHTMLInputElementBase.cpp: (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
  • bindings/js/JSHTMLOptionElementConstructor.cpp: (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
  • bindings/js/JSXMLHttpRequest.cpp: (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
  • bindings/js/JSXSLTProcessor.cpp: (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
  • bindings/js/kjs_dom.cpp: (KJS::DOMNamedNodeMap::getOwnPropertySlot): (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
  • bindings/js/kjs_events.cpp: (KJS::JSAbstractEventListener::handleEvent):
  • bindings/js/kjs_html.cpp: (KJS::HTMLElementFunction::HTMLElementFunction): (KJS::JSHTMLCollection::getOwnPropertySlot):
  • bindings/js/kjs_window.cpp: (KJS::ScheduledAction::execute):
  • bindings/objc/WebScriptObject.mm:
  • bindings/scripts/CodeGeneratorJS.pm:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r20291 r20310  
    446446    array = static_cast<JSObject*>(element->evaluate(exec));
    447447    KJS_CHECKEXCEPTIONVALUE
    448     length = opt ? array->get(exec,lengthPropertyName)->toInt32(exec) : 0;
     448    length = opt ? array->get(exec, exec->propertyNames().length)->toInt32(exec) : 0;
    449449  } else {
    450450    JSValue *newArr = exec->lexicalInterpreter()->builtinArray()->construct(exec,List::empty());
     
    454454
    455455  if (opt)
    456     array->put(exec,lengthPropertyName, jsNumber(elision + length), DontEnum | DontDelete);
     456    array->put(exec, exec->propertyNames().length, jsNumber(elision + length), DontEnum | DontDelete);
    457457
    458458  return array;
     
    23702370
    23712371  JSObject *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
    2372   proto->put(exec, constructorPropertyName, func, ReadOnly|DontDelete|DontEnum);
    2373   func->put(exec, prototypePropertyName, proto, Internal|DontDelete);
     2372  proto->put(exec, exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum);
     2373  func->put(exec, exec->propertyNames().prototype, proto, Internal|DontDelete);
    23742374
    23752375  int plen = 0;
     
    23772377    func->addParameter(p->ident());
    23782378
    2379   func->put(exec, lengthPropertyName, jsNumber(plen), ReadOnly|DontDelete|DontEnum);
     2379  func->put(exec, exec->propertyNames().length, jsNumber(plen), ReadOnly|DontDelete|DontEnum);
    23802380
    23812381  // ECMA 10.2.2
     
    24162416  }
    24172417
    2418   FunctionImp *func = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain());
    2419   JSObject *proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
    2420   proto->put(exec, constructorPropertyName, func, ReadOnly|DontDelete|DontEnum);
    2421   func->put(exec, prototypePropertyName, proto, Internal|DontDelete);
     2418  FunctionImp* func = new DeclaredFunctionImp(exec, ident, body.get(), context->scopeChain());
     2419  JSObject* proto = exec->lexicalInterpreter()->builtinObject()->construct(exec, List::empty());
     2420  proto->put(exec, exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum);
     2421  func->put(exec, exec->propertyNames().prototype, proto, Internal | DontDelete);
    24222422
    24232423  int plen = 0;
Note: See TracChangeset for help on using the changeset viewer.