Ignore:
Timestamp:
Aug 19, 2014, 7:38:46 PM (11 years ago)
Author:
[email protected]
Message:

REGRESSION(r172401): for-in optimization no longer works at all
https://bugs.webkit.org/show_bug.cgi?id=136056

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Roll this back in, along with a fix to make proxies work. Previously, for-in over proxies
would instacrash every time.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitGetByVal):
(JSC::BytecodeGenerator::pushIndexedForInScope):
(JSC::BytecodeGenerator::pushStructureForInScope):

  • bytecompiler/BytecodeGenerator.h:

(JSC::ForInContext::ForInContext):
(JSC::StructureForInContext::StructureForInContext):
(JSC::IndexedForInContext::IndexedForInContext):
(JSC::ForInContext::base): Deleted.

  • bytecompiler/NodesCodegen.cpp:

(JSC::ForInNode::emitMultiLoopBytecode):

  • runtime/JSProxy.cpp:

(JSC::JSProxy::getStructurePropertyNames):
(JSC::JSProxy::getGenericPropertyNames):

  • tests/stress/for-in-base-reassigned-later-and-change-structure.js: Added.

(foo):

  • tests/stress/for-in-base-reassigned-later.js: Added.

(foo):

  • tests/stress/for-in-base-reassigned.js: Added.

(foo):

  • tests/stress/for-in-proxy-target-changed-structure.js: Added.

(deleteAll):
(foo):

  • tests/stress/for-in-proxy.js: Added.

(foo):

LayoutTests:

This just needs a rebase because the number of calls into the DOM has changed and so the
number of console messages about security stuff has now changed.

  • http/tests/security/cross-frame-access-enumeration-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r172742 r172794  
    20712071        this->emitLoopHeader(generator, propertyName.get());
    20722072
    2073         generator.pushIndexedForInScope(base.get(), local.get(), i.get());
     2073        generator.pushIndexedForInScope(local.get(), i.get());
    20742074        generator.emitNode(dst, m_statement);
    20752075        generator.popIndexedForInScope(local.get());
     
    21052105        this->emitLoopHeader(generator, propertyName.get());
    21062106
    2107         generator.pushStructureForInScope(base.get(), local.get(), i.get(), propertyName.get(), structureEnumerator.get());
     2107        generator.pushStructureForInScope(local.get(), i.get(), propertyName.get(), structureEnumerator.get());
    21082108        generator.emitNode(dst, m_statement);
    21092109        generator.popStructureForInScope(local.get());
Note: See TracChangeset for help on using the changeset viewer.