Ignore:
Timestamp:
Aug 14, 2017, 4:37:06 PM (8 years ago)
Author:
[email protected]
Message:

JSTests:
Support the with keyword in DFG
https://bugs.webkit.org/show_bug.cgi?id=175470

Patch by Robin Morisset <[email protected]> on 2017-08-14
Reviewed by Saam Barati.

Added a new stress-test for the 'with' keyword, that caught a bug in a
previous version of this code.

  • stress/with.js: Added.

(i.with):

Source/JavaScriptCore:
Support the 'with' keyword in DFG
https://bugs.webkit.org/show_bug.cgi?id=175470

Patch by Robin Morisset <[email protected]> on 2017-08-14
Reviewed by Saam Barati.

Not particularly optimized at the moment, the goal is just to avoid
the DFG bailing out of any function with this keyword.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGByteCodeParser.cpp:

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

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::capabilityLevel):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGNodeType.h:
  • dfg/DFGPredictionPropagationPhase.cpp:
  • dfg/DFGSafeToExecute.h:

(JSC::DFG::safeToExecute):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compilePushWithScope):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):

  • dfg/DFGSpeculativeJIT32_64.cpp:

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

  • dfg/DFGSpeculativeJIT64.cpp:

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

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r220471 r220724  
    5858#include "JSLexicalEnvironment.h"
    5959#include "JSPropertyNameEnumerator.h"
     60#include "JSWithScope.h"
    6061#include "ModuleProgramCodeBlock.h"
    6162#include "ObjectConstructor.h"
     
    19961997}
    19971998
     1999JSCell* JIT_OPERATION operationPushWithScope(ExecState* exec, JSCell* currentScopeCell, EncodedJSValue scopeObjectValue)
     2000{
     2001    VM& vm = exec->vm();
     2002    NativeCallFrameTracer tracer(&vm, exec);
     2003    auto scope = DECLARE_THROW_SCOPE(vm);
     2004
     2005    JSObject* newScope = JSValue::decode(scopeObjectValue).toObject(exec);
     2006    RETURN_IF_EXCEPTION(scope, nullptr);
     2007
     2008    JSScope* currentScope = jsCast<JSScope*>(currentScopeCell);
     2009
     2010    return JSWithScope::create(vm, exec->lexicalGlobalObject(), newScope, currentScope);
     2011}
     2012
    19982013EncodedJSValue JIT_OPERATION operationInstanceOf(ExecState* exec, EncodedJSValue encodedValue, EncodedJSValue encodedProto)
    19992014{
Note: See TracChangeset for help on using the changeset viewer.