Changeset 207652 in webkit
- Timestamp:
- Oct 20, 2016 6:33:14 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 11 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r207650 r207652 1 2016-10-20 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Drop isEnvironmentRecord type info flag and use JSType information instead 4 https://bugs.webkit.org/show_bug.cgi?id=163761 5 6 Reviewed by Keith Miller. 7 8 * modules/string-prototype-module-scope.js: Added. 9 (shouldBe): 10 (catch): 11 (refer): 12 * stress/string-prototype-scopes-global-lexical-environment-strict.js: Added. 13 (shouldBe): 14 (catch): 15 * stress/string-prototype-scopes-global-lexical-environment.js: Added. 16 (shouldBe): 17 (catch): 18 * stress/string-prototype-scopes-strict.js: Added. 19 (shouldBe): 20 (catch): 21 (try.refer): 22 (refer): 23 * stress/string-prototype-scopes.js: Added. 24 (shouldBe): 25 (catch): 26 (try.refer): 27 (refer): 28 (object.toString): 29 (with): 30 1 31 2016-10-20 JF Bastien <jfbastien@apple.com> 2 32 -
trunk/LayoutTests/ChangeLog
r207649 r207652 1 2016-10-20 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Drop isEnvironmentRecord type info flag and use JSType information instead 4 https://bugs.webkit.org/show_bug.cgi?id=163761 5 6 Reviewed by Keith Miller. 7 8 * js/dom/script-tests/string-prototype-scopes-in-workers.js: Added. 9 (catch): 10 * js/dom/script-tests/string-prototype-scopes.js: Added. 11 (catch): 12 * js/dom/string-prototype-scopes-expected.txt: Added. 13 * js/dom/string-prototype-scopes-in-workers-expected.txt: Added. 14 * js/dom/string-prototype-scopes-in-workers.html: Added. 15 * js/dom/string-prototype-scopes.html: Added. 16 1 17 2016-10-20 Myles C. Maxfield <mmaxfield@apple.com> 2 18 -
trunk/Source/JavaScriptCore/ChangeLog
r207650 r207652 1 2016-10-20 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC] Drop isEnvironmentRecord type info flag and use JSType information instead 4 https://bugs.webkit.org/show_bug.cgi?id=163761 5 6 Reviewed by Keith Miller. 7 8 When we call a function in the following form, 9 10 var charAt = String.prototype.charAt; 11 charAt(); // |this| becomes the global object. 12 13 we should see |this| as undefined/null. In StringPrototype.cpp, 14 we use IsEnvironmentRecord type info flag to check whther the 15 given |this| is an environment record. 16 However, type info flag is precious thing and only StringPrototype.cpp 17 uses IsEnvironmentRecord. In addition to that, JSType should 18 already knows whether the given object is an environment record. 19 So IsEnvironmentRecord type info flag should be dropped. 20 21 This patch adds a new JSType, StrictEvalActivation. And we add a new 22 method JSObject::isEnvironmentRecord(). This method uses JSType to 23 return the result. And we drop IsEnvironmentRecord type info flag. 24 This patch makes a room for putting one bit flag to the out of line 25 type info flag. Previously, it is already exhausted. 26 27 * llint/LLIntData.cpp: 28 (JSC::LLInt::Data::performAssertions): 29 * llint/LowLevelInterpreter.asm: 30 * runtime/JSObject.h: 31 (JSC::JSObject::isStrictEvalActivation): 32 (JSC::JSObject::isEnvironmentRecord): 33 * runtime/JSSymbolTableObject.h: 34 * runtime/JSType.h: 35 * runtime/JSTypeInfo.h: 36 (JSC::TypeInfo::newImpurePropertyFiresWatchpoints): 37 (JSC::TypeInfo::isEnvironmentRecord): Deleted. 38 * runtime/StrictEvalActivation.h: 39 (JSC::StrictEvalActivation::createStructure): 40 * runtime/StringPrototype.cpp: 41 (JSC::checkObjectCoercible): 42 1 43 2016-10-20 JF Bastien <jfbastien@apple.com> 2 44 -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r207263 r207652 162 162 STATIC_ASSERT(ArrayType == 31); 163 163 STATIC_ASSERT(DerivedArrayType == 32); 164 STATIC_ASSERT(ProxyObjectType == 49);164 STATIC_ASSERT(ProxyObjectType == 50); 165 165 STATIC_ASSERT(Int8ArrayType == 33); 166 166 STATIC_ASSERT(Int16ArrayType == 34); -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r207263 r207652 351 351 const ArrayType = 31 352 352 const DerivedArrayType = 32 353 const ProxyObjectType = 49353 const ProxyObjectType = 50 354 354 355 355 # The typed array types need to be numbered in a particular order because of the manually written -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r207411 r207652 707 707 JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow); 708 708 709 bool isEnvironmentRecord() const; 709 710 bool isGlobalObject() const; 710 711 bool isJSLexicalEnvironment() const; 711 712 bool isGlobalLexicalEnvironment() const; 713 bool isStrictEvalActivation() const; 714 bool isWithScope() const; 715 712 716 bool isErrorInstance() const; 713 bool isWithScope() const;714 717 715 718 JS_EXPORT_PRIVATE void seal(VM&); … … 1174 1177 { 1175 1178 return type() == GlobalLexicalEnvironmentType; 1179 } 1180 1181 inline bool JSObject::isStrictEvalActivation() const 1182 { 1183 return type() == StrictEvalActivationType; 1184 } 1185 1186 inline bool JSObject::isEnvironmentRecord() const 1187 { 1188 bool result = GlobalObjectType <= type() && type() <= StrictEvalActivationType; 1189 ASSERT((isGlobalObject() || isJSLexicalEnvironment() || isGlobalLexicalEnvironment() || isStrictEvalActivation()) == result); 1190 return result; 1176 1191 } 1177 1192 -
trunk/Source/JavaScriptCore/runtime/JSSymbolTableObject.h
r207411 r207652 40 40 public: 41 41 typedef JSScope Base; 42 static const unsigned StructureFlags = Base::StructureFlags | IsEnvironmentRecord |OverridesGetPropertyNames;42 static const unsigned StructureFlags = Base::StructureFlags | OverridesGetPropertyNames; 43 43 44 44 SymbolTable* symbolTable() const { return m_symbolTable.get(); } -
trunk/Source/JavaScriptCore/runtime/JSType.h
r207239 r207652 78 78 79 79 GetterSetterType, 80 81 // Start environment record types. 80 82 GlobalObjectType, 81 83 LexicalEnvironmentType, 82 84 GlobalLexicalEnvironmentType, 83 85 ModuleEnvironmentType, 86 StrictEvalActivationType, 87 // End environment record types. 88 84 89 RegExpObjectType, 85 90 ProxyObjectType, -
trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h
r207625 r207652 49 49 static const unsigned GetOwnPropertySlotIsImpure = 1 << 11; 50 50 static const unsigned NewImpurePropertyFiresWatchpoints = 1 << 12; 51 static const unsigned IsEnvironmentRecord = 1 << 13;52 51 static const unsigned GetOwnPropertySlotIsImpureForPropertyAbsence = 1 << 14; 53 52 static const unsigned InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero = 1 << 15; … … 91 90 bool getOwnPropertySlotIsImpureForPropertyAbsence() const { return isSetOnFlags2(GetOwnPropertySlotIsImpureForPropertyAbsence); } 92 91 bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); } 93 bool isEnvironmentRecord() const { return isSetOnFlags2(IsEnvironmentRecord); }94 92 bool interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero() const { return isSetOnFlags2(InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero); } 95 93 -
trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.h
r206525 r207652 33 33 public: 34 34 typedef JSScope Base; 35 static const unsigned StructureFlags = Base::StructureFlags | IsEnvironmentRecord |OverridesToThis;35 static const unsigned StructureFlags = Base::StructureFlags | OverridesToThis; 36 36 37 37 static StrictEvalActivation* create(ExecState* exec, JSScope* currentScope) … … 47 47 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) 48 48 { 49 return Structure::create(vm, globalObject, prototype, TypeInfo( ObjectType, StructureFlags), info());49 return Structure::create(vm, globalObject, prototype, TypeInfo(StrictEvalActivationType, StructureFlags), info()); 50 50 } 51 51 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r206804 r207652 747 747 return false; 748 748 749 if (thisValue.is Cell() && thisValue.asCell()->structure()->typeInfo().isEnvironmentRecord())749 if (thisValue.isObject() && asObject(thisValue)->isEnvironmentRecord()) 750 750 return false; 751 751
Note: See TracChangeset
for help on using the changeset viewer.