Ignore:
Timestamp:
Jan 12, 2012, 5:40:22 PM (14 years ago)
Author:
[email protected]
Message:

Clean up putDirect (part 1)
https://bugs.webkit.org/show_bug.cgi?id=76232

Reviewed by Sam Weinig.

putDirect has ambiguous semantics, clean these up a bit.

putDirect generally behaves a bit like a fast defineOwnProperty, but one that
always creates the property, with no checking to validate the put it permitted.

It also encompasses two slightly different behaviors.
(1) a fast form of put for JSActivation, which doesn't have to handle searching

the prototype chain, getter/setter properties, or the magic proto value.
Break this out as a new method, 'putOwnDataProperty'.

(2) the version of putDirect on JSValue will also check for overwriting ReadOnly

values, in strict mode. This is, however, not so smart on a few level, since
it is only called from op_put_by_id with direct set, which is only used with
an object as the base, and is only used to put new properties onto objects.

  • dfg/DFGOperations.cpp:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::put):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnPropertySlot):

  • runtime/JSObject.h:

(JSC::JSObject::putOwnDataProperty):

  • runtime/JSValue.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r103697 r104886  
    185185    // expose in the activation object.
    186186    ASSERT(!thisObject->hasGetterSetterProperties());
    187     thisObject->putDirect(exec->globalData(), propertyName, value, 0, true, slot);
     187    thisObject->putOwnDataProperty(exec->globalData(), propertyName, value, slot);
    188188}
    189189
Note: See TracChangeset for help on using the changeset viewer.