Ignore:
Timestamp:
Oct 20, 2016, 6:33:14 PM (9 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Drop isEnvironmentRecord type info flag and use JSType information instead
https://bugs.webkit.org/show_bug.cgi?id=163761

Reviewed by Keith Miller.

JSTests:

  • modules/string-prototype-module-scope.js: Added.

(shouldBe):
(catch):
(refer):

  • stress/string-prototype-scopes-global-lexical-environment-strict.js: Added.

(shouldBe):
(catch):

  • stress/string-prototype-scopes-global-lexical-environment.js: Added.

(shouldBe):
(catch):

  • stress/string-prototype-scopes-strict.js: Added.

(shouldBe):
(catch):
(try.refer):
(refer):

  • stress/string-prototype-scopes.js: Added.

(shouldBe):
(catch):
(try.refer):
(refer):
(object.toString):
(with):

Source/JavaScriptCore:

When we call a function in the following form,

var charAt = String.prototype.charAt;
charAt(); |this| becomes the global object.

we should see |this| as undefined/null. In StringPrototype.cpp,
we use IsEnvironmentRecord type info flag to check whther the
given |this| is an environment record.
However, type info flag is precious thing and only StringPrototype.cpp
uses IsEnvironmentRecord. In addition to that, JSType should
already knows whether the given object is an environment record.
So IsEnvironmentRecord type info flag should be dropped.

This patch adds a new JSType, StrictEvalActivation. And we add a new
method JSObject::isEnvironmentRecord(). This method uses JSType to
return the result. And we drop IsEnvironmentRecord type info flag.
This patch makes a room for putting one bit flag to the out of line
type info flag. Previously, it is already exhausted.

  • llint/LLIntData.cpp:

(JSC::LLInt::Data::performAssertions):

  • llint/LowLevelInterpreter.asm:
  • runtime/JSObject.h:

(JSC::JSObject::isStrictEvalActivation):
(JSC::JSObject::isEnvironmentRecord):

  • runtime/JSSymbolTableObject.h:
  • runtime/JSType.h:
  • runtime/JSTypeInfo.h:

(JSC::TypeInfo::newImpurePropertyFiresWatchpoints):
(JSC::TypeInfo::isEnvironmentRecord): Deleted.

  • runtime/StrictEvalActivation.h:

(JSC::StrictEvalActivation::createStructure):

  • runtime/StringPrototype.cpp:

(JSC::checkObjectCoercible):

LayoutTests:

  • js/dom/script-tests/string-prototype-scopes-in-workers.js: Added.

(catch):

  • js/dom/script-tests/string-prototype-scopes.js: Added.

(catch):

  • js/dom/string-prototype-scopes-expected.txt: Added.
  • js/dom/string-prototype-scopes-in-workers-expected.txt: Added.
  • js/dom/string-prototype-scopes-in-workers.html: Added.
  • js/dom/string-prototype-scopes.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h

    r207411 r207652  
    4040public:
    4141    typedef JSScope Base;
    42     static const unsigned StructureFlags = Base::StructureFlags | IsEnvironmentRecord | OverridesGetPropertyNames;
     42    static const unsigned StructureFlags = Base::StructureFlags | OverridesGetPropertyNames;
    4343   
    4444    SymbolTable* symbolTable() const { return m_symbolTable.get(); }
Note: See TracChangeset for help on using the changeset viewer.