Ignore:
Timestamp:
Feb 6, 2018, 2:42:26 PM (7 years ago)
Author:
[email protected]
Message:

put_to_scope/get_from_scope should not cache lexical scopes when expecting a global object
https://bugs.webkit.org/show_bug.cgi?id=182549
<rdar://problem/36189995>

Reviewed by Saam Barati.

JSTests:

  • stress/var-injection-cache-invalidation.js: Added.

(allocateLotsOfThings):
(test):

Source/JavaScriptCore:

Previously, the llint/baseline caching for put_to_scope and
get_from_scope would cache lexical environments when the
varInjectionWatchpoint had been fired for global properties. Code
in the DFG does not follow this same assumption so we could
potentially return the wrong result. Additionally, the baseline
would write barrier the global object rather than the lexical
enviroment object. This patch makes it so that we do not cache
anything other than the global object for when the resolve type is
GlobalPropertyWithVarInjectionChecks or GlobalProperty.

  • assembler/MacroAssembler.cpp:

(JSC::MacroAssembler::jitAssert):

  • assembler/MacroAssembler.h:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::tryCachePutToScopeGlobal):
(JSC::CommonSlowPaths::tryCacheGetFromScopeGlobal):

  • runtime/Options.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/MacroAssembler.cpp

    r222871 r228193  
    2929#if ENABLE(ASSEMBLER)
    3030
     31#include "Options.h"
    3132#include "ProbeContext.h"
    3233#include <wtf/PrintStream.h>
     34#include <wtf/ScopedLambda.h>
    3335
    3436namespace JSC {
    3537
    3638const double MacroAssembler::twoToThe32 = (double)0x100000000ull;
     39
     40void MacroAssembler::jitAssert(const ScopedLambda<Jump(void)>& functor)
     41{
     42    if (Options::enableJITDebugAssetions()) {
     43        Jump passed = functor();
     44        breakpoint();
     45        passed.link(this);
     46    }
     47}
    3748
    3849#if ENABLE(MASM_PROBE)
Note: See TracChangeset for help on using the changeset viewer.