Ignore:
Timestamp:
Jul 22, 2011, 3:08:52 PM (14 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=65047
DFG JIT - Add support for op_resolve/op_resolve_base

Reviewed by Sam Weinig.

These are necessary for any significant eval code coverage
(and as such increase LayoutTest coverage).

  • dfg/DFGAliasTracker.h:

(JSC::DFG::AliasTracker::recordResolve):

  • Conservatively blow aliasing optimizations for now.
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • Add support for op_resolve/op_resolve_base.
  • dfg/DFGJITCodeGenerator.h:

(JSC::DFG::JITCodeGenerator::callOperation):

  • Add call with exec, identifer aguments.
  • dfg/DFGNode.h:
    • Add new node types.

(JSC::DFG::Node::hasIdentifier):

  • Resolve nodes have identifiers, too!
  • dfg/DFGNonSpeculativeJIT.cpp:

(JSC::DFG::NonSpeculativeJIT::compile):

  • Add generation for new Nodes.
  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
    • Added new operations.
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • Add generation for new Nodes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r91482 r91607  
    624624}
    625625
     626EncodedJSValue operationResolve(ExecState* exec, Identifier* propertyName)
     627{
     628    ScopeChainNode* scopeChain = exec->scopeChain();
     629    ScopeChainIterator iter = scopeChain->begin();
     630    ScopeChainIterator end = scopeChain->end();
     631    ASSERT(iter != end);
     632
     633    do {
     634        JSObject* record = iter->get();
     635        PropertySlot slot(record);
     636        if (record->getPropertySlot(exec, *propertyName, slot))
     637            return JSValue::encode(slot.getValue(exec, *propertyName));
     638    } while (++iter != end);
     639
     640    return throwVMError(exec, createUndefinedVariableError(exec, *propertyName));
     641}
     642
     643EncodedJSValue operationResolveBase(ExecState* exec, Identifier* propertyName)
     644{
     645    return JSValue::encode(resolveBase(exec, *propertyName, exec->scopeChain(), false));
     646}
     647
     648EncodedJSValue operationResolveBaseStrictPut(ExecState* exec, Identifier* propertyName)
     649{
     650    JSValue base = resolveBase(exec, *propertyName, exec->scopeChain(), true);
     651    if (!base)
     652        throwError(exec, createErrorForInvalidGlobalAssignment(exec, propertyName->ustring()));
     653    return JSValue::encode(base);
     654}
     655
    626656void operationThrowHasInstanceError(ExecState* exec, EncodedJSValue encodedBase)
    627657{
    628658    JSValue base = JSValue::decode(encodedBase);
    629659
    630 #ifndef NDEBUG
    631660    // We should only call this function if base is not an object, or if it does not implement 'HasInstance'.
    632     TypeInfo typeInfo(UnspecifiedType);
    633     ASSERT(!base.isObject() || !(typeInfo = asObject(base)->structure()->typeInfo()).implementsHasInstance());
    634 #endif
     661    ASSERT(!base.isObject() || !asObject(base)->structure()->typeInfo().implementsHasInstance());
    635662
    636663    throwError(exec, createInvalidParamError(exec, "instanceof", base));
Note: See TracChangeset for help on using the changeset viewer.