Changeset 259835 in webkit
- Timestamp:
- Apr 9, 2020 3:49:01 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r259828 r259835 1 2020-04-09 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] ModuleEnvironment do not have JSGlobalLexicalEnvironment as its upper scope 4 https://bugs.webkit.org/show_bug.cgi?id=193347 5 6 Reviewed by Tadeu Zagallo. 7 8 * stress/global-lexical-environment-access-from-module.js: Added. 9 (shouldBe): 10 (import.string_appeared_here.then): 11 * stress/resources/global-lexical-environment-access-from-module-child.js: Added. 12 (export.read): 13 (export.write): 14 1 15 2020-04-09 Yusuke Suzuki <ysuzuki@apple.com> 2 16 -
trunk/LayoutTests/imported/w3c/ChangeLog
r259773 r259835 1 2020-04-09 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] ModuleEnvironment do not have JSGlobalLexicalEnvironment as its upper scope 4 https://bugs.webkit.org/show_bug.cgi?id=193347 5 6 Reviewed by Tadeu Zagallo. 7 8 * web-platform-tests/html/semantics/scripting-1/the-script-element/module/inline-async-execorder-expected.txt: 9 1 10 2020-04-08 Chris Dumez <cdumez@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/inline-async-execorder-expected.txt
r249886 r259835 1 CONSOLE MESSAGE: line 1: ReferenceError: Can't find variable: loaded2 CONSOLE MESSAGE: line 1: ReferenceError: Can't find variable: loaded3 CONSOLE MESSAGE: line 3: ReferenceError: Can't find variable: loaded4 CONSOLE MESSAGE: line 3: ReferenceError: Can't find variable: loaded5 1 6 Harness Error (FAIL), message = ReferenceError: Can't find variable: loaded 2 PASS Inline async module script execution order 7 3 8 FAIL Inline async module script execution order assert_array_equals: lengths differ, expected 6 got 09 -
trunk/Source/JavaScriptCore/ChangeLog
r259822 r259835 1 2020-04-09 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] ModuleEnvironment do not have JSGlobalLexicalEnvironment as its upper scope 4 https://bugs.webkit.org/show_bug.cgi?id=193347 5 6 Reviewed by Tadeu Zagallo. 7 8 The upper scope of module scope should be global lexical environment instead of global object. 9 This patch fixes it to allow modules to access global lexical environment's variables. 10 11 * bytecode/CodeBlock.cpp: 12 (JSC::CodeBlock::notifyLexicalBindingUpdate): 13 * dfg/DFGByteCodeParser.cpp: 14 (JSC::DFG::ByteCodeParser::parseBlock): 15 * runtime/JSModuleEnvironment.h: 16 * runtime/JSModuleRecord.cpp: 17 (JSC::JSModuleRecord::instantiateDeclarations): 18 1 19 2020-04-09 Alexey Shvayka <shvaikalesh@gmail.com> 2 20 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r259676 r259835 2885 2885 void CodeBlock::notifyLexicalBindingUpdate() 2886 2886 { 2887 // FIXME: Currently, module code do not query to JSGlobalLexicalEnvironment. So this case should be removed once it is fixed.2888 // https://bugs.webkit.org/show_bug.cgi?id=1933472889 if (scriptMode() == JSParserScriptMode::Module)2890 return;2891 2887 JSGlobalObject* globalObject = m_globalObject.get(); 2892 2888 JSGlobalLexicalEnvironment* globalLexicalEnvironment = jsCast<JSGlobalLexicalEnvironment*>(globalObject->globalScope()); -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r259676 r259835 6678 6678 m_graph.watchpoints().addLazily(m_inlineStackTop->m_codeBlock->globalObject()->varInjectionWatchpoint()); 6679 6679 6680 // FIXME: Currently, module code do not query to JSGlobalLexicalEnvironment. So this case should be removed once it is fixed. 6681 // https://bugs.webkit.org/show_bug.cgi?id=193347 6682 if (m_inlineStackTop->m_codeBlock->scriptMode() != JSParserScriptMode::Module) { 6683 if (resolveType == GlobalProperty || resolveType == GlobalPropertyWithVarInjectionChecks) { 6684 JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject(); 6685 unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[bytecode.m_var]; 6686 if (!m_graph.watchGlobalProperty(globalObject, identifierNumber)) 6687 addToGraph(ForceOSRExit); 6688 } 6680 if (resolveType == GlobalProperty || resolveType == GlobalPropertyWithVarInjectionChecks) { 6681 JSGlobalObject* globalObject = m_inlineStackTop->m_codeBlock->globalObject(); 6682 unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[bytecode.m_var]; 6683 if (!m_graph.watchGlobalProperty(globalObject, identifierNumber)) 6684 addToGraph(ForceOSRExit); 6689 6685 } 6690 6686 … … 6794 6790 case GlobalProperty: 6795 6791 case GlobalPropertyWithVarInjectionChecks: { 6796 // FIXME: Currently, module code do not query to JSGlobalLexicalEnvironment. So this case should be removed once it is fixed. 6797 // https://bugs.webkit.org/show_bug.cgi?id=193347 6798 if (m_inlineStackTop->m_codeBlock->scriptMode() != JSParserScriptMode::Module) { 6799 if (!m_graph.watchGlobalProperty(globalObject, identifierNumber)) 6800 addToGraph(ForceOSRExit); 6801 } 6792 if (!m_graph.watchGlobalProperty(globalObject, identifierNumber)) 6793 addToGraph(ForceOSRExit); 6802 6794 6803 6795 SpeculatedType prediction = getPrediction(); … … 6971 6963 case GlobalProperty: 6972 6964 case GlobalPropertyWithVarInjectionChecks: { 6973 // FIXME: Currently, module code do not query to JSGlobalLexicalEnvironment. So this case should be removed once it is fixed. 6974 // https://bugs.webkit.org/show_bug.cgi?id=193347 6975 if (m_inlineStackTop->m_codeBlock->scriptMode() != JSParserScriptMode::Module) { 6976 if (!m_graph.watchGlobalProperty(globalObject, identifierNumber)) 6977 addToGraph(ForceOSRExit); 6978 } 6965 if (!m_graph.watchGlobalProperty(globalObject, identifierNumber)) 6966 addToGraph(ForceOSRExit); 6979 6967 6980 6968 PutByIdStatus status; -
trunk/Source/JavaScriptCore/runtime/JSModuleEnvironment.h
r257399 r259835 43 43 static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames; 44 44 45 static JSModuleEnvironment* create(VM&, Structure*, JSScope*, SymbolTable*, JSValue initialValue, AbstractModuleRecord*);46 47 45 static JSModuleEnvironment* create(VM& vm, JSGlobalObject* globalObject, JSScope* currentScope, SymbolTable* symbolTable, JSValue initialValue, AbstractModuleRecord* moduleRecord) 48 46 { … … 83 81 JSModuleEnvironment(VM&, Structure*, JSScope*, SymbolTable*); 84 82 83 static JSModuleEnvironment* create(VM&, Structure*, JSScope*, SymbolTable*, JSValue initialValue, AbstractModuleRecord*); 84 85 85 void finishCreation(VM&, JSValue initialValue, AbstractModuleRecord*); 86 86 -
trunk/Source/JavaScriptCore/runtime/JSModuleRecord.cpp
r251425 r259835 104 104 105 105 SymbolTable* symbolTable = moduleProgramExecutable->moduleEnvironmentSymbolTable(); 106 JSModuleEnvironment* moduleEnvironment = JSModuleEnvironment::create(vm, globalObject, globalObject , symbolTable, jsTDZValue(), this);106 JSModuleEnvironment* moduleEnvironment = JSModuleEnvironment::create(vm, globalObject, globalObject->globalLexicalEnvironment(), symbolTable, jsTDZValue(), this); 107 107 108 108 // http://www.ecma-international.org/ecma-262/6.0/#sec-moduledeclarationinstantiation
Note: See TracChangeset
for help on using the changeset viewer.