Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jun 2016 04:30:57 +0000 (04:30 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jun 2016 04:30:57 +0000 (04:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158249

Source/JavaScriptCore:

* API/JSScriptRef.cpp:
(parseScript):
* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/AsyncFunctionPrototype.js: Removed.
(asyncFunctionResume): Deleted.
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutable):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset): Deleted.
(JSC::computeDefsForBytecodeOffset): Deleted.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::dumpBytecode): Deleted.
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::isArrowFunction):
(JSC::UnlinkedCodeBlock::isOrdinaryArrowFunction): Deleted.
(JSC::UnlinkedCodeBlock::isAsyncArrowFunction): Deleted.
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::fromGlobalCode):
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitNewArrowFunctionExpression):
(JSC::BytecodeGenerator::emitNewMethodDefinition):
(JSC::BytecodeGenerator::emitLoadArrowFunctionLexicalEnvironment):
(JSC::BytecodeGenerator::emitNewFunctionExpressionCommon): Deleted.
(JSC::BytecodeGenerator::emitNewFunction): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionNode::emitBytecode): Deleted.
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::parse):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass): Deleted.
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emitNewFuncCommon): Deleted.
(JSC::JIT::emit_op_new_async_func): Deleted.
(JSC::JIT::emitNewFuncExprCommon): Deleted.
(JSC::JIT::emit_op_new_async_func_exp): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jsc.cpp:
(runInteractive):
(printUsageStatement): Deleted.
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL): Deleted.
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createAsyncFunctionBody): Deleted.
* parser/Keywords.table:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::isArrowFunctionParameters):
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseImportClauseItem):
(JSC::Parser<LexerType>::parseImportDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):
(JSC::Parser<LexerType>::printUnexpectedTokenText):
(JSC::Parser<LexerType>::parseAsyncFunctionSourceElements): Deleted.
(JSC::Parser<LexerType>::parseVariableDeclarationList): Deleted.
(JSC::Parser<LexerType>::parseDestructuringPattern): Deleted.
(JSC::Parser<LexerType>::parseFunctionDeclarationStatement): Deleted.
(JSC::Parser<LexerType>::parseFormalParameters): Deleted.
(JSC::stringForFunctionMode): Deleted.
(JSC::Parser<LexerType>::parseAsyncFunctionDeclaration): Deleted.
(JSC::Parser<LexerType>::parseExpressionOrLabelStatement): Deleted.
(JSC::Parser<LexerType>::parseAwaitExpression): Deleted.
(JSC::Parser<LexerType>::parseAsyncFunctionExpression): Deleted.
(JSC::Parser<LexerType>::parseUnaryExpression): Deleted.
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Parser::ExpressionErrorClassifier::propagateExpressionErrorClass):
(JSC::Parser::closestParentOrdinaryFunctionNonLexicalScope):
(JSC::Parser::pushScope):
(JSC::Parser::popScopeInternal):
(JSC::Parser::matchSpecIdentifier):
(JSC::parse):
(JSC::Scope::setSourceParseMode): Deleted.
(JSC::Scope::isAsyncFunction): Deleted.
(JSC::Scope::isAsyncFunctionBoundary): Deleted.
(JSC::Scope::isModule): Deleted.
(JSC::Scope::setIsFunction): Deleted.
(JSC::Scope::setIsAsyncArrowFunction): Deleted.
(JSC::Scope::setIsAsyncFunction): Deleted.
(JSC::Scope::setIsAsyncFunctionBody): Deleted.
(JSC::Scope::setIsAsyncArrowFunctionBody): Deleted.
(JSC::Parser::ExpressionErrorClassifier::forceClassifyExpressionError): Deleted.
(JSC::Parser::ExpressionErrorClassifier::indicatesPossibleAsyncArrowFunction): Deleted.
(JSC::Parser::forceClassifyExpressionError): Deleted.
(JSC::Parser::declarationTypeToVariableKind): Deleted.
(JSC::Parser::upperScope): Deleted.
(JSC::Parser::isDisallowedIdentifierAwait): Deleted.
(JSC::Parser::disallowedIdentifierAwaitReason): Deleted.
* parser/ParserModes.h:
(JSC::isFunctionParseMode):
(JSC::isModuleParseMode):
(JSC::isProgramParseMode):
(JSC::SourceParseModeSet::SourceParseModeSet): Deleted.
(JSC::SourceParseModeSet::contains): Deleted.
(JSC::SourceParseModeSet::mergeSourceParseModes): Deleted.
(JSC::isAsyncFunctionParseMode): Deleted.
(JSC::isAsyncArrowFunctionParseMode): Deleted.
(JSC::isAsyncFunctionWrapperParseMode): Deleted.
(JSC::isAsyncFunctionBodyParseMode): Deleted.
(JSC::constructAbilityForParseMode): Deleted.
* parser/ParserTokens.h:
* parser/SourceCodeKey.h:
(JSC::SourceCodeKey::SourceCodeKey):
(JSC::SourceCodeKey::operator==):
(JSC::SourceCodeKey::runtimeFlags): Deleted.
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createAsyncFunctionBody): Deleted.
* runtime/AsyncFunctionConstructor.cpp: Removed.
(JSC::AsyncFunctionConstructor::AsyncFunctionConstructor): Deleted.
(JSC::AsyncFunctionConstructor::finishCreation): Deleted.
(JSC::callAsyncFunctionConstructor): Deleted.
(JSC::constructAsyncFunctionConstructor): Deleted.
(JSC::AsyncFunctionConstructor::getCallData): Deleted.
(JSC::AsyncFunctionConstructor::getConstructData): Deleted.
* runtime/AsyncFunctionConstructor.h: Removed.
(JSC::AsyncFunctionConstructor::create): Deleted.
(JSC::AsyncFunctionConstructor::createStructure): Deleted.
* runtime/AsyncFunctionPrototype.cpp: Removed.
(JSC::AsyncFunctionPrototype::AsyncFunctionPrototype): Deleted.
(JSC::AsyncFunctionPrototype::finishCreation): Deleted.
* runtime/AsyncFunctionPrototype.h: Removed.
(JSC::AsyncFunctionPrototype::create): Deleted.
(JSC::AsyncFunctionPrototype::createStructure): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getProgramCodeBlock):
(JSC::CodeCache::getEvalCodeBlock):
(JSC::CodeCache::getModuleProgramCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:
* runtime/CommonIdentifiers.h:
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
* runtime/Completion.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::ProgramExecutable::checkSyntax):
* runtime/Executable.h:
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionConstructor.h:
* runtime/JSAsyncFunction.cpp: Removed.
(JSC::JSAsyncFunction::JSAsyncFunction): Deleted.
(JSC::JSAsyncFunction::createImpl): Deleted.
(JSC::JSAsyncFunction::create): Deleted.
(JSC::JSAsyncFunction::createWithInvalidatedReallocationWatchpoint): Deleted.
* runtime/JSAsyncFunction.h: Removed.
(JSC::JSAsyncFunction::allocationSize): Deleted.
(JSC::JSAsyncFunction::createStructure): Deleted.
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createProgramCodeBlock):
(JSC::JSGlobalObject::createEvalCodeBlock):
(JSC::JSGlobalObject::createModuleProgramCodeBlock):
(JSC::JSGlobalObject::init): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::asyncFunctionPrototype): Deleted.
(JSC::JSGlobalObject::asyncFunctionStructure): Deleted.
* runtime/ModuleLoaderObject.cpp:
(JSC::moduleLoaderObjectParseModule):
* runtime/RuntimeFlags.h:
(JSC::RuntimeFlags::operator==): Deleted.
(JSC::RuntimeFlags::operator!=): Deleted.
* tests/stress/async-await-basic.js: Removed.
(shouldBe): Deleted.
(shouldBeAsync): Deleted.
(shouldThrow): Deleted.
(shouldThrowAsync): Deleted.
(shouldThrowSyntaxError): Deleted.
(let.AsyncFunction.async): Deleted.
(async.asyncFunctionForProto): Deleted.
(Object.getPrototypeOf.async): Deleted.
(Object.getPrototypeOf.async.method): Deleted.
(async): Deleted.
(async.method): Deleted.
(async.asyncNonConstructorDecl): Deleted.
(shouldThrow.new.async): Deleted.
(shouldThrow.new.async.nonConstructor): Deleted.
(async.asyncDecl): Deleted.
(async.f): Deleted.
(MyError): Deleted.
(async.asyncDeclThrower): Deleted.
(shouldThrowAsync.async): Deleted.
(resolveLater): Deleted.
(rejectLater): Deleted.
(async.resumeAfterNormal): Deleted.
(O.async.resumeAfterNormal): Deleted.
(resumeAfterNormalArrow.async): Deleted.
(async.resumeAfterThrow): Deleted.
(O.async.resumeAfterThrow): Deleted.
(resumeAfterThrowArrow.async): Deleted.
(catch): Deleted.
* tests/stress/async-await-module-reserved-word.js: Removed.
(shouldThrow): Deleted.
(SyntaxError.Canstring_appeared_hereawait.checkModuleSyntaxError.String.raw.await): Deleted.
(checkModuleSyntaxError.String.raw.await): Deleted.
(checkModuleSyntaxError.String.raw.async.await): Deleted.
(SyntaxError.Cannot.declare.named): Deleted.
* tests/stress/async-await-mozilla.js: Removed.
(shouldBe): Deleted.
(shouldBeAsync): Deleted.
(shouldThrow): Deleted.
(shouldThrowAsync): Deleted.
(assert): Deleted.
(shouldThrowSyntaxError): Deleted.
(mozSemantics.async.empty): Deleted.
(mozSemantics.async.simpleReturn): Deleted.
(mozSemantics.async.simpleAwait): Deleted.
(mozSemantics.async.simpleAwaitAsync): Deleted.
(mozSemantics.async.returnOtherAsync): Deleted.
(mozSemantics.async.simpleThrower): Deleted.
(mozSemantics.async.delegatedThrower): Deleted.
(mozSemantics.async.tryCatch): Deleted.
(mozSemantics.async.tryCatchThrow): Deleted.
(mozSemantics.async.wellFinally): Deleted.
(mozSemantics.async.finallyMayFail): Deleted.
(mozSemantics.async.embedded.async.inner): Deleted.
(mozSemantics.async.embedded): Deleted.
(mozSemantics.async.fib): Deleted.
(mozSemantics.async.isOdd.async.isEven): Deleted.
(mozSemantics.async.isOdd): Deleted.
(mozSemantics.hardcoreFib.async.fib2): Deleted.
(mozSemantics.namedAsyncExpr.async.simple): Deleted.
(mozSemantics.async.executionOrder.async.first): Deleted.
(mozSemantics.async.executionOrder.async.second): Deleted.
(mozSemantics.async.executionOrder.async.third): Deleted.
(mozSemantics.async.executionOrder): Deleted.
(mozSemantics.async.miscellaneous): Deleted.
(mozSemantics.thrower): Deleted.
(mozSemantics.async.defaultArgs): Deleted.
(mozSemantics.shouldThrow): Deleted.
(mozSemantics): Deleted.
(mozMethods.X): Deleted.
(mozMethods.X.prototype.async.getValue): Deleted.
(mozMethods.X.prototype.setValue): Deleted.
(mozMethods.X.prototype.async.increment): Deleted.
(mozMethods.X.prototype.async.getBaseClassName): Deleted.
(mozMethods.X.async.getStaticValue): Deleted.
(mozMethods.Y.prototype.async.getBaseClassName): Deleted.
(mozMethods.Y): Deleted.
(mozFunctionNameInferrence.async.test): Deleted.
(mozSyntaxErrors): Deleted.
* tests/stress/async-await-reserved-word.js: Removed.
(assert): Deleted.
(shouldThrowSyntaxError): Deleted.
(AsyncFunction.async): Deleted.
* tests/stress/async_arrow_functions_lexical_arguments_binding.js: Removed.
(shouldBe): Deleted.
(shouldBeAsync): Deleted.
(shouldThrowAsync): Deleted.
(noArgumentsArrow2.async): Deleted.
* tests/stress/async_arrow_functions_lexical_new.target_binding.js: Removed.
(shouldBe): Deleted.
(shouldBeAsync): Deleted.
(shouldThrowAsync): Deleted.
(C1): Deleted.
(C2): Deleted.
(shouldThrowAsync.async): Deleted.
* tests/stress/async_arrow_functions_lexical_super_binding.js: Removed.
(shouldBe): Deleted.
(shouldBeAsync): Deleted.
(BaseClass.prototype.baseClassValue): Deleted.
(BaseClass.prototype.get property): Deleted.
(BaseClass): Deleted.
(ChildClass.prototype.asyncSuperProp): Deleted.
(ChildClass.prototype.asyncSuperProp2): Deleted.
(ChildClass): Deleted.
(ChildClass2): Deleted.
* tests/stress/async_arrow_functions_lexical_this_binding.js: Removed.
(shouldBe): Deleted.
(shouldBeAsync): Deleted.
(d.y): Deleted.

Source/WebKit/mac:

* WebView/WebPreferencesPrivate.h:

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:

Source/WebKit2:

* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201542 268f45cc-cd09-0410-ab3c-d52691b4dbfc

69 files changed:
Source/JavaScriptCore/API/JSScriptRef.cpp
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/AsyncFunctionPrototype.js [deleted file]
Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
Source/JavaScriptCore/bytecode/BytecodeList.json
Source/JavaScriptCore/bytecode/BytecodeUseDef.h
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h
Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/JIT.h
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/jit/JITOperations.h
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/llint/LLIntSlowPaths.h
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/parser/ASTBuilder.h
Source/JavaScriptCore/parser/Keywords.table
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/Parser.h
Source/JavaScriptCore/parser/ParserModes.h
Source/JavaScriptCore/parser/ParserTokens.h
Source/JavaScriptCore/parser/SourceCodeKey.h
Source/JavaScriptCore/parser/SyntaxChecker.h
Source/JavaScriptCore/runtime/AsyncFunctionConstructor.cpp [deleted file]
Source/JavaScriptCore/runtime/AsyncFunctionConstructor.h [deleted file]
Source/JavaScriptCore/runtime/AsyncFunctionPrototype.cpp [deleted file]
Source/JavaScriptCore/runtime/AsyncFunctionPrototype.h [deleted file]
Source/JavaScriptCore/runtime/CodeCache.cpp
Source/JavaScriptCore/runtime/CodeCache.h
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/Completion.cpp
Source/JavaScriptCore/runtime/Completion.h
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/Executable.h
Source/JavaScriptCore/runtime/FunctionConstructor.cpp
Source/JavaScriptCore/runtime/FunctionConstructor.h
Source/JavaScriptCore/runtime/JSAsyncFunction.cpp [deleted file]
Source/JavaScriptCore/runtime/JSAsyncFunction.h [deleted file]
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/ModuleLoaderObject.cpp
Source/JavaScriptCore/runtime/RuntimeFlags.h
Source/JavaScriptCore/tests/stress/async-await-basic.js [deleted file]
Source/JavaScriptCore/tests/stress/async-await-module-reserved-word.js [deleted file]
Source/JavaScriptCore/tests/stress/async-await-mozilla.js [deleted file]
Source/JavaScriptCore/tests/stress/async-await-reserved-word.js [deleted file]
Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_arguments_binding.js [deleted file]
Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_new.target_binding.js [deleted file]
Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_super_binding.js [deleted file]
Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_this_binding.js [deleted file]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h

index fca31f0..60bde60 100644 (file)
@@ -75,7 +75,7 @@ private:
 static bool parseScript(VM* vm, const SourceCode& source, ParserError& error)
 {
     return !!JSC::parse<JSC::ProgramNode>(
-        vm, RuntimeFlags(), source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+        vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
         JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, SuperBinding::NotNeeded,
         error);
 }
index 61ab6f5..24a0b66 100644 (file)
@@ -608,8 +608,6 @@ set(JavaScriptCore_SOURCES
     runtime/ArrayConstructor.cpp
     runtime/ArrayIteratorPrototype.cpp
     runtime/ArrayPrototype.cpp
-    runtime/AsyncFunctionConstructor.cpp
-    runtime/AsyncFunctionPrototype.cpp
     runtime/BasicBlockLocation.cpp
     runtime/BooleanConstructor.cpp
     runtime/BooleanObject.cpp
@@ -684,7 +682,6 @@ set(JavaScriptCore_SOURCES
     runtime/JSArrayBufferPrototype.cpp
     runtime/JSArrayBufferView.cpp
     runtime/JSArrayIterator.cpp
-    runtime/JSAsyncFunction.cpp
     runtime/JSBoundFunction.cpp
     runtime/JSBoundSlotBaseFunction.cpp
     runtime/JSCJSValue.cpp
@@ -1213,7 +1210,6 @@ set(JavaScriptCore_BUILTINS_SOURCES
     ${JAVASCRIPTCORE_DIR}/builtins/ArrayConstructor.js
     ${JAVASCRIPTCORE_DIR}/builtins/ArrayIteratorPrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/ArrayPrototype.js
-    ${JAVASCRIPTCORE_DIR}/builtins/AsyncFunctionPrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/DatePrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/FunctionPrototype.js
     ${JAVASCRIPTCORE_DIR}/builtins/GeneratorPrototype.js
index 4dcfb6a..8808371 100644 (file)
@@ -1,3 +1,308 @@
+2016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
+        https://bugs.webkit.org/show_bug.cgi?id=158249
+
+        * API/JSScriptRef.cpp:
+        (parseScript):
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * builtins/AsyncFunctionPrototype.js: Removed.
+        (asyncFunctionResume): Deleted.
+        * builtins/BuiltinExecutables.cpp:
+        (JSC::BuiltinExecutables::createExecutable):
+        * bytecode/BytecodeList.json:
+        * bytecode/BytecodeUseDef.h:
+        (JSC::computeUsesForBytecodeOffset): Deleted.
+        (JSC::computeDefsForBytecodeOffset): Deleted.
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::finishCreation):
+        (JSC::CodeBlock::dumpBytecode): Deleted.
+        * bytecode/UnlinkedCodeBlock.h:
+        (JSC::UnlinkedCodeBlock::isArrowFunction):
+        (JSC::UnlinkedCodeBlock::isOrdinaryArrowFunction): Deleted.
+        (JSC::UnlinkedCodeBlock::isAsyncArrowFunction): Deleted.
+        * bytecode/UnlinkedFunctionExecutable.cpp:
+        (JSC::generateUnlinkedFunctionCodeBlock):
+        (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
+        (JSC::UnlinkedFunctionExecutable::fromGlobalCode):
+        (JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
+        * bytecode/UnlinkedFunctionExecutable.h:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        (JSC::BytecodeGenerator::emitNewArrowFunctionExpression):
+        (JSC::BytecodeGenerator::emitNewMethodDefinition):
+        (JSC::BytecodeGenerator::emitLoadArrowFunctionLexicalEnvironment):
+        (JSC::BytecodeGenerator::emitNewFunctionExpressionCommon): Deleted.
+        (JSC::BytecodeGenerator::emitNewFunction): Deleted.
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::BytecodeGenerator::makeFunction):
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::FunctionNode::emitBytecode): Deleted.
+        * inspector/agents/InspectorRuntimeAgent.cpp:
+        (Inspector::InspectorRuntimeAgent::parse):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompileMainPass): Deleted.
+        * jit/JIT.h:
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emitNewFuncCommon): Deleted.
+        (JSC::JIT::emit_op_new_async_func): Deleted.
+        (JSC::JIT::emitNewFuncExprCommon): Deleted.
+        (JSC::JIT::emit_op_new_async_func_exp): Deleted.
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * jsc.cpp:
+        (runInteractive):
+        (printUsageStatement): Deleted.
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL): Deleted.
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter.asm:
+        * parser/ASTBuilder.h:
+        (JSC::ASTBuilder::createAsyncFunctionBody): Deleted.
+        * parser/Keywords.table:
+        * parser/Parser.cpp:
+        (JSC::Parser<LexerType>::Parser):
+        (JSC::Parser<LexerType>::parseInner):
+        (JSC::Parser<LexerType>::isArrowFunctionParameters):
+        (JSC::Parser<LexerType>::parseStatementListItem):
+        (JSC::Parser<LexerType>::parseStatement):
+        (JSC::Parser<LexerType>::parseFunctionParameters):
+        (JSC::Parser<LexerType>::parseFunctionInfo):
+        (JSC::Parser<LexerType>::parseClass):
+        (JSC::Parser<LexerType>::parseImportClauseItem):
+        (JSC::Parser<LexerType>::parseImportDeclaration):
+        (JSC::Parser<LexerType>::parseExportDeclaration):
+        (JSC::Parser<LexerType>::parseAssignmentExpression):
+        (JSC::Parser<LexerType>::parseProperty):
+        (JSC::Parser<LexerType>::parsePropertyMethod):
+        (JSC::Parser<LexerType>::parsePrimaryExpression):
+        (JSC::Parser<LexerType>::parseMemberExpression):
+        (JSC::Parser<LexerType>::parseArrowFunctionExpression):
+        (JSC::Parser<LexerType>::printUnexpectedTokenText):
+        (JSC::Parser<LexerType>::parseAsyncFunctionSourceElements): Deleted.
+        (JSC::Parser<LexerType>::parseVariableDeclarationList): Deleted.
+        (JSC::Parser<LexerType>::parseDestructuringPattern): Deleted.
+        (JSC::Parser<LexerType>::parseFunctionDeclarationStatement): Deleted.
+        (JSC::Parser<LexerType>::parseFormalParameters): Deleted.
+        (JSC::stringForFunctionMode): Deleted.
+        (JSC::Parser<LexerType>::parseAsyncFunctionDeclaration): Deleted.
+        (JSC::Parser<LexerType>::parseExpressionOrLabelStatement): Deleted.
+        (JSC::Parser<LexerType>::parseAwaitExpression): Deleted.
+        (JSC::Parser<LexerType>::parseAsyncFunctionExpression): Deleted.
+        (JSC::Parser<LexerType>::parseUnaryExpression): Deleted.
+        * parser/Parser.h:
+        (JSC::Scope::Scope):
+        (JSC::Parser::ExpressionErrorClassifier::propagateExpressionErrorClass):
+        (JSC::Parser::closestParentOrdinaryFunctionNonLexicalScope):
+        (JSC::Parser::pushScope):
+        (JSC::Parser::popScopeInternal):
+        (JSC::Parser::matchSpecIdentifier):
+        (JSC::parse):
+        (JSC::Scope::setSourceParseMode): Deleted.
+        (JSC::Scope::isAsyncFunction): Deleted.
+        (JSC::Scope::isAsyncFunctionBoundary): Deleted.
+        (JSC::Scope::isModule): Deleted.
+        (JSC::Scope::setIsFunction): Deleted.
+        (JSC::Scope::setIsAsyncArrowFunction): Deleted.
+        (JSC::Scope::setIsAsyncFunction): Deleted.
+        (JSC::Scope::setIsAsyncFunctionBody): Deleted.
+        (JSC::Scope::setIsAsyncArrowFunctionBody): Deleted.
+        (JSC::Parser::ExpressionErrorClassifier::forceClassifyExpressionError): Deleted.
+        (JSC::Parser::ExpressionErrorClassifier::indicatesPossibleAsyncArrowFunction): Deleted.
+        (JSC::Parser::forceClassifyExpressionError): Deleted.
+        (JSC::Parser::declarationTypeToVariableKind): Deleted.
+        (JSC::Parser::upperScope): Deleted.
+        (JSC::Parser::isDisallowedIdentifierAwait): Deleted.
+        (JSC::Parser::disallowedIdentifierAwaitReason): Deleted.
+        * parser/ParserModes.h:
+        (JSC::isFunctionParseMode):
+        (JSC::isModuleParseMode):
+        (JSC::isProgramParseMode):
+        (JSC::SourceParseModeSet::SourceParseModeSet): Deleted.
+        (JSC::SourceParseModeSet::contains): Deleted.
+        (JSC::SourceParseModeSet::mergeSourceParseModes): Deleted.
+        (JSC::isAsyncFunctionParseMode): Deleted.
+        (JSC::isAsyncArrowFunctionParseMode): Deleted.
+        (JSC::isAsyncFunctionWrapperParseMode): Deleted.
+        (JSC::isAsyncFunctionBodyParseMode): Deleted.
+        (JSC::constructAbilityForParseMode): Deleted.
+        * parser/ParserTokens.h:
+        * parser/SourceCodeKey.h:
+        (JSC::SourceCodeKey::SourceCodeKey):
+        (JSC::SourceCodeKey::operator==):
+        (JSC::SourceCodeKey::runtimeFlags): Deleted.
+        * parser/SyntaxChecker.h:
+        (JSC::SyntaxChecker::createAsyncFunctionBody): Deleted.
+        * runtime/AsyncFunctionConstructor.cpp: Removed.
+        (JSC::AsyncFunctionConstructor::AsyncFunctionConstructor): Deleted.
+        (JSC::AsyncFunctionConstructor::finishCreation): Deleted.
+        (JSC::callAsyncFunctionConstructor): Deleted.
+        (JSC::constructAsyncFunctionConstructor): Deleted.
+        (JSC::AsyncFunctionConstructor::getCallData): Deleted.
+        (JSC::AsyncFunctionConstructor::getConstructData): Deleted.
+        * runtime/AsyncFunctionConstructor.h: Removed.
+        (JSC::AsyncFunctionConstructor::create): Deleted.
+        (JSC::AsyncFunctionConstructor::createStructure): Deleted.
+        * runtime/AsyncFunctionPrototype.cpp: Removed.
+        (JSC::AsyncFunctionPrototype::AsyncFunctionPrototype): Deleted.
+        (JSC::AsyncFunctionPrototype::finishCreation): Deleted.
+        * runtime/AsyncFunctionPrototype.h: Removed.
+        (JSC::AsyncFunctionPrototype::create): Deleted.
+        (JSC::AsyncFunctionPrototype::createStructure): Deleted.
+        * runtime/CodeCache.cpp:
+        (JSC::CodeCache::getGlobalCodeBlock):
+        (JSC::CodeCache::getProgramCodeBlock):
+        (JSC::CodeCache::getEvalCodeBlock):
+        (JSC::CodeCache::getModuleProgramCodeBlock):
+        (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
+        * runtime/CodeCache.h:
+        * runtime/CommonIdentifiers.h:
+        * runtime/Completion.cpp:
+        (JSC::checkSyntax):
+        (JSC::checkModuleSyntax):
+        * runtime/Completion.h:
+        * runtime/Executable.cpp:
+        (JSC::ScriptExecutable::newCodeBlockFor):
+        (JSC::ProgramExecutable::checkSyntax):
+        * runtime/Executable.h:
+        * runtime/FunctionConstructor.cpp:
+        (JSC::constructFunctionSkippingEvalEnabledCheck):
+        * runtime/FunctionConstructor.h:
+        * runtime/JSAsyncFunction.cpp: Removed.
+        (JSC::JSAsyncFunction::JSAsyncFunction): Deleted.
+        (JSC::JSAsyncFunction::createImpl): Deleted.
+        (JSC::JSAsyncFunction::create): Deleted.
+        (JSC::JSAsyncFunction::createWithInvalidatedReallocationWatchpoint): Deleted.
+        * runtime/JSAsyncFunction.h: Removed.
+        (JSC::JSAsyncFunction::allocationSize): Deleted.
+        (JSC::JSAsyncFunction::createStructure): Deleted.
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::getOwnPropertySlot):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::createProgramCodeBlock):
+        (JSC::JSGlobalObject::createEvalCodeBlock):
+        (JSC::JSGlobalObject::createModuleProgramCodeBlock):
+        (JSC::JSGlobalObject::init): Deleted.
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::asyncFunctionPrototype): Deleted.
+        (JSC::JSGlobalObject::asyncFunctionStructure): Deleted.
+        * runtime/ModuleLoaderObject.cpp:
+        (JSC::moduleLoaderObjectParseModule):
+        * runtime/RuntimeFlags.h:
+        (JSC::RuntimeFlags::operator==): Deleted.
+        (JSC::RuntimeFlags::operator!=): Deleted.
+        * tests/stress/async-await-basic.js: Removed.
+        (shouldBe): Deleted.
+        (shouldBeAsync): Deleted.
+        (shouldThrow): Deleted.
+        (shouldThrowAsync): Deleted.
+        (shouldThrowSyntaxError): Deleted.
+        (let.AsyncFunction.async): Deleted.
+        (async.asyncFunctionForProto): Deleted.
+        (Object.getPrototypeOf.async): Deleted.
+        (Object.getPrototypeOf.async.method): Deleted.
+        (async): Deleted.
+        (async.method): Deleted.
+        (async.asyncNonConstructorDecl): Deleted.
+        (shouldThrow.new.async): Deleted.
+        (shouldThrow.new.async.nonConstructor): Deleted.
+        (async.asyncDecl): Deleted.
+        (async.f): Deleted.
+        (MyError): Deleted.
+        (async.asyncDeclThrower): Deleted.
+        (shouldThrowAsync.async): Deleted.
+        (resolveLater): Deleted.
+        (rejectLater): Deleted.
+        (async.resumeAfterNormal): Deleted.
+        (O.async.resumeAfterNormal): Deleted.
+        (resumeAfterNormalArrow.async): Deleted.
+        (async.resumeAfterThrow): Deleted.
+        (O.async.resumeAfterThrow): Deleted.
+        (resumeAfterThrowArrow.async): Deleted.
+        (catch): Deleted.
+        * tests/stress/async-await-module-reserved-word.js: Removed.
+        (shouldThrow): Deleted.
+        (SyntaxError.Canstring_appeared_hereawait.checkModuleSyntaxError.String.raw.await): Deleted.
+        (checkModuleSyntaxError.String.raw.await): Deleted.
+        (checkModuleSyntaxError.String.raw.async.await): Deleted.
+        (SyntaxError.Cannot.declare.named): Deleted.
+        * tests/stress/async-await-mozilla.js: Removed.
+        (shouldBe): Deleted.
+        (shouldBeAsync): Deleted.
+        (shouldThrow): Deleted.
+        (shouldThrowAsync): Deleted.
+        (assert): Deleted.
+        (shouldThrowSyntaxError): Deleted.
+        (mozSemantics.async.empty): Deleted.
+        (mozSemantics.async.simpleReturn): Deleted.
+        (mozSemantics.async.simpleAwait): Deleted.
+        (mozSemantics.async.simpleAwaitAsync): Deleted.
+        (mozSemantics.async.returnOtherAsync): Deleted.
+        (mozSemantics.async.simpleThrower): Deleted.
+        (mozSemantics.async.delegatedThrower): Deleted.
+        (mozSemantics.async.tryCatch): Deleted.
+        (mozSemantics.async.tryCatchThrow): Deleted.
+        (mozSemantics.async.wellFinally): Deleted.
+        (mozSemantics.async.finallyMayFail): Deleted.
+        (mozSemantics.async.embedded.async.inner): Deleted.
+        (mozSemantics.async.embedded): Deleted.
+        (mozSemantics.async.fib): Deleted.
+        (mozSemantics.async.isOdd.async.isEven): Deleted.
+        (mozSemantics.async.isOdd): Deleted.
+        (mozSemantics.hardcoreFib.async.fib2): Deleted.
+        (mozSemantics.namedAsyncExpr.async.simple): Deleted.
+        (mozSemantics.async.executionOrder.async.first): Deleted.
+        (mozSemantics.async.executionOrder.async.second): Deleted.
+        (mozSemantics.async.executionOrder.async.third): Deleted.
+        (mozSemantics.async.executionOrder): Deleted.
+        (mozSemantics.async.miscellaneous): Deleted.
+        (mozSemantics.thrower): Deleted.
+        (mozSemantics.async.defaultArgs): Deleted.
+        (mozSemantics.shouldThrow): Deleted.
+        (mozSemantics): Deleted.
+        (mozMethods.X): Deleted.
+        (mozMethods.X.prototype.async.getValue): Deleted.
+        (mozMethods.X.prototype.setValue): Deleted.
+        (mozMethods.X.prototype.async.increment): Deleted.
+        (mozMethods.X.prototype.async.getBaseClassName): Deleted.
+        (mozMethods.X.async.getStaticValue): Deleted.
+        (mozMethods.Y.prototype.async.getBaseClassName): Deleted.
+        (mozMethods.Y): Deleted.
+        (mozFunctionNameInferrence.async.test): Deleted.
+        (mozSyntaxErrors): Deleted.
+        * tests/stress/async-await-reserved-word.js: Removed.
+        (assert): Deleted.
+        (shouldThrowSyntaxError): Deleted.
+        (AsyncFunction.async): Deleted.
+        * tests/stress/async_arrow_functions_lexical_arguments_binding.js: Removed.
+        (shouldBe): Deleted.
+        (shouldBeAsync): Deleted.
+        (shouldThrowAsync): Deleted.
+        (noArgumentsArrow2.async): Deleted.
+        * tests/stress/async_arrow_functions_lexical_new.target_binding.js: Removed.
+        (shouldBe): Deleted.
+        (shouldBeAsync): Deleted.
+        (shouldThrowAsync): Deleted.
+        (C1): Deleted.
+        (C2): Deleted.
+        (shouldThrowAsync.async): Deleted.
+        * tests/stress/async_arrow_functions_lexical_super_binding.js: Removed.
+        (shouldBe): Deleted.
+        (shouldBeAsync): Deleted.
+        (BaseClass.prototype.baseClassValue): Deleted.
+        (BaseClass.prototype.get property): Deleted.
+        (BaseClass): Deleted.
+        (ChildClass.prototype.asyncSuperProp): Deleted.
+        (ChildClass.prototype.asyncSuperProp2): Deleted.
+        (ChildClass): Deleted.
+        (ChildClass2): Deleted.
+        * tests/stress/async_arrow_functions_lexical_this_binding.js: Removed.
+        (shouldBe): Deleted.
+        (shouldBeAsync): Deleted.
+        (d.y): Deleted.
+
 2016-05-31  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r201363 and r201456.
index 17b43f6..72e41f4 100644 (file)
@@ -84,7 +84,6 @@ JavaScriptCore_BUILTINS_SOURCES = \
     $(JavaScriptCore)/builtins/ArrayConstructor.js \
     $(JavaScriptCore)/builtins/ArrayIteratorPrototype.js \
     $(JavaScriptCore)/builtins/ArrayPrototype.js \
-    $(JavaScriptCore)/builtins/AsyncFunctionPrototype.js \
     $(JavaScriptCore)/builtins/DatePrototype.js \
     $(JavaScriptCore)/builtins/FunctionPrototype.js \
     $(JavaScriptCore)/builtins/GeneratorPrototype.js \
index 4060d99..aefe234 100644 (file)
                53529A4C1C457B75000B49C6 /* APIUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 53529A4B1C457B75000B49C6 /* APIUtils.h */; };
                5370B4F51BF26202005C40FC /* AdaptiveInferredPropertyValueWatchpointBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5370B4F31BF25EA2005C40FC /* AdaptiveInferredPropertyValueWatchpointBase.cpp */; };
                5370B4F61BF26205005C40FC /* AdaptiveInferredPropertyValueWatchpointBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5370B4F41BF25EA2005C40FC /* AdaptiveInferredPropertyValueWatchpointBase.h */; };
-               5BD3A0671CAE325700F84BA3 /* AsyncFunctionConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BD3A0611CAE325700F84BA3 /* AsyncFunctionConstructor.cpp */; };
-               5BD3A0681CAE325700F84BA3 /* AsyncFunctionConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 5BD3A0621CAE325700F84BA3 /* AsyncFunctionConstructor.h */; };
-               5BD3A0691CAE325700F84BA3 /* AsyncFunctionPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BD3A0631CAE325700F84BA3 /* AsyncFunctionPrototype.cpp */; };
-               5BD3A06A1CAE325700F84BA3 /* AsyncFunctionPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 5BD3A0641CAE325700F84BA3 /* AsyncFunctionPrototype.h */; };
-               5BD3A06B1CAE325700F84BA3 /* JSAsyncFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5BD3A0651CAE325700F84BA3 /* JSAsyncFunction.cpp */; };
-               5BD3A06E1CAE35BF00F84BA3 /* JSAsyncFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 5BD3A06D1CAE35BF00F84BA3 /* JSAsyncFunction.h */; };
                53917E7B1B7906FA000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53917E7A1B7906E4000EBD33 /* JSGenericTypedArrayViewPrototypeFunctions.h */; };
                53F6BF6D1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 53F6BF6C1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5D5D8AD10E0D0EBE00F9C692 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
                53F256E11B87E28000B4B768 /* JSTypedArrayViewPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypedArrayViewPrototype.cpp; sourceTree = "<group>"; };
                53F6BF6C1C3F060A00F41E5D /* InternalFunctionAllocationProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InternalFunctionAllocationProfile.h; sourceTree = "<group>"; };
                593D43CCA0BBE06D89C59707 /* MapDataInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MapDataInlines.h; sourceTree = "<group>"; };
-               5BD3A0611CAE325700F84BA3 /* AsyncFunctionConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncFunctionConstructor.cpp; sourceTree = "<group>"; };
-               5BD3A0621CAE325700F84BA3 /* AsyncFunctionConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFunctionConstructor.h; sourceTree = "<group>"; };
-               5BD3A0631CAE325700F84BA3 /* AsyncFunctionPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AsyncFunctionPrototype.cpp; sourceTree = "<group>"; };
-               5BD3A0641CAE325700F84BA3 /* AsyncFunctionPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFunctionPrototype.h; sourceTree = "<group>"; };
-               5BD3A0651CAE325700F84BA3 /* JSAsyncFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAsyncFunction.cpp; sourceTree = "<group>"; };
-               5BD3A06D1CAE35BF00F84BA3 /* JSAsyncFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAsyncFunction.h; sourceTree = "<group>"; };
-               5BF474881CB1C5DB0002BAD7 /* AsyncFunctionPrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = AsyncFunctionPrototype.js; sourceTree = "<group>"; };
                5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = "<absolute>"; };
                5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = JSC.xcconfig; sourceTree = "<group>"; };
                5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; };
                                F692A84D0255597D01FF60F7 /* ArrayPrototype.cpp */,
                                F692A84E0255597D01FF60F7 /* ArrayPrototype.h */,
                                0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */,
-                               5BD3A0611CAE325700F84BA3 /* AsyncFunctionConstructor.cpp */,
-                               5BD3A0621CAE325700F84BA3 /* AsyncFunctionConstructor.h */,
-                               5BD3A0631CAE325700F84BA3 /* AsyncFunctionPrototype.cpp */,
-                               5BD3A0641CAE325700F84BA3 /* AsyncFunctionPrototype.h */,
                                52678F8C1A031009006A306D /* BasicBlockLocation.cpp */,
                                52678F8D1A031009006A306D /* BasicBlockLocation.h */,
                                147B83AA0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h */,
                                0F2B66BC17B6B5AB00A7AE3F /* JSArrayBufferViewInlines.h */,
                                A7BDAEC417F4EA1400F6140C /* JSArrayIterator.cpp */,
                                A7BDAEC517F4EA1400F6140C /* JSArrayIterator.h */,
-                               5BD3A0651CAE325700F84BA3 /* JSAsyncFunction.cpp */,
-                               5BD3A06D1CAE35BF00F84BA3 /* JSAsyncFunction.h */,
                                86FA9E8F142BBB2D001773B7 /* JSBoundFunction.cpp */,
                                86FA9E90142BBB2E001773B7 /* JSBoundFunction.h */,
                                46D4DCBB1C5AB2D500D8D321 /* JSBoundSlotBaseFunction.cpp */,
                A7D8019F1880D66E0026C39B /* builtins */ = {
                        isa = PBXGroup;
                        children = (
-                               5BF474881CB1C5DB0002BAD7 /* AsyncFunctionPrototype.js */,
                                A7D801A01880D66E0026C39B /* ArrayPrototype.js */,
                                7CF9BC581B65D9A3009DB1EF /* ArrayConstructor.js */,
                                7CF9BC591B65D9A3009DB1EF /* ArrayIteratorPrototype.js */,
                                0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
                                0F2B66DF17B6B5AB00A7AE3F /* DataView.h in Headers */,
                                BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
-                               5BD3A0681CAE325700F84BA3 /* AsyncFunctionConstructor.h in Headers */,
                                996B731A1BDA08D100331B84 /* DateConstructor.lut.h in Headers */,
                                41359CF30FDD89AD00206180 /* DateConversion.h in Headers */,
                                BC1166020E1997B4008066DD /* DateInstance.h in Headers */,
                                FE187A0D1C030D5C0038BBCA /* JITDivGenerator.h in Headers */,
                                2AD8932B17E3868F00668276 /* HeapIterationScope.h in Headers */,
                                A5339EC91BB4B4600054F005 /* HeapObserver.h in Headers */,
-                               5BD3A06A1CAE325700F84BA3 /* AsyncFunctionPrototype.h in Headers */,
                                2A6F462617E959CE00C45C98 /* HeapOperation.h in Headers */,
                                14F97447138C853E00DA1C67 /* HeapRootVisitor.h in Headers */,
                                C24D31E3161CD695002AA4DB /* HeapStatistics.h in Headers */,
                                A7B601821639FD2A00372BA3 /* UnlinkedCodeBlock.h in Headers */,
                                14142E511B796ECE00F4BF4B /* UnlinkedFunctionExecutable.h in Headers */,
                                0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */,
-                               5BD3A06E1CAE35BF00F84BA3 /* JSAsyncFunction.h in Headers */,
                                99DA00B11BD5994E00F4575C /* UpdateContents.py in Headers */,
                                0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
                                0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
                                0FEC858B1BDACDC70080FF74 /* AirStackSlot.cpp in Sources */,
                                0FEC858D1BDACDC70080FF74 /* AirTmp.cpp in Sources */,
                                0FEC85901BDACDC70080FF74 /* AirValidate.cpp in Sources */,
-                               5BD3A06B1CAE325700F84BA3 /* JSAsyncFunction.cpp in Sources */,
                                147F39BD107EC37600427A48 /* ArgList.cpp in Sources */,
                                0F743BAA16B88249009F9277 /* ARM64Disassembler.cpp in Sources */,
                                86D3B2C310156BDE002865E7 /* ARMAssembler.cpp in Sources */,
                                0FF729AE166AD35C000F5BA3 /* ProfilerBytecodes.cpp in Sources */,
                                0F13912916771C33009CCB07 /* ProfilerBytecodeSequence.cpp in Sources */,
                                0FF729AF166AD35C000F5BA3 /* ProfilerCompilation.cpp in Sources */,
-                               5BD3A0671CAE325700F84BA3 /* AsyncFunctionConstructor.cpp in Sources */,
                                0FF729B0166AD35C000F5BA3 /* ProfilerCompilationKind.cpp in Sources */,
                                0FF729B1166AD35C000F5BA3 /* ProfilerCompiledBytecode.cpp in Sources */,
                                0FF729B2166AD35C000F5BA3 /* ProfilerDatabase.cpp in Sources */,
                                0F919D2515853CE0004A4E7D /* Watchpoint.cpp in Sources */,
                                1ACF7377171CA6FB00C9BB1E /* Weak.cpp in Sources */,
                                14E84F9E14EE1ACC00D6D5D4 /* WeakBlock.cpp in Sources */,
-                               5BD3A0691CAE325700F84BA3 /* AsyncFunctionPrototype.cpp in Sources */,
                                14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */,
                                A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */,
                                0F338DF91BE96AA80013C88F /* B3CCallValue.cpp in Sources */,
diff --git a/Source/JavaScriptCore/builtins/AsyncFunctionPrototype.js b/Source/JavaScriptCore/builtins/AsyncFunctionPrototype.js
deleted file mode 100644 (file)
index ed9fad6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-function asyncFunctionResume(generator, sentValue, resumeMode)
-{
-    "use strict";
-    let state = generator.@generatorState;
-    let value = @undefined;
-
-    if (state === @GeneratorStateCompleted || (resumeMode !== @GeneratorResumeModeNormal && resumeMode !== @GeneratorResumeModeThrow))
-        throw new @TypeError("Async function illegally resumed");
-
-    try {
-        generator.@generatorState = @GeneratorStateExecuting;
-        value = generator.@generatorNext.@call(generator.@generatorThis, generator, state, sentValue, resumeMode);
-        if (generator.@generatorState === @GeneratorStateExecuting) {
-            generator.@generatorState = @GeneratorStateCompleted;
-            return @Promise.@resolve(value);
-        }
-    } catch (error) {
-        generator.@generatorState = @GeneratorStateCompleted;
-        return @Promise.@reject(error);
-    }
-
-    return @Promise.@resolve(value).@then(
-        function(value) { return @asyncFunctionResume(generator, value, @GeneratorResumeModeNormal); },
-        function(error) { return @asyncFunctionResume(generator, error, @GeneratorResumeModeThrow); });
-}
index 0489303..4c43b04 100644 (file)
@@ -79,7 +79,7 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S
     UnlinkedFunctionKind kind = isParsingDefaultConstructor ? UnlinkedNormalFunction : UnlinkedBuiltinFunction;
     RefPtr<SourceProvider> sourceOverride = isParsingDefaultConstructor ? source.provider() : nullptr;
     std::unique_ptr<ProgramNode> program = parse<ProgramNode>(
-        &vm, RuntimeFlags(), source, Identifier(), builtinMode,
+        &vm, source, Identifier(), builtinMode,
         JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, SuperBinding::NotNeeded, error,
         &positionBeforeLastNewline, constructorKind);
 
index 48301cd..8a3d29b 100644 (file)
@@ -99,8 +99,6 @@
             { "name" : "op_new_func_exp", "length" : 4 },
             { "name" : "op_new_generator_func", "length" : 4 },
             { "name" : "op_new_generator_func_exp", "length" : 4 },
-            { "name" : "op_new_async_func", "length" : 4 },
-            { "name" : "op_new_async_func_exp", "length" : 4 },
             { "name" : "op_set_function_name", "length" : 3 },
             { "name" : "op_call", "length" : 9 },
             { "name" : "op_tail_call", "length" : 9 },
index a3e80a8..3f5c81a 100644 (file)
@@ -149,7 +149,6 @@ void computeUsesForBytecodeOffset(
     case op_get_property_enumerator:
     case op_get_enumerable_length:
     case op_new_func_exp:
-    case op_new_async_func_exp:
     case op_new_generator_func_exp:
     case op_to_index_string:
     case op_create_lexical_environment:
@@ -180,7 +179,6 @@ void computeUsesForBytecodeOffset(
     case op_del_by_id:
     case op_unsigned:
     case op_new_func:
-    case op_new_async_func:
     case op_new_generator_func:
     case op_get_parent_scope:
     case op_create_scoped_arguments:
@@ -380,8 +378,6 @@ void computeDefsForBytecodeOffset(CodeBlock* codeBlock, BytecodeBasicBlock* bloc
     case op_new_regexp:
     case op_new_func:
     case op_new_func_exp:
-    case op_new_async_func:
-    case op_new_async_func_exp:
     case op_new_generator_func:
     case op_new_generator_func_exp:
     case op_call_varargs:
index 81fa4d5..7996561 100644 (file)
@@ -1412,22 +1412,6 @@ void CodeBlock::dumpBytecode(
             out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0);
             break;
         }
-        case op_new_async_func: {
-            int r0 = (++it)->u.operand;
-            int r1 = (++it)->u.operand;
-            int f0 = (++it)->u.operand;
-            printLocationAndOp(out, exec, location, it, "new_async_func");
-            out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0);
-            break;
-        }
-        case op_new_async_func_exp: {
-            int r0 = (++it)->u.operand;
-            int r1 = (++it)->u.operand;
-            int f0 = (++it)->u.operand;
-            printLocationAndOp(out, exec, location, it, "new_async_func_exp");
-            out.printf("%s, %s, f%d", registerName(r0).data(), registerName(r1).data(), f0);
-            break;
-        }
         case op_new_func_exp: {
             int r0 = (++it)->u.operand;
             int r1 = (++it)->u.operand;
@@ -2333,7 +2317,7 @@ void CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink
     m_instructions = WTFMove(instructions);
 
     // Perform bytecode liveness analysis to determine which locals are live and should be resumed when executing op_resume.
-    if (unlinkedCodeBlock->parseMode() == SourceParseMode::GeneratorBodyMode || isAsyncFunctionBodyParseMode(unlinkedCodeBlock->parseMode())) {
+    if (unlinkedCodeBlock->parseMode() == SourceParseMode::GeneratorBodyMode) {
         if (size_t count = mergePointBytecodeOffsets.size()) {
             createRareDataIfNecessary();
             BytecodeLivenessAnalysis liveness(this);
index 8aa4250..2e0e293 100644 (file)
@@ -118,9 +118,7 @@ public:
     bool isStrictMode() const { return m_isStrictMode; }
     bool usesEval() const { return m_usesEval; }
     SourceParseMode parseMode() const { return m_parseMode; }
-    bool isArrowFunction() const { return isOrdinaryArrowFunction() || isAsyncArrowFunction(); }
-    bool isOrdinaryArrowFunction() const { return m_parseMode == SourceParseMode::ArrowFunctionMode; }
-    bool isAsyncArrowFunction() const { return m_parseMode == SourceParseMode::AsyncArrowFunctionMode; }
+    bool isArrowFunction() const { return m_parseMode == SourceParseMode::ArrowFunctionMode; }
     DerivedContextType derivedContextType() const { return static_cast<DerivedContextType>(m_derivedContextType); }
     EvalContextType evalContextType() const { return static_cast<EvalContextType>(m_evalContextType); }
     bool isArrowFunctionContext() const { return m_isArrowFunctionContext; }
index 81d34f7..05be3aa 100644 (file)
@@ -48,7 +48,7 @@ static_assert(sizeof(UnlinkedFunctionExecutable) <= 256, "UnlinkedFunctionExecut
 const ClassInfo UnlinkedFunctionExecutable::s_info = { "UnlinkedFunctionExecutable", 0, 0, CREATE_METHOD_TABLE(UnlinkedFunctionExecutable) };
 
 static UnlinkedFunctionCodeBlock* generateUnlinkedFunctionCodeBlock(
-    VM& vm, const RuntimeFlags& runtimeFlags, UnlinkedFunctionExecutable* executable, const SourceCode& source,
+    VM& vm, UnlinkedFunctionExecutable* executable, const SourceCode& source,
     CodeSpecializationKind kind, DebuggerMode debuggerMode,
     UnlinkedFunctionKind functionKind, ParserError& error, SourceParseMode parseMode)
 {
@@ -56,7 +56,7 @@ static UnlinkedFunctionCodeBlock* generateUnlinkedFunctionCodeBlock(
     JSParserStrictMode strictMode = executable->isInStrictContext() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
     ASSERT(isFunctionParseMode(executable->parseMode()));
     std::unique_ptr<FunctionNode> function = parse<FunctionNode>(
-        &vm, runtimeFlags, source, executable->name(), builtinMode, strictMode, executable->parseMode(), executable->superBinding(), error, nullptr);
+        &vm, source, executable->name(), builtinMode, strictMode, executable->parseMode(), executable->superBinding(), error, nullptr);
 
     if (!function) {
         ASSERT(error.isValid());
@@ -91,7 +91,6 @@ UnlinkedFunctionExecutable::UnlinkedFunctionExecutable(VM* vm, Structure* struct
     , m_typeProfilingEndOffset(node->startStartOffset() + node->source().length() - 1)
     , m_parameterCount(node->parameterCount())
     , m_features(0)
-    , m_sourceParseMode(node->parseMode())
     , m_isInStrictContext(node->isInStrictContext())
     , m_hasCapturedVariables(false)
     , m_isBuiltinFunction(kind == UnlinkedBuiltinFunction)
@@ -100,6 +99,7 @@ UnlinkedFunctionExecutable::UnlinkedFunctionExecutable(VM* vm, Structure* struct
     , m_functionMode(static_cast<unsigned>(node->functionMode()))
     , m_superBinding(static_cast<unsigned>(node->superBinding()))
     , m_derivedContextType(static_cast<unsigned>(derivedContextType))
+    , m_sourceParseMode(static_cast<unsigned>(node->parseMode()))
     , m_name(node->ident())
     , m_ecmaName(node->ecmaName())
     , m_inferredName(node->inferredName())
@@ -112,6 +112,7 @@ UnlinkedFunctionExecutable::UnlinkedFunctionExecutable(VM* vm, Structure* struct
     ASSERT(m_functionMode == static_cast<unsigned>(node->functionMode()));
     ASSERT(m_superBinding == static_cast<unsigned>(node->superBinding()));
     ASSERT(m_derivedContextType == static_cast<unsigned>(derivedContextType));
+    ASSERT(m_sourceParseMode == static_cast<unsigned>(node->parseMode()));
 
     m_parentScopeTDZVariables.swap(parentScopeTDZVariables);
 }
@@ -174,7 +175,7 @@ UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(
     ParserError error;
     VM& vm = exec.vm();
     CodeCache* codeCache = vm.codeCache();
-    UnlinkedFunctionExecutable* executable = codeCache->getFunctionExecutableFromGlobalCode(vm, exec.lexicalGlobalObject()->runtimeFlags(), name, source, error);
+    UnlinkedFunctionExecutable* executable = codeCache->getFunctionExecutableFromGlobalCode(vm, name, source, error);
 
     auto& globalObject = *exec.lexicalGlobalObject();
     if (globalObject.hasDebugger())
@@ -189,7 +190,7 @@ UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(
 }
 
 UnlinkedFunctionCodeBlock* UnlinkedFunctionExecutable::unlinkedCodeBlockFor(
-    VM& vm, const RuntimeFlags& runtimeFlags, const SourceCode& source, CodeSpecializationKind specializationKind, 
+    VM& vm, const SourceCode& source, CodeSpecializationKind specializationKind, 
     DebuggerMode debuggerMode, ParserError& error, SourceParseMode parseMode)
 {
     switch (specializationKind) {
@@ -204,7 +205,7 @@ UnlinkedFunctionCodeBlock* UnlinkedFunctionExecutable::unlinkedCodeBlockFor(
     }
 
     UnlinkedFunctionCodeBlock* result = generateUnlinkedFunctionCodeBlock(
-        vm, runtimeFlags, this, source, specializationKind, debuggerMode,
+        vm, this, source, specializationKind, debuggerMode, 
         isBuiltinFunction() ? UnlinkedBuiltinFunction : UnlinkedNormalFunction, 
         error, parseMode);
     
index e158d33..646b0a6 100644 (file)
@@ -50,7 +50,6 @@ namespace JSC {
 class FunctionMetadataNode;
 class FunctionExecutable;
 class ParserError;
-class RuntimeFlags;
 class SourceCode;
 class SourceProvider;
 class UnlinkedFunctionCodeBlock;
@@ -102,7 +101,7 @@ public:
     void setInvalidTypeProfilingOffsets();
 
     UnlinkedFunctionCodeBlock* unlinkedCodeBlockFor(
-        VM&, const RuntimeFlags&, const SourceCode&, CodeSpecializationKind, DebuggerMode,
+        VM&, const SourceCode&, CodeSpecializationKind, DebuggerMode,
         ParserError&, SourceParseMode);
 
     static UnlinkedFunctionExecutable* fromGlobalCode(
@@ -158,7 +157,6 @@ private:
     unsigned m_typeProfilingEndOffset;
     unsigned m_parameterCount;
     CodeFeatures m_features;
-    SourceParseMode m_sourceParseMode;
     unsigned m_isInStrictContext : 1;
     unsigned m_hasCapturedVariables : 1;
     unsigned m_isBuiltinFunction : 1;
@@ -167,6 +165,7 @@ private:
     unsigned m_functionMode : 2; // FunctionMode
     unsigned m_superBinding : 1;
     unsigned m_derivedContextType: 2;
+    unsigned m_sourceParseMode : 4; // SourceParseMode
 
     WriteBarrier<UnlinkedFunctionCodeBlock> m_unlinkedCodeBlockForCall;
     WriteBarrier<UnlinkedFunctionCodeBlock> m_unlinkedCodeBlockForConstruct;
index 60b1168..dbc710f 100644 (file)
@@ -32,7 +32,6 @@
 #include "BytecodeGenerator.h"
 
 #include "BuiltinExecutables.h"
-#include "BuiltinNames.h"
 #include "BytecodeLivenessAnalysis.h"
 #include "Interpreter.h"
 #include "JSFunction.h"
@@ -248,11 +247,11 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
     bool shouldCaptureAllOfTheThings = m_shouldEmitDebugHooks || codeBlock->usesEval();
     bool needsArguments = (functionNode->usesArguments() || codeBlock->usesEval() || (functionNode->usesArrowFunction() && !codeBlock->isArrowFunction() && isArgumentsUsedInInnerArrowFunction()));
 
-    // Generator and AsyncFunction never provides "arguments". "arguments" reference will be resolved in an upper generator function scope.
-    if (parseMode == SourceParseMode::GeneratorBodyMode || isAsyncFunctionBodyParseMode(parseMode))
+    // Generator never provides "arguments". "arguments" reference will be resolved in an upper generator function scope.
+    if (parseMode == SourceParseMode::GeneratorBodyMode)
         needsArguments = false;
 
-    if ((parseMode == SourceParseMode::GeneratorWrapperFunctionMode || isAsyncFunctionWrapperParseMode(parseMode)) && needsArguments) {
+    if (parseMode == SourceParseMode::GeneratorWrapperFunctionMode && needsArguments) {
         // Generator does not provide "arguments". Instead, wrapping GeneratorFunction provides "arguments".
         // This is because arguments of a generator should be evaluated before starting it.
         // To workaround it, we evaluate these arguments as arguments of a wrapping generator function, and reference it from a generator.
@@ -299,7 +298,7 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
     ASSERT(!(isSimpleParameterList && m_restParameter));
 
     // Before emitting a scope creation, emit a generator prologue that contains jump based on a generator's state.
-    if (parseMode == SourceParseMode::GeneratorBodyMode || isAsyncFunctionBodyParseMode(parseMode)) {
+    if (parseMode == SourceParseMode::GeneratorBodyMode) {
         m_generatorRegister = &m_parameters[1];
 
         // Jump with switch_imm based on @generatorState. We don't take the coroutine styled generator implementation.
@@ -314,8 +313,6 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
 
     if (functionNameIsInScope(functionNode->ident(), functionNode->functionMode())) {
         ASSERT(parseMode != SourceParseMode::GeneratorBodyMode);
-        ASSERT(parseMode != SourceParseMode::AsyncFunctionBodyMode);
-        ASSERT(parseMode != SourceParseMode::AsyncArrowFunctionBodyMode);
         bool isDynamicScope = functionNameScopeIsDynamic(codeBlock->usesEval(), codeBlock->isStrictMode());
         bool isFunctionNameCaptured = captures(functionNode->ident().impl());
         bool markAsCaptured = isDynamicScope || isFunctionNameCaptured;
@@ -540,31 +537,6 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
         break;
     }
 
-    case SourceParseMode::AsyncArrowFunctionMode:
-    case SourceParseMode::AsyncMethodMode:
-    case SourceParseMode::AsyncFunctionMode: {
-        ASSERT(!isConstructor());
-        ASSERT(constructorKind() == ConstructorKind::None);
-        m_generatorRegister = addVar();
-
-        if (parseMode != SourceParseMode::AsyncArrowFunctionMode) {
-            if (functionNode->usesThis() || codeBlock->usesEval()) {
-                m_codeBlock->addPropertyAccessInstruction(instructions().size());
-                emitOpcode(op_to_this);
-                instructions().append(kill(&m_thisRegister));
-                instructions().append(0);
-                instructions().append(0);
-            }
-
-            emitMove(m_generatorRegister, &m_calleeRegister);
-            emitCreateThis(m_generatorRegister);
-        } else
-            emitMove(m_generatorRegister, &m_calleeRegister);
-        break;
-    }
-
-    case SourceParseMode::AsyncFunctionBodyMode:
-    case SourceParseMode::AsyncArrowFunctionBodyMode:
     case SourceParseMode::GeneratorBodyMode: {
         // |this| is already filled correctly before here.
         emitLoad(m_newTargetRegister, jsUndefined());
@@ -595,9 +567,7 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
 
     // We need load |super| & |this| for arrow function before initializeDefaultParameterValuesAndSetupFunctionScopeStack
     // if we have default parameter expression. Because |super| & |this| values can be used there
-    //
-    // Also load here for AsyncArrowFunctions, as they may refer to |super| in their formal parameter expressions as well.
-    if ((SourceParseMode::ArrowFunctionMode == parseMode || parseMode == SourceParseMode::AsyncArrowFunctionMode) && !isSimpleParameterList) {
+    if (SourceParseMode::ArrowFunctionMode == parseMode && !isSimpleParameterList) {
         if (functionNode->usesThis() || functionNode->usesSuperProperty())
             emitLoadThisFromArrowFunctionLexicalEnvironment();
 
@@ -616,50 +586,12 @@ BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, Unlinke
     // All "addVar()"s needs to happen before "initializeDefaultParameterValuesAndSetupFunctionScopeStack()" is called
     // because a function's default parameter ExpressionNodes will use temporary registers.
     pushTDZVariables(*parentScopeTDZVariables, TDZCheckOptimization::DoNotOptimize);
-
-    TryData* tryFormalParametersData = nullptr;
-    if (isAsyncFunctionWrapperParseMode(parseMode) && !isSimpleParameterList) {
-        RefPtr<Label> tryFormalParametersStart = emitLabel(newLabel().get());
-        tryFormalParametersData = pushTry(tryFormalParametersStart.get());
-    }
-
     initializeDefaultParameterValuesAndSetupFunctionScopeStack(parameters, isSimpleParameterList, functionNode, functionSymbolTable, symbolTableConstantIndex, captures, shouldCreateArgumentsVariableInParameterScope);
-
-    if (isAsyncFunctionWrapperParseMode(parseMode) && !isSimpleParameterList) {
-        RefPtr<Label> didNotThrow = newLabel();
-        emitJump(didNotThrow.get());
-        RefPtr<RegisterID> exception = newTemporary();
-        RefPtr<RegisterID> thrownValue = newTemporary();
-        RefPtr<Label> catchHere = emitLabel(newLabel().get());
-        popTryAndEmitCatch(tryFormalParametersData, exception.get(), thrownValue.get(), catchHere.get(), HandlerType::Catch);
-
-        // return @Promise.@reject(thrownValue);
-        Variable promiseVar = variable(m_vm->propertyNames->PromisePrivateName);
-        RefPtr<RegisterID> scope = emitResolveScope(newTemporary(), promiseVar);
-        RefPtr<RegisterID> promiseConstructor = emitGetFromScope(newTemporary(), scope.get(), promiseVar, ResolveMode::ThrowIfNotFound);
-        RefPtr<RegisterID> promiseReject = emitGetById(newTemporary(), promiseConstructor.get(), m_vm->propertyNames->builtinNames().rejectPrivateName());
-
-        CallArguments args(*this, nullptr, 1);
-
-        emitMove(args.thisRegister(), promiseConstructor.get());
-        emitMove(args.argumentRegister(0), thrownValue.get());
-
-        JSTextPosition divot(functionNode->firstLine(), functionNode->startOffset(), functionNode->lineStartOffset());
-
-        RefPtr<RegisterID> result = emitCall(newTemporary(), promiseReject.get(), NoExpectedFunction, args, divot, divot, divot);
-        emitReturn(result.get());
-
-        emitLabel(didNotThrow.get());
-    }
-
+    
     // If we don't have  default parameter expression, then loading |this| inside an arrow function must be done
     // after initializeDefaultParameterValuesAndSetupFunctionScopeStack() because that function sets up the
     // SymbolTable stack and emitLoadThisFromArrowFunctionLexicalEnvironment() consults the SymbolTable stack
-    //
-    // For AsyncArrowFunctionBody functions, the lexical environment may have been loaded by the wrapper function,
-    // but may need to be loaded separately if it's used again in the function body.
-    // FIXME: only require loading the lexical context once per async arrow function.
-    if ((SourceParseMode::ArrowFunctionMode == parseMode && isSimpleParameterList) || SourceParseMode::AsyncArrowFunctionBodyMode == parseMode) {
+    if (SourceParseMode::ArrowFunctionMode == parseMode && isSimpleParameterList) {
         if (functionNode->usesThis() || functionNode->usesSuperProperty())
             emitLoadThisFromArrowFunctionLexicalEnvironment();
     
@@ -2954,13 +2886,6 @@ void BytecodeGenerator::emitNewFunctionExpressionCommon(RegisterID* dst, Functio
     case SourceParseMode::GeneratorWrapperFunctionMode:
         opcodeID = op_new_generator_func_exp;
         break;
-
-    case SourceParseMode::AsyncFunctionMode:
-    case SourceParseMode::AsyncMethodMode:
-    case SourceParseMode::AsyncArrowFunctionMode:
-        opcodeID = op_new_async_func_exp;
-        break;
-
     default:
         break;
     }
@@ -2979,7 +2904,7 @@ RegisterID* BytecodeGenerator::emitNewFunctionExpression(RegisterID* dst, FuncEx
 
 RegisterID* BytecodeGenerator::emitNewArrowFunctionExpression(RegisterID* dst, ArrowFuncExprNode* func)
 {
-    ASSERT(func->metadata()->parseMode() == SourceParseMode::ArrowFunctionMode || func->metadata()->parseMode() == SourceParseMode::AsyncArrowFunctionMode);
+    ASSERT(func->metadata()->parseMode() == SourceParseMode::ArrowFunctionMode);
     emitNewFunctionExpressionCommon(dst, func->metadata());
     return dst;
 }
@@ -2989,8 +2914,7 @@ RegisterID* BytecodeGenerator::emitNewMethodDefinition(RegisterID* dst, MethodDe
     ASSERT(func->metadata()->parseMode() == SourceParseMode::GeneratorWrapperFunctionMode
         || func->metadata()->parseMode() == SourceParseMode::GetterMode
         || func->metadata()->parseMode() == SourceParseMode::SetterMode
-        || func->metadata()->parseMode() == SourceParseMode::MethodMode
-        || func->metadata()->parseMode() == SourceParseMode::AsyncMethodMode);
+        || func->metadata()->parseMode() == SourceParseMode::MethodMode);
     emitNewFunctionExpressionCommon(dst, func->metadata());
     return dst;
 }
@@ -3017,8 +2941,6 @@ RegisterID* BytecodeGenerator::emitNewFunction(RegisterID* dst, FunctionMetadata
     unsigned index = m_codeBlock->addFunctionDecl(makeFunction(function));
     if (function->parseMode() == SourceParseMode::GeneratorWrapperFunctionMode)
         emitOpcode(op_new_generator_func);
-    else if (function->parseMode() == SourceParseMode::AsyncFunctionMode)
-        emitOpcode(op_new_async_func);
     else
         emitOpcode(op_new_func);
     instructions().append(dst->index());
@@ -4307,7 +4229,7 @@ void BytecodeGenerator::popIndexedForInScope(RegisterID* localRegister)
 
 RegisterID* BytecodeGenerator::emitLoadArrowFunctionLexicalEnvironment(const Identifier& identifier)
 {
-    ASSERT(m_codeBlock->isArrowFunction() || parseMode() == SourceParseMode::AsyncArrowFunctionBodyMode || m_codeBlock->isArrowFunctionContext() || constructorKind() == ConstructorKind::Derived || m_codeType == EvalCode);
+    ASSERT(m_codeBlock->isArrowFunction() || m_codeBlock->isArrowFunctionContext() || constructorKind() == ConstructorKind::Derived || m_codeType == EvalCode);
 
     return emitResolveScope(nullptr, variable(identifier, ThisResolutionType::Scoped));
 }
index bc1c602..16b1f53 100644 (file)
@@ -822,7 +822,7 @@ namespace JSC {
         {
             DerivedContextType newDerivedContextType = DerivedContextType::None;
 
-            if (metadata->parseMode() == SourceParseMode::ArrowFunctionMode || metadata->parseMode() == SourceParseMode::AsyncArrowFunctionMode) {
+            if (metadata->parseMode() == SourceParseMode::ArrowFunctionMode) {
                 if (constructorKind() == ConstructorKind::Derived || isDerivedConstructorContext())
                     newDerivedContextType = DerivedContextType::DerivedConstructorContext;
                 else if (m_codeBlock->isClassContext() || isDerivedClassContext())
@@ -836,7 +836,7 @@ namespace JSC {
             // https://bugs.webkit.org/show_bug.cgi?id=151547
             SourceParseMode parseMode = metadata->parseMode();
             ConstructAbility constructAbility = ConstructAbility::CanConstruct;
-            if (parseMode == SourceParseMode::GetterMode || parseMode == SourceParseMode::SetterMode || parseMode == SourceParseMode::ArrowFunctionMode || parseMode == SourceParseMode::GeneratorWrapperFunctionMode || isAsyncFunctionParseMode(parseMode))
+            if (parseMode == SourceParseMode::GetterMode || parseMode == SourceParseMode::SetterMode || parseMode == SourceParseMode::ArrowFunctionMode || parseMode == SourceParseMode::GeneratorWrapperFunctionMode)
                 constructAbility = ConstructAbility::CannotConstruct;
             else if (parseMode == SourceParseMode::MethodMode && metadata->constructorKind() == ConstructorKind::None)
                 constructAbility = ConstructAbility::CannotConstruct;
index 83353ca..9a597b5 100644 (file)
@@ -3265,67 +3265,6 @@ void FunctionNode::emitBytecode(BytecodeGenerator& generator, RegisterID*)
         break;
     }
 
-    case SourceParseMode::AsyncFunctionMode:
-    case SourceParseMode::AsyncMethodMode:
-    case SourceParseMode::AsyncArrowFunctionMode: {
-        StatementNode* singleStatement = this->singleStatement();
-        ASSERT(singleStatement->isExprStatement());
-        ExprStatementNode* exprStatement = static_cast<ExprStatementNode*>(singleStatement);
-        ExpressionNode* expr = exprStatement->expr();
-        ASSERT(expr->isFuncExprNode());
-        FuncExprNode* funcExpr = static_cast<FuncExprNode*>(expr);
-
-        RefPtr<RegisterID> next = generator.newTemporary();
-        generator.emitNode(next.get(), funcExpr);
-
-        if (generator.superBinding() == SuperBinding::Needed || generator.parseMode() == SourceParseMode::AsyncArrowFunctionMode) {
-            // FIXME: Don't always load home object for async arrows
-            RefPtr<RegisterID> homeObject = emitHomeObjectForCallee(generator);
-            emitPutHomeObject(generator, next.get(), homeObject.get());
-        }
-
-        // FIXME: Currently, we just create an object and store generator related fields as its properties for ease.
-        // But to make it efficient, we will introduce JSGenerator class, add opcode new_generator and use its C++ fields instead of these private properties.
-        // https://bugs.webkit.org/show_bug.cgi?id=151545
-
-        generator.emitDirectPutById(generator.generatorRegister(), generator.propertyNames().generatorNextPrivateName, next.get(), PropertyNode::KnownDirect);
-
-        generator.emitDirectPutById(generator.generatorRegister(), generator.propertyNames().generatorThisPrivateName, generator.thisRegister(), PropertyNode::KnownDirect);
-
-        RegisterID* initialState = generator.emitLoad(nullptr, jsNumber(0));
-        generator.emitDirectPutById(generator.generatorRegister(), generator.propertyNames().generatorStatePrivateName, initialState, PropertyNode::KnownDirect);
-
-        generator.emitDirectPutById(generator.generatorRegister(), generator.propertyNames().generatorFramePrivateName, generator.emitLoad(nullptr, jsNull()), PropertyNode::KnownDirect);
-
-        ASSERT(startOffset() >= lineStartOffset());
-        generator.emitDebugHook(WillLeaveCallFrame, lastLine(), startOffset(), lineStartOffset());
-
-        // load @asyncFunctionResume, and call.
-        RefPtr<RegisterID> startAsyncFunction = generator.newTemporary();
-        auto var = generator.variable(generator.propertyNames().builtinNames().asyncFunctionResumePrivateName());
-
-        RefPtr<RegisterID> scope = generator.newTemporary();
-        generator.moveToDestinationIfNeeded(scope.get(), generator.emitResolveScope(scope.get(), var));
-        generator.emitGetFromScope(startAsyncFunction.get(), scope.get(), var, ThrowIfNotFound);
-
-        // return @asyncFunctionResume.@call(this, @generator, @undefined, GeneratorResumeMode::NormalMode)
-        CallArguments args(generator, nullptr, 3);
-        unsigned argumentCount = 0;
-        generator.emitLoad(args.thisRegister(), jsUndefined());
-        generator.emitMove(args.argumentRegister(argumentCount++), generator.generatorRegister());
-        generator.emitLoad(args.argumentRegister(argumentCount++), jsUndefined());
-        generator.emitLoad(args.argumentRegister(argumentCount++), jsNumber(static_cast<int32_t>(JSGeneratorFunction::GeneratorResumeMode::NormalMode)));
-        // JSTextPosition(int _line, int _offset, int _lineStartOffset)
-        JSTextPosition divot(firstLine(), startOffset(), lineStartOffset());
-
-        RefPtr<RegisterID> result = generator.newTemporary();
-        generator.emitCall(result.get(), startAsyncFunction.get(), NoExpectedFunction, args, divot, divot, divot);
-        generator.emitReturn(result.get());
-        break;
-    }
-
-    case SourceParseMode::AsyncArrowFunctionBodyMode:
-    case SourceParseMode::AsyncFunctionBodyMode:
     case SourceParseMode::GeneratorBodyMode: {
         RefPtr<Label> generatorBodyLabel = generator.newLabel();
         {
index 3eb2ec0..5b22544 100644 (file)
@@ -41,7 +41,6 @@
 #include "InspectorValues.h"
 #include "JSLock.h"
 #include "ParserError.h"
-#include "RuntimeFlags.h"
 #include "ScriptDebugServer.h"
 #include "SourceCode.h"
 #include "TypeProfiler.h"
@@ -91,7 +90,7 @@ void InspectorRuntimeAgent::parse(ErrorString&, const String& expression, Inspec
     JSLockHolder lock(m_vm);
 
     ParserError error;
-    checkSyntax(m_vm, RuntimeFlags(), JSC::makeSource(expression), error);
+    checkSyntax(m_vm, JSC::makeSource(expression), error);
 
     switch (error.syntaxErrorType()) {
     case ParserError::SyntaxErrorNone:
index a4765ae..c8b92e4 100644 (file)
@@ -283,8 +283,6 @@ void JIT::privateCompileMainPass()
         DEFINE_OP(op_new_func_exp)
         DEFINE_OP(op_new_generator_func)
         DEFINE_OP(op_new_generator_func_exp)
-        DEFINE_OP(op_new_async_func)
-        DEFINE_OP(op_new_async_func_exp)
         DEFINE_OP(op_new_object)
         DEFINE_OP(op_new_regexp)
         DEFINE_OP(op_not)
index c4288e7..77910b1 100644 (file)
@@ -553,8 +553,6 @@ namespace JSC {
         void emit_op_new_func_exp(Instruction*);
         void emit_op_new_generator_func(Instruction*);
         void emit_op_new_generator_func_exp(Instruction*);
-        void emit_op_new_async_func(Instruction*);
-        void emit_op_new_async_func_exp(Instruction*);
         void emit_op_new_object(Instruction*);
         void emit_op_new_regexp(Instruction*);
         void emit_op_not(Instruction*);
index 0708491..932a957 100644 (file)
@@ -971,8 +971,6 @@ void JIT::emitNewFuncCommon(Instruction* currentInstruction)
     OpcodeID opcodeID = m_vm->interpreter->getOpcodeID(currentInstruction->u.opcode);
     if (opcodeID == op_new_func)
         callOperation(operationNewFunction, dst, regT0, funcExec);
-    else if (opcodeID == op_new_async_func)
-        callOperation(operationNewAsyncFunction, dst, regT0, funcExec);
     else {
         ASSERT(opcodeID == op_new_generator_func);
         callOperation(operationNewGeneratorFunction, dst, regT0, funcExec);
@@ -989,11 +987,6 @@ void JIT::emit_op_new_generator_func(Instruction* currentInstruction)
     emitNewFuncCommon(currentInstruction);
 }
 
-void JIT::emit_op_new_async_func(Instruction* currentInstruction)
-{
-    emitNewFuncCommon(currentInstruction);
-}
-
 void JIT::emitNewFuncExprCommon(Instruction* currentInstruction)
 {
     Jump notUndefinedScope;
@@ -1015,8 +1008,6 @@ void JIT::emitNewFuncExprCommon(Instruction* currentInstruction)
 
     if (opcodeID == op_new_func_exp)
         callOperation(operationNewFunction, dst, regT0, function);
-    else if (opcodeID == op_new_async_func_exp)
-        callOperation(operationNewAsyncFunction, dst, regT0, function);
     else {
         ASSERT(opcodeID == op_new_generator_func_exp);
         callOperation(operationNewGeneratorFunction, dst, regT0, function);
@@ -1035,11 +1026,6 @@ void JIT::emit_op_new_generator_func_exp(Instruction* currentInstruction)
     emitNewFuncExprCommon(currentInstruction);
 }
 
-void JIT::emit_op_new_async_func_exp(Instruction* currentInstruction)
-{
-    emitNewFuncExprCommon(currentInstruction);
-}
-
 void JIT::emit_op_new_array(Instruction* currentInstruction)
 {
     int dst = currentInstruction[1].u.operand;
index 6e8a089..39304bf 100644 (file)
@@ -46,7 +46,6 @@
 #include "JIT.h"
 #include "JITExceptions.h"
 #include "JITToDFGDeferredCompilationCallback.h"
-#include "JSAsyncFunction.h"
 #include "JSCInlines.h"
 #include "JSGeneratorFunction.h"
 #include "JSGlobalObjectFunctions.h"
@@ -1103,16 +1102,6 @@ EncodedJSValue JIT_OPERATION operationNewFunctionWithInvalidatedReallocationWatc
     return operationNewFunctionCommon<JSFunction>(exec, scope, functionExecutable, true);
 }
 
-EncodedJSValue JIT_OPERATION operationNewAsyncFunction(ExecState* exec, JSScope* scope, JSCell* functionExecutable)
-{
-    return operationNewFunctionCommon<JSAsyncFunction>(exec, scope, functionExecutable, false);
-}
-
-EncodedJSValue JIT_OPERATION operationNewAsyncFunctionWithInvalidatedReallocationWatchpoint(ExecState* exec, JSScope* scope, JSCell* functionExecutable)
-{
-    return operationNewFunctionCommon<JSAsyncFunction>(exec, scope, functionExecutable, true);
-}
-
 EncodedJSValue JIT_OPERATION operationNewGeneratorFunction(ExecState* exec, JSScope* scope, JSCell* functionExecutable)
 {
     return operationNewFunctionCommon<JSGeneratorFunction>(exec, scope, functionExecutable, false);
index 9202922..a9726eb 100644 (file)
@@ -345,8 +345,6 @@ EncodedJSValue JIT_OPERATION operationNewArrayBufferWithProfile(ExecState*, Arra
 EncodedJSValue JIT_OPERATION operationNewArrayWithSizeAndProfile(ExecState*, ArrayAllocationProfile*, EncodedJSValue size) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationNewFunction(ExecState*, JSScope*, JSCell*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationNewFunctionWithInvalidatedReallocationWatchpoint(ExecState*, JSScope*, JSCell*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationNewAsyncFunction(ExecState*, JSScope*, JSCell*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationNewAsyncFunctionWithInvalidatedReallocationWatchpoint(ExecState*, JSScope*, JSCell*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationNewGeneratorFunction(ExecState*, JSScope*, JSCell*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint(ExecState*, JSScope*, JSCell*) WTF_INTERNAL;
 void JIT_OPERATION operationSetFunctionName(ExecState*, JSCell*, EncodedJSValue) WTF_INTERNAL;
index ba85a2f..b021d10 100644 (file)
@@ -2097,7 +2097,7 @@ static void runInteractive(GlobalObject* globalObject)
                 break;
             source = source + line;
             source = source + '\n';
-            checkSyntax(globalObject->vm(), globalObject->runtimeFlags(), makeSource(source, interpreterName), error);
+            checkSyntax(globalObject->vm(), makeSource(source, interpreterName), error);
             if (!line[0])
                 break;
             add_history(line);
@@ -2160,7 +2160,6 @@ static NO_RETURN void printUsageStatement(bool help = false)
     fprintf(stderr, "  --options                  Dumps all JSC VM options and exits\n");
     fprintf(stderr, "  --dumpOptions              Dumps all non-default JSC VM options before continuing\n");
     fprintf(stderr, "  --<jsc VM option>=<value>  Sets the specified JSC VM option\n");
-
     fprintf(stderr, "\n");
 
     jscExit(help ? EXIT_SUCCESS : EXIT_FAILURE);
index 1137961..ae68528 100644 (file)
@@ -40,7 +40,6 @@
 #include "Interpreter.h"
 #include "JIT.h"
 #include "JITExceptions.h"
-#include "JSAsyncFunction.h"
 #include "JSLexicalEnvironment.h"
 #include "JSCInlines.h"
 #include "JSCJSValue.h"
@@ -1076,17 +1075,6 @@ LLINT_SLOW_PATH_DECL(slow_path_new_func)
     LLINT_RETURN(JSFunction::create(vm, codeBlock->functionDecl(pc[3].u.operand), scope));
 }
 
-LLINT_SLOW_PATH_DECL(slow_path_new_async_func)
-{
-    LLINT_BEGIN();
-    CodeBlock* codeBlock = exec->codeBlock();
-    JSScope* scope = exec->uncheckedR(pc[2].u.operand).Register::scope();
-#if LLINT_SLOW_PATH_TRACING
-    dataLogF("Creating async function!\n");
-#endif
-    LLINT_RETURN(JSAsyncFunction::create(vm, codeBlock->functionDecl(pc[3].u.operand), scope));
-}
-
 LLINT_SLOW_PATH_DECL(slow_path_new_generator_func)
 {
     LLINT_BEGIN();
@@ -1120,17 +1108,6 @@ LLINT_SLOW_PATH_DECL(slow_path_new_generator_func_exp)
     LLINT_RETURN(JSGeneratorFunction::create(vm, executable, scope));
 }
 
-LLINT_SLOW_PATH_DECL(slow_path_new_async_func_exp)
-{
-    LLINT_BEGIN();
-    
-    CodeBlock* codeBlock = exec->codeBlock();
-    JSScope* scope = exec->uncheckedR(pc[2].u.operand).Register::scope();
-    FunctionExecutable* executable = codeBlock->functionExpr(pc[3].u.operand);
-    
-    LLINT_RETURN(JSAsyncFunction::create(vm, executable, scope));
-}
-
 LLINT_SLOW_PATH_DECL(slow_path_set_function_name)
 {
     LLINT_BEGIN();
index c033fae..bafb1c9 100644 (file)
@@ -100,8 +100,6 @@ LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_char);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_switch_string);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func_exp);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_async_func);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_async_func_exp);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_generator_func);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_generator_func_exp);
 LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_set_function_name);
index 4912771..4b2c496 100644 (file)
@@ -1240,12 +1240,6 @@ _llint_op_new_func:
     dispatch(4)
 
 
-_llint_op_new_async_func:
-    traceExecution()
-    callSlowPath(_llint_slow_path_new_async_func)
-    dispatch(4)
-
-
 _llint_op_new_generator_func:
     traceExecution()
     callSlowPath(_llint_slow_path_new_generator_func)
@@ -1501,6 +1495,7 @@ _llint_op_switch_string:
     callSlowPath(_llint_slow_path_switch_string)
     dispatch(0)
 
+
 _llint_op_new_func_exp:
     traceExecution()
     callSlowPath(_llint_slow_path_new_func_exp)
@@ -1511,11 +1506,6 @@ _llint_op_new_generator_func_exp:
     callSlowPath(_llint_slow_path_new_generator_func_exp)
     dispatch(4)
 
-_llint_op_new_async_func_exp:
-    traceExecution()
-    callSlowPath(_llint_slow_path_new_async_func_exp)
-    dispatch(4)
-
 _llint_op_set_function_name:
     traceExecution()
     callSlowPath(_llint_slow_path_set_function_name)
index ddbcaf3..9ac904a 100644 (file)
@@ -380,17 +380,6 @@ public:
         return result;
     }
 
-    ExpressionNode* createAsyncFunctionBody(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& functionInfo, SourceParseMode parseMode)
-    {
-        if (parseMode == SourceParseMode::AsyncArrowFunctionBodyMode) {
-            SourceCode source = m_sourceCode->subExpression(functionInfo.startOffset, functionInfo.body->isArrowFunctionBodyExpression() ? functionInfo.endOffset - 1 : functionInfo.endOffset, functionInfo.startLine, functionInfo.parametersStartColumn);
-            FuncExprNode* result = new (m_parserArena) FuncExprNode(location, *functionInfo.name, functionInfo.body, source);
-            functionInfo.body->setLoc(functionInfo.startLine, functionInfo.endLine, location.startOffset, location.lineStartOffset);
-            return result;
-        }
-        return createFunctionExpr(location, functionInfo);
-    }
-
     ExpressionNode* createMethodDefinition(const JSTokenLocation& location, const ParserFunctionInfo<ASTBuilder>& functionInfo)
     {
         MethodDefinitionNode* result = new (m_parserArena) MethodDefinitionNode(location, *functionInfo.name, functionInfo.body,
index 8430ae4..4582d00 100644 (file)
@@ -7,7 +7,6 @@ true            TRUETOKEN
 false          FALSETOKEN
 
 # Keywords.
-await           AWAIT
 break          BREAK
 case           CASE
 catch          CATCH
index 381886e..7c8b434 100644 (file)
@@ -195,11 +195,10 @@ void Parser<LexerType>::logError(bool shouldPrintToken, const A& value1, const B
 }
 
 template <typename LexerType>
-Parser<LexerType>::Parser(VM* vm, RuntimeFlags runtimeFlags, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, SourceParseMode parseMode, SuperBinding superBinding, ConstructorKind defaultConstructorKind, DerivedContextType derivedContextType, bool isEvalContext, EvalContextType evalContextType)
+Parser<LexerType>::Parser(VM* vm, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, SourceParseMode parseMode, SuperBinding superBinding, ConstructorKind defaultConstructorKind, DerivedContextType derivedContextType, bool isEvalContext, EvalContextType evalContextType)
     : m_vm(vm)
     , m_source(&source)
     , m_hasStackOverflow(false)
-    , m_runtimeFlags(runtimeFlags)
     , m_allowsIn(true)
     , m_syntaxAlreadyValidated(source.provider()->isValid())
     , m_statementDepth(0)
@@ -253,15 +252,15 @@ String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMo
     scope->setIsLexicalScope();
     SetForScope<FunctionParsePhase> functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Body);
 
-    bool isArrowFunctionBodyExpression = parseMode == SourceParseMode::AsyncArrowFunctionBodyMode && !match(OPENBRACE);
+    bool isArrowFunctionBodyExpression = false;
     if (m_lexer->isReparsingFunction()) {
         ParserFunctionInfo<ASTBuilder> functionInfo;
-        if (SourceParseModeSet(SourceParseMode::GeneratorBodyMode).contains(parseMode) || isAsyncFunctionBodyParseMode(parseMode))
+        if (parseMode == SourceParseMode::GeneratorBodyMode)
             m_parameters = createGeneratorParameters(context);
         else
             m_parameters = parseFunctionParameters(context, parseMode, functionInfo);
 
-        if (SourceParseModeSet(SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode).contains(parseMode) && !hasError()) {
+        if (parseMode == SourceParseMode::ArrowFunctionMode && !hasError()) {
             // The only way we could have an error wile reparsing is if we run out of stack space.
             RELEASE_ASSERT(match(ARROWFUNCTION));
             next();
@@ -278,16 +277,16 @@ String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMo
     SourceElements* sourceElements = nullptr;
     // The only way we can error this early is if we reparse a function and we run out of stack space.
     if (!hasError()) {
-        if (isAsyncFunctionWrapperParseMode(parseMode))
-            sourceElements = parseAsyncFunctionSourceElements(context, parseMode, isArrowFunctionBodyExpression, CheckForStrictMode);
-        else if (isArrowFunctionBodyExpression)
+        if (isArrowFunctionBodyExpression)
             sourceElements = parseArrowFunctionSingleExpressionBodySourceElements(context);
         else if (isModuleParseMode(parseMode))
             sourceElements = parseModuleSourceElements(context, parseMode);
-        else if (parseMode == SourceParseMode::GeneratorWrapperFunctionMode)
-            sourceElements = parseGeneratorFunctionSourceElements(context, CheckForStrictMode);
-        else
-            sourceElements = parseSourceElements(context, CheckForStrictMode);
+        else {
+            if (parseMode == SourceParseMode::GeneratorWrapperFunctionMode)
+                sourceElements = parseGeneratorFunctionSourceElements(context, CheckForStrictMode);
+            else
+                sourceElements = parseSourceElements(context, CheckForStrictMode);
+        }
     }
 
     bool validEnding = consume(EOFTOK);
@@ -307,7 +306,7 @@ String Parser<LexerType>::parseInner(const Identifier& calleeName, SourceParseMo
     for (auto& entry : capturedVariables)
         varDeclarations.markVariableAsCaptured(entry);
 
-    if (SourceParseModeSet(SourceParseMode::GeneratorWrapperFunctionMode).contains(parseMode) || isAsyncFunctionWrapperParseMode(parseMode)) {
+    if (parseMode == SourceParseMode::GeneratorWrapperFunctionMode) {
         if (scope->usedVariablesContains(m_vm->propertyNames->arguments.impl()))
             context.propagateArgumentsUse();
     }
@@ -352,10 +351,21 @@ void Parser<LexerType>::didFinishParsing(SourceElements* sourceElements, Declara
 template <typename LexerType>
 bool Parser<LexerType>::isArrowFunctionParameters()
 {
-    if (match(OPENPAREN)) {
-        SavePoint saveArrowFunctionPoint = createSavePoint();
+    bool isOpenParen = match(OPENPAREN);
+    bool isIdent = match(IDENT);
+    
+    if (!isOpenParen && !isIdent)
+        return false;
+
+    bool isArrowFunction = false;
+    SavePoint saveArrowFunctionPoint = createSavePoint();
+        
+    if (isIdent) {
+        next();
+        isArrowFunction = match(ARROWFUNCTION);
+    } else {
+        RELEASE_ASSERT(isOpenParen);
         next();
-        bool isArrowFunction = false;
         if (match(CLOSEPAREN)) {
             next();
             isArrowFunction = match(ARROWFUNCTION);
@@ -367,22 +377,14 @@ bool Parser<LexerType>::isArrowFunctionParameters()
 
             unsigned parametersCount = 0;
             isArrowFunction = parseFormalParameters(syntaxChecker, syntaxChecker.createFormalParameterList(), parametersCount) && consume(CLOSEPAREN) && match(ARROWFUNCTION);
-
+                
             popScope(fakeScope, syntaxChecker.NeedsFreeVariableInfo);
         }
-        restoreSavePoint(saveArrowFunctionPoint);
-        return isArrowFunction;
-    }
-
-    if (matchSpecIdentifier()) {
-        SavePoint saveArrowFunctionPoint = createSavePoint();
-        next();
-        bool isArrowFunction = match(ARROWFUNCTION);
-        restoreSavePoint(saveArrowFunctionPoint);
-        return isArrowFunction;
     }
-
-    return false;
+        
+    restoreSavePoint(saveArrowFunctionPoint);
+        
+    return isArrowFunction;
 }
 
 template <typename LexerType>
@@ -527,51 +529,6 @@ template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseGenerato
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeSourceElements Parser<LexerType>::parseAsyncFunctionSourceElements(TreeBuilder& context, SourceParseMode parseMode, bool isArrowFunctionBodyExpression, SourceElementsMode mode)
-{
-    ASSERT(isAsyncFunctionWrapperParseMode(parseMode));
-    auto sourceElements = context.createSourceElements();
-
-    unsigned functionKeywordStart = tokenStart();
-    JSTokenLocation startLocation(tokenLocation());
-    JSTextPosition start = tokenStartPosition();
-    unsigned startColumn = tokenColumn();
-    int functionNameStart = m_token.m_location.startOffset;
-    int parametersStart = m_token.m_location.startOffset;
-
-    ParserFunctionInfo<TreeBuilder> info;
-    info.name = &m_vm->propertyNames->nullIdentifier;
-    createGeneratorParameters(context);
-    info.startOffset = parametersStart;
-    info.startLine = tokenLine();
-    info.parameterCount = 4; // generator, state, value, resume mode
-    SourceParseMode innerParseMode = parseMode == SourceParseMode::AsyncArrowFunctionMode
-        ? SourceParseMode::AsyncArrowFunctionBodyMode
-        : SourceParseMode::AsyncFunctionBodyMode;
-    {
-        AutoPopScopeRef asyncFunctionBodyScope(this, pushScope());
-        asyncFunctionBodyScope->setSourceParseMode(innerParseMode);
-        SyntaxChecker asyncFunctionContext(const_cast<VM*>(m_vm), m_lexer.get());
-        if (isArrowFunctionBodyExpression)
-            failIfFalse(parseArrowFunctionSingleExpressionBodySourceElements(asyncFunctionContext), "Cannot parse the body of async arrow function");
-        else
-            failIfFalse(parseSourceElements(asyncFunctionContext, mode), "Cannot parse the body of async function");
-        popScope(asyncFunctionBodyScope, TreeBuilder::NeedsFreeVariableInfo);
-    }
-    info.body = context.createFunctionMetadata(startLocation, tokenLocation(), startColumn, tokenColumn(), functionKeywordStart, functionNameStart, parametersStart, strictMode(), ConstructorKind::None, m_superBinding, info.parameterCount, innerParseMode, isArrowFunctionBodyExpression);
-
-    info.endLine = tokenLine();
-    info.endOffset = isArrowFunctionBodyExpression ? tokenLocation().endOffset : m_token.m_data.offset;
-    info.parametersStartColumn = startColumn;
-
-    auto functionExpr = context.createAsyncFunctionBody(startLocation, info, innerParseMode);
-    auto statement = context.createExprStatement(startLocation, functionExpr, start, m_lastTokenEndPosition.line);
-    context.appendStatement(sourceElements, statement);
-
-    return sourceElements;
-}
-
-template <typename LexerType>
 template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatementListItem(TreeBuilder& context, const Identifier*& directive, unsigned* directiveLiteralLength)
 {
     // The grammar is documented here:
@@ -580,7 +537,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatementList
     m_statementDepth++;
     TreeStatement result = 0;
     bool shouldSetEndOffset = true;
-
     switch (m_token.m_type) {
     case CONSTTOKEN:
         result = parseVariableDeclaration(context, DeclarationType::ConstDeclaration);
@@ -595,7 +551,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatementList
             // For example, under a generator context, matchSpecIdentifier() for "yield" returns `false`.
             // But we would like to enter parseVariableDeclaration and raise an error under the context of parseVariableDeclaration
             // to raise consistent errors between "var", "const" and "let".
-            if (!(match(IDENT) || match(LET) || match(YIELD) || match(AWAIT)) && !match(OPENBRACE) && !match(OPENBRACKET))
+            if (!(match(IDENT) || match(LET) || match(YIELD)) && !match(OPENBRACE) && !match(OPENBRACKET))
                 shouldParseVariableDeclaration = false;
             restoreSavePoint(savePoint);
         }
@@ -615,23 +571,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatementList
         result = parseFunctionDeclaration(context);
         break;
     case IDENT:
-        // FIXME: This branch contributes to a 1% octane code-load regression.
-        // https://bugs.webkit.org/show_bug.cgi?id=158211
-        if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-            if (m_runtimeFlags.isAsyncAwaitEnabled()) {
-                // Eagerly parse as AsyncFunctionDeclaration. This is the uncommon case,
-                // but could be mistakenly parsed as an AsyncFunctionExpression.
-                SavePoint savePoint = createSavePoint();
-                next();
-                if (UNLIKELY(match(FUNCTION) && !m_lexer->prevTerminator())) {
-                    result = parseAsyncFunctionDeclaration(context);
-                    break;
-                }
-                restoreSavePoint(savePoint);
-            }
-        }
-        FALLTHROUGH;
-    case AWAIT:
     case YIELD: {
         // This is a convenient place to notice labeled statements
         // (even though we also parse them as normal statements)
@@ -740,7 +679,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseVariableDecl
         if (matchSpecIdentifier()) {
             failIfTrue(match(LET) && (declarationType == DeclarationType::LetDeclaration || declarationType == DeclarationType::ConstDeclaration), 
                 "Can't use 'let' as an identifier name for a LexicalDeclaration");
-            semanticFailIfTrue(isDisallowedIdentifierAwait(m_token), "Can't use 'await' as a ", declarationTypeToVariableKind(declarationType), " ", disallowedIdentifierAwaitReason());
             JSTextPosition varStart = tokenStartPosition();
             JSTokenLocation varStartLocation(tokenLocation());
             identStart = varStart;
@@ -1063,7 +1001,6 @@ template <class TreeBuilder> TreeDestructuringPattern Parser<LexerType>::parseDe
                             reclassifyExpressionError(ErrorIndicatesPattern, ErrorIndicatesNothing);
                         failIfTrueIfStrict(isEvalOrArguments, "Cannot modify '", propertyName->impl(), "' in strict mode");
                     }
-                    semanticFailIfTrue(isDisallowedIdentifierAwait(identifierToken), "Can't use 'await' as a ", destructuringKindToVariableKindName(kind), " ", disallowedIdentifierAwaitReason());
                     innerPattern = createBindingPattern(context, kind, exportType, *propertyName, identifierToken, bindingContext, duplicateIdentifier);
                 }
             } else {
@@ -1132,7 +1069,6 @@ template <class TreeBuilder> TreeDestructuringPattern Parser<LexerType>::parseDe
             failWithMessage("Expected a parameter pattern or a ')' in parameter list");
         }
         failIfTrue(match(LET) && (kind == DestructuringKind::DestructureToLet || kind == DestructuringKind::DestructureToConst), "Can't use 'let' as an identifier name for a LexicalDeclaration");
-        semanticFailIfTrue(isDisallowedIdentifierAwait(m_token), "Can't use 'await' as a ", destructuringKindToVariableKindName(kind), " ", disallowedIdentifierAwaitReason());
         pattern = createBindingPattern(context, kind, exportType, *m_token.m_data.ident, m_token, bindingContext, duplicateIdentifier);
         next();
         break;
@@ -1681,8 +1617,43 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatement(Tre
         result = parseVariableDeclaration(context, DeclarationType::VarDeclaration);
         break;
     case FUNCTION: {
-        const bool isAsync = false;
-        result = parseFunctionDeclarationStatement(context, isAsync, parentAllowsFunctionDeclarationAsStatement);
+        if (!strictMode()) {
+            failIfFalse(parentAllowsFunctionDeclarationAsStatement, "Function declarations are only allowed inside block statements or at the top level of a program");
+            if (currentScope()->isFunction()) {
+                // Any function declaration that isn't in a block is a syntax error unless it's
+                // in an if/else statement. If it's in an if/else statement, we will magically
+                // treat it as if the if/else statement is inside a block statement.
+                // to the very top like a "var". For example:
+                // function a() {
+                //     if (cond) function foo() { }
+                // }
+                // will be rewritten as:
+                // function a() {
+                //     if (cond) { function foo() { } }
+                // }
+                AutoPopScopeRef blockScope(this, pushScope());
+                blockScope->setIsLexicalScope();
+                blockScope->preventVarDeclarations();
+                JSTokenLocation location(tokenLocation());
+                int start = tokenLine();
+
+                TreeStatement function = parseFunctionDeclaration(context);
+                propagateError();
+                failIfFalse(function, "Expected valid function statement after 'function' keyword");
+                TreeSourceElements sourceElements = context.createSourceElements();
+                context.appendStatement(sourceElements, function);
+                result = context.createBlockStatement(location, sourceElements, start, m_lastTokenEndPosition.line, currentScope()->finalizeLexicalEnvironment(), currentScope()->takeFunctionDeclarations());
+                popScope(blockScope, TreeBuilder::NeedsFreeVariableInfo);
+            } else {
+                // We only implement annex B.3.3 if we're in function mode. Otherwise, we fall back
+                // to hoisting behavior.
+                // FIXME: https://bugs.webkit.org/show_bug.cgi?id=155813
+                DepthManager statementDepth(&m_statementDepth);
+                m_statementDepth = 1;
+                result = parseFunctionDeclaration(context);
+            }
+        } else
+            failWithMessage("Function declarations are only allowed inside blocks or switch statements in strict mode");
         break;
     }
     case SEMICOLON: {
@@ -1734,22 +1705,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatement(Tre
         // These tokens imply the end of a set of source elements
         return 0;
     case IDENT:
-        // FIXME: This branch contributes to a 1% octane code-load regression.
-        // https://bugs.webkit.org/show_bug.cgi?id=158211
-        if (UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async)) {
-            if (m_runtimeFlags.isAsyncAwaitEnabled()) {
-                SavePoint savePoint = createSavePoint();
-                next();
-                if (match(FUNCTION) && !m_lexer->prevTerminator()) {
-                    const bool isAsync = true;
-                    result = parseFunctionDeclarationStatement(context, isAsync, parentAllowsFunctionDeclarationAsStatement);
-                    break;
-                }
-                restoreSavePoint(savePoint);
-            }
-        }
-        FALLTHROUGH;
-    case AWAIT:
     case YIELD: {
         bool allowFunctionDeclarationAsStatement = false;
         result = parseExpressionOrLabelStatement(context, allowFunctionDeclarationAsStatement);
@@ -1775,53 +1730,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseStatement(Tre
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDeclarationStatement(TreeBuilder& context, bool isAsync, bool parentAllowsFunctionDeclarationAsStatement)
-{
-    semanticFailIfTrue(strictMode(), "Function declarations are only allowed inside blocks or switch statements in strict mode");
-    failIfFalse(parentAllowsFunctionDeclarationAsStatement, "Function declarations are only allowed inside block statements or at the top level of a program");
-    if (!currentScope()->isFunction()) {
-        // We only implement annex B.3.3 if we're in function mode. Otherwise, we fall back
-        // to hoisting behavior.
-        // FIXME: https://bugs.webkit.org/show_bug.cgi?id=155813
-        DepthManager statementDepth(&m_statementDepth);
-        m_statementDepth = 1;
-        if (isAsync)
-            return parseAsyncFunctionDeclaration(context);
-        return parseFunctionDeclaration(context);
-    }
-
-    // Any function declaration that isn't in a block is a syntax error unless it's
-    // in an if/else statement. If it's in an if/else statement, we will magically
-    // treat it as if the if/else statement is inside a block statement.
-    // to the very top like a "var". For example:
-    // function a() {
-    //     if (cond) function foo() { }
-    // }
-    // will be rewritten as:
-    // function a() {
-    //     if (cond) { function foo() { } }
-    // }
-    AutoPopScopeRef blockScope(this, pushScope());
-    blockScope->setIsLexicalScope();
-    blockScope->preventVarDeclarations();
-    JSTokenLocation location(tokenLocation());
-    int start = tokenLine();
-
-    TreeStatement function = 0;
-    if (!isAsync)
-        function = parseFunctionDeclaration(context);
-    else
-        function = parseAsyncFunctionDeclaration(context);
-    propagateError();
-    failIfFalse(function, "Expected valid function statement after 'function' keyword");
-    TreeSourceElements sourceElements = context.createSourceElements();
-    context.appendStatement(sourceElements, function);
-    TreeStatement result = context.createBlockStatement(location, sourceElements, start, m_lastTokenEndPosition.line, currentScope()->finalizeLexicalEnvironment(), currentScope()->takeFunctionDeclarations());
-    popScope(blockScope, TreeBuilder::NeedsFreeVariableInfo);
-    return result;
-}
-
-template <typename LexerType>
 template <class TreeBuilder> bool Parser<LexerType>::parseFormalParameters(TreeBuilder& context, TreeFormalParameterList list, unsigned& parameterCount)
 {
 #define failIfDuplicateIfViolation() \
@@ -1844,7 +1752,6 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFormalParameters(TreeB
         if (match(DOTDOTDOT)) {
             next();
             failIfFalse(matchSpecIdentifier(), "Rest parameter '...' should be followed by a variable identifier");
-            semanticFailIfTrue(!m_parserState.allowAwait && match(AWAIT), "Can't use 'await' as a parameter name in an async function");
             declareRestOrNormalParameter(*m_token.m_data.ident, &duplicateParameter);
             propagateError();
             JSTextPosition identifierStart = tokenStartPosition();
@@ -1910,14 +1817,6 @@ static const char* stringForFunctionMode(SourceParseMode mode)
         return "generator function";
     case SourceParseMode::ArrowFunctionMode:
         return "arrow function";
-    case SourceParseMode::AsyncFunctionMode:
-    case SourceParseMode::AsyncFunctionBodyMode:
-        return "async function";
-    case SourceParseMode::AsyncMethodMode:
-        return "async method";
-    case SourceParseMode::AsyncArrowFunctionBodyMode:
-    case SourceParseMode::AsyncArrowFunctionMode:
-        return "async arrow function";
     case SourceParseMode::ProgramMode:
     case SourceParseMode::ModuleAnalyzeMode:
     case SourceParseMode::ModuleEvaluateMode:
@@ -1930,12 +1829,12 @@ static const char* stringForFunctionMode(SourceParseMode mode)
 
 template <typename LexerType> template <class TreeBuilder, class FunctionInfoType> typename TreeBuilder::FormalParameterList Parser<LexerType>::parseFunctionParameters(TreeBuilder& context, SourceParseMode mode, FunctionInfoType& functionInfo)
 {
-    ASSERT(!(SourceParseModeSet(SourceParseMode::ProgramMode, SourceParseMode::ModuleAnalyzeMode, SourceParseMode::ModuleEvaluateMode).contains(mode)));
+    RELEASE_ASSERT(mode != SourceParseMode::ProgramMode && mode != SourceParseMode::ModuleAnalyzeMode && mode != SourceParseMode::ModuleEvaluateMode);
     TreeFormalParameterList parameterList = context.createFormalParameterList();
     SetForScope<FunctionParsePhase> functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Parameters);
     
-    if (SourceParseModeSet(SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode).contains(mode)) {
-        if (!matchSpecIdentifier() && !match(OPENPAREN)) {
+    if (mode == SourceParseMode::ArrowFunctionMode) {
+        if (!match(IDENT) && !match(OPENPAREN)) {
             semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
             failWithMessage("Expected an arrow function input parameter");
         } else {
@@ -2026,9 +1925,7 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
 {
     RELEASE_ASSERT(isFunctionParseMode(mode));
 
-    bool isDisallowedAwaitFunctionName = isDisallowedIdentifierAwait(m_token);
-    const char* isDisallowedAwaitFunctionNameReason = isDisallowedAwaitFunctionName ? disallowedIdentifierAwaitReason() : nullptr;
-
+    bool upperScopeIsGenerator = currentScope()->isGenerator();
     AutoPopScopeRef functionScope(this, pushScope());
     functionScope->setSourceParseMode(mode);
     SetForScope<FunctionParsePhase> functionParsePhasePoisoner(m_parserState.functionParsePhase, FunctionParsePhase::Body);
@@ -2067,7 +1964,7 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
             ASSERT(endLocation.startOffset >= endLocation.lineStartOffset);
             
             FunctionBodyType functionBodyType;
-            if (SourceParseModeSet(SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode).contains(mode))
+            if (mode == SourceParseMode::ArrowFunctionMode)
                 functionBodyType = cachedInfo->isBodyArrowExpression ?  ArrowFunctionBodyExpression : ArrowFunctionBodyBlock;
             else
                 functionBodyType = StandardFunctionBodyBlock;
@@ -2110,21 +2007,18 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
 
     SyntaxChecker syntaxChecker(const_cast<VM*>(m_vm), m_lexer.get());
 
-    if (SourceParseModeSet(SourceParseMode::ArrowFunctionMode, SourceParseMode::AsyncArrowFunctionMode).contains(mode)) {
+    if (mode == SourceParseMode::ArrowFunctionMode) {
         startLocation = tokenLocation();
         functionInfo.startLine = tokenLine();
         startColumn = tokenColumn();
+
         parametersStart = m_token.m_location.startOffset;
         functionInfo.startOffset = parametersStart;
         functionInfo.parametersStartColumn = startColumn;
 
         if (loadCachedFunction())
             return true;
-        {
-            SetForScope<bool> overrideAllowAwait(m_parserState.allowAwait, !isAsyncFunctionParseMode(mode));
-            parseFunctionParameters(syntaxChecker, mode, functionInfo);
-        }
-
+        parseFunctionParameters(syntaxChecker, mode, functionInfo);
         propagateError();
 
         matchOrFail(ARROWFUNCTION, "Expected a '=>' after arrow function parameter declaration");
@@ -2154,28 +2048,19 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
         // GeneratorExpression :
         //     function * BindingIdentifier[Yield]opt ( FormalParameters[Yield] ) { GeneratorBody }
         //
-        // The name of FunctionExpression and AsyncFunctionExpression can accept "yield" even in the context of generator.
-        bool upperScopeIsGenerator = false;
-        if (!(functionDefinitionType == FunctionDefinitionType::Expression && SourceParseModeSet(SourceParseMode::NormalFunctionMode, SourceParseMode::AsyncFunctionMode).contains(mode)))
-            upperScopeIsGenerator = upperScope(1)->isGenerator();
+        // The name of FunctionExpression can accept "yield" even in the context of generator.
+        if (functionDefinitionType == FunctionDefinitionType::Expression && mode == SourceParseMode::NormalFunctionMode)
+            upperScopeIsGenerator = false;
 
         if (matchSpecIdentifier(upperScopeIsGenerator)) {
-            bool allowsAwait = functionDefinitionType == FunctionDefinitionType::Declaration || mode != SourceParseMode::AsyncFunctionMode;
             functionInfo.name = m_token.m_data.ident;
             m_parserState.lastFunctionName = functionInfo.name;
-            if (allowsAwait)
-                semanticFailIfTrue(isDisallowedAwaitFunctionName, "Cannot declare function named 'await' ", isDisallowedAwaitFunctionNameReason);
-            else
-                semanticFailIfTrue(isDisallowedAwaitFunctionName, "Cannot declare async function named 'await'");
-            
             next();
             if (!nameIsInContainingScope)
                 failIfTrueIfStrict(functionScope->declareCallee(functionInfo.name) & DeclarationResult::InvalidStrictMode, "'", functionInfo.name->impl(), "' is not a valid ", stringForFunctionMode(mode), " name in strict mode");
         } else if (requirements == FunctionNeedsName) {
-            if (match(OPENPAREN)) {
-                semanticFailIfTrue(mode == SourceParseMode::NormalFunctionMode, "Function statements must have a name");
-                semanticFailIfTrue(mode == SourceParseMode::AsyncFunctionMode, "Async function statements must have a name");
-            }
+            if (match(OPENPAREN) && mode == SourceParseMode::NormalFunctionMode)
+                semanticFail("Function statements must have a name");
             semanticFailureDueToKeyword(stringForFunctionMode(mode), " name");
             failDueToUnexpectedToken();
             return false;
@@ -2191,11 +2076,8 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
 
         if (loadCachedFunction())
             return true;
-        {
-            SetForScope<bool> overrideAllowAwait(m_parserState.allowAwait, !isAsyncFunctionParseMode(mode));
-            parseFunctionParameters(syntaxChecker, mode, functionInfo);
-            propagateError();
-        }
+        parseFunctionParameters(syntaxChecker, mode, functionInfo);
+        propagateError();
         
         matchOrFail(OPENBRACE, "Expected an opening '{' at the start of a ", stringForFunctionMode(mode), " body");
         
@@ -2239,15 +2121,9 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
         return parseFunctionBody(context, syntaxChecker, startLocation, startColumn, functionKeywordStart, functionNameStart, parametersStart, constructorKind, expectedSuperBinding, functionBodyType, functionInfo.parameterCount, mode);
     };
 
-    if (UNLIKELY((SourceParseModeSet(SourceParseMode::GeneratorWrapperFunctionMode).contains(mode)) || isAsyncFunctionWrapperParseMode(mode))) {
+    if (mode == SourceParseMode::GeneratorWrapperFunctionMode) {
         AutoPopScopeRef generatorBodyScope(this, pushScope());
-        SourceParseMode innerParseMode = SourceParseMode::GeneratorBodyMode;
-        if (isAsyncFunctionWrapperParseMode(mode)) {
-            innerParseMode = mode == SourceParseMode::AsyncArrowFunctionMode
-                ? SourceParseMode::AsyncArrowFunctionBodyMode
-                : SourceParseMode::AsyncFunctionBodyMode;
-        }
-        generatorBodyScope->setSourceParseMode(innerParseMode);
+        generatorBodyScope->setSourceParseMode(SourceParseMode::GeneratorBodyMode);
         generatorBodyScope->setConstructorKind(ConstructorKind::None);
         generatorBodyScope->setExpectedSuperBinding(expectedSuperBinding);
 
@@ -2265,7 +2141,7 @@ template <class TreeBuilder> bool Parser<LexerType>::parseFunctionInfo(TreeBuild
     failIfFalse(functionInfo.body, "Cannot parse the body of this ", stringForFunctionMode(mode));
     context.setEndOffset(functionInfo.body, m_lexer->currentOffset());
     if (functionScope->strictMode() && functionInfo.name) {
-        RELEASE_ASSERT((SourceParseModeSet(SourceParseMode::NormalFunctionMode, SourceParseMode::MethodMode, SourceParseMode::ArrowFunctionMode, SourceParseMode::GeneratorBodyMode, SourceParseMode::GeneratorWrapperFunctionMode).contains(mode)) || isAsyncFunctionWrapperParseMode(mode));
+        RELEASE_ASSERT(mode == SourceParseMode::NormalFunctionMode || mode == SourceParseMode::MethodMode || mode == SourceParseMode::ArrowFunctionMode || mode == SourceParseMode::GeneratorBodyMode || mode == SourceParseMode::GeneratorWrapperFunctionMode);
         semanticFailIfTrue(m_vm->propertyNames->arguments == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
         semanticFailIfTrue(m_vm->propertyNames->eval == *functionInfo.name, "'", functionInfo.name->impl(), "' is not a valid function name in strict mode");
     }
@@ -2352,35 +2228,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseFunctionDecla
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeStatement Parser<LexerType>::parseAsyncFunctionDeclaration(TreeBuilder& context, ExportType exportType)
-{
-    ASSERT(match(FUNCTION));
-    JSTokenLocation location(tokenLocation());
-    unsigned functionKeywordStart = tokenStart();
-    next();
-    ParserFunctionInfo<TreeBuilder> functionInfo;
-    SourceParseMode parseMode = SourceParseMode::AsyncFunctionMode;
-
-    failIfFalse((parseFunctionInfo(context, FunctionNeedsName, parseMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, functionInfo, FunctionDefinitionType::Declaration)), "Cannot parse this async function");
-    failIfFalse(functionInfo.name, "Async function statements must have a name");
-
-    std::pair<DeclarationResultMask, ScopeRef> functionDeclaration = declareFunction(functionInfo.name);
-    DeclarationResultMask declarationResult = functionDeclaration.first;
-    failIfTrueIfStrict(declarationResult & DeclarationResult::InvalidStrictMode, "Cannot declare an async function named '", functionInfo.name->impl(), "' in strict mode");
-    if (declarationResult & DeclarationResult::InvalidDuplicateDeclaration)
-        internalFailWithMessage(false, "Cannot declare an async function that shadows a let/const/class/function variable '", functionInfo.name->impl(), "' in strict mode");
-    if (exportType == ExportType::Exported) {
-        semanticFailIfFalse(exportName(*functionInfo.name), "Cannot export a duplicate function name: '", functionInfo.name->impl(), "'");
-        currentScope()->moduleScopeData().exportBinding(*functionInfo.name);
-    }
-
-    TreeStatement result = context.createFuncDeclStatement(location, functionInfo);
-    if (TreeBuilder::CreatesAST)
-        functionDeclaration.second->appendFunction(getMetadata(functionInfo));
-    return result;
-}
-
-template <typename LexerType>
 template <class TreeBuilder> TreeStatement Parser<LexerType>::parseClassDeclaration(TreeBuilder& context, ExportType exportType)
 {
     ASSERT(match(CLASSTOKEN));
@@ -2478,11 +2325,8 @@ template <class TreeBuilder> TreeClassExpression Parser<LexerType>::parseClass(T
         bool isGetter = false;
         bool isSetter = false;
         bool isGenerator = false;
-        bool isAsyncMethod = false;
         if (consume(TIMES))
             isGenerator = true;
-
-parseMethod:
         switch (m_token.m_type) {
         namedKeyword:
         case STRING:
@@ -2491,19 +2335,12 @@ parseMethod:
             next();
             break;
         case IDENT:
-        case AWAIT:
             ident = m_token.m_data.ident;
             ASSERT(ident);
             next();
-            if (!isGenerator && !isAsyncMethod && (matchIdentifierOrKeyword() || match(STRING) || match(DOUBLE) || match(INTEGER) || match(OPENBRACKET))) {
+            if (!isGenerator && (matchIdentifierOrKeyword() || match(STRING) || match(DOUBLE) || match(INTEGER) || match(OPENBRACKET))) {
                 isGetter = *ident == propertyNames.get;
                 isSetter = *ident == propertyNames.set;
-                if (UNLIKELY(!isAsyncMethod && *ident == propertyNames.async && !m_lexer->prevTerminator())) {
-                    if (m_runtimeFlags.isAsyncAwaitEnabled()) {
-                        isAsyncMethod = true;
-                        goto parseMethod;
-                    }
-                }
             }
             break;
         case DOUBLE:
@@ -2535,12 +2372,7 @@ parseMethod:
             ParserFunctionInfo<TreeBuilder> methodInfo;
             bool isConstructor = !isStaticMethod && *ident == propertyNames.constructor;
             SourceParseMode parseMode = SourceParseMode::MethodMode;
-            if (isAsyncMethod) {
-                isConstructor = false;
-                parseMode = SourceParseMode::AsyncMethodMode;
-                semanticFailIfTrue(*ident == m_vm->propertyNames->prototype, "Cannot declare an async method named 'prototype'");
-                semanticFailIfTrue(*ident == m_vm->propertyNames->constructor, "Cannot declare an async method named 'constructor'");
-            } else if (isGenerator) {
+            if (isGenerator) {
                 isConstructor = false;
                 parseMode = SourceParseMode::GeneratorWrapperFunctionMode;
                 semanticFailIfTrue(*ident == m_vm->propertyNames->prototype, "Cannot declare a generator named 'prototype'");
@@ -2623,10 +2455,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExpressionOrL
                 failDueToUnexpectedToken();
             return context.createExprStatement(location, expression, start, m_lastTokenEndPosition.line);
         }
-        // FIXME: This branch contributes to a 1% octane code-load regression.
-        // https://bugs.webkit.org/show_bug.cgi?id=158211
-        if (UNLIKELY(match(AWAIT)))
-            semanticFailIfTrue(isDisallowedIdentifierAwait(m_token), "Can't use 'await' as a label ", disallowedIdentifierAwaitReason());
         const Identifier* ident = m_token.m_data.ident;
         JSTextPosition end = tokenEndPosition();
         next();
@@ -2823,7 +2651,7 @@ template <class TreeBuilder> typename TreeBuilder::ImportSpecifier Parser<LexerT
         failIfFalse(matchContextualKeyword(m_vm->propertyNames->as), "Expected 'as' before imported binding name");
         next();
 
-        failIfFalse(matchSpecIdentifier(), "Expected a variable name for the import declaration");
+        matchOrFail(IDENT, "Expected a variable name for the import declaration");
         localNameToken = m_token;
         localName = m_token.m_data.ident;
         next();
@@ -2845,7 +2673,7 @@ template <class TreeBuilder> typename TreeBuilder::ImportSpecifier Parser<LexerT
 
         if (matchContextualKeyword(m_vm->propertyNames->as)) {
             next();
-            failIfFalse(matchSpecIdentifier(), "Expected a variable name for the import declaration");
+            matchOrFail(IDENT, "Expected a variable name for the import declaration");
             localNameToken = m_token;
             localName = m_token.m_data.ident;
             next();
@@ -2856,7 +2684,7 @@ template <class TreeBuilder> typename TreeBuilder::ImportSpecifier Parser<LexerT
     case ImportSpecifierType::DefaultImport: {
         // ImportedDefaultBinding :
         // ImportedBinding
-        ASSERT(matchSpecIdentifier());
+        ASSERT(match(IDENT));
         localNameToken = m_token;
         localName = m_token.m_data.ident;
         importedName = &m_vm->propertyNames->defaultKeyword;
@@ -2865,7 +2693,6 @@ template <class TreeBuilder> typename TreeBuilder::ImportSpecifier Parser<LexerT
     }
     }
 
-    semanticFailIfTrue(localNameToken.m_type == AWAIT, "Cannot use 'await' as an imported binding name");
     semanticFailIfTrue(localNameToken.m_type & KeywordTokenFlag, "Cannot use keyword as imported binding name");
     DeclarationResultMask declarationResult = declareVariable(localName, DeclarationType::ConstDeclaration, (specifierType == ImportSpecifierType::NamespaceImport) ? DeclarationImportType::ImportedNamespace : DeclarationImportType::Imported);
     if (declarationResult != DeclarationResult::Valid) {
@@ -2896,7 +2723,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseImportDeclara
     }
 
     bool isFinishedParsingImport = false;
-    if (matchSpecIdentifier()) {
+    if (match(IDENT)) {
         // ImportedDefaultBinding :
         // ImportedBinding
         auto specifier = parseImportClauseItem(context, ImportSpecifierType::DefaultImport);
@@ -3006,19 +2833,8 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExportDeclara
         TreeStatement result = 0;
         bool isFunctionOrClassDeclaration = false;
         const Identifier* localName = nullptr;
-        bool isAsyncFunctionExport = false;
         SavePoint savePoint = createSavePoint();
 
-        if (UNLIKELY(matchContextualKeyword(m_vm->propertyNames->async))) {
-            if (m_runtimeFlags.isAsyncAwaitEnabled()) {
-                next();
-                if (UNLIKELY(match(FUNCTION) && !m_lexer->prevTerminator()))
-                    isAsyncFunctionExport = true;
-                else
-                    restoreSavePoint(savePoint);
-            }
-        }
-
         bool startsWithFunction = match(FUNCTION);
         if (startsWithFunction || match(CLASSTOKEN)) {
             isFunctionOrClassDeclaration = true;
@@ -3036,11 +2852,7 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExportDeclara
             if (match(FUNCTION)) {
                 DepthManager statementDepth(&m_statementDepth);
                 m_statementDepth = 1;
-                if (UNLIKELY(isAsyncFunctionExport)) {
-                    ASSERT(m_runtimeFlags.isAsyncAwaitEnabled());
-                    result = parseAsyncFunctionDeclaration(context);
-                } else
-                    result = parseFunctionDeclaration(context);
+                result = parseFunctionDeclaration(context);
             } else {
                 ASSERT(match(CLASSTOKEN));
                 result = parseClassDeclaration(context);
@@ -3055,11 +2867,9 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExportDeclara
             //
             // In the above example, *default* is the invisible variable to the users.
             // We use the private symbol to represent the name of this variable.
-            ExpressionErrorClassifier classifier(this);
             JSTokenLocation location(tokenLocation());
             JSTextPosition start = tokenStartPosition();
             TreeExpression expression = parseAssignmentExpression(context);
-
             failIfFalse(expression, "Cannot parse expression");
 
             DeclarationResultMask declarationResult = declareVariable(&m_vm->propertyNames->starDefaultPrivateName, DeclarationType::ConstDeclaration);
@@ -3162,15 +2972,6 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseExportDeclara
             break;
 
         default:
-            if (UNLIKELY(matchContextualKeyword(m_vm->propertyNames->async))) {
-                if (m_runtimeFlags.isAsyncAwaitEnabled()) {
-                    next();
-                    semanticFailIfFalse(match(FUNCTION) && !m_lexer->prevTerminator(), "Expected 'function' keyword following 'async' keyword with no preceding line terminator");
-                    result = parseAsyncFunctionDeclaration(context, ExportType::Exported);
-                    break;
-                }
-            }
-
             failWithMessage("Expected either a declaration or a variable statement");
             break;
         }
@@ -3235,48 +3036,34 @@ template <typename TreeBuilder> TreeExpression Parser<LexerType>::parseAssignmen
     ASSERT(!hasError());
     
     failIfStackOverflow();
-
-    if (match(YIELD) && !isYIELDMaskedAsIDENT(currentScope()->isGenerator()))
-        return parseYieldExpression(context);
-
     JSTextPosition start = tokenStartPosition();
     JSTokenLocation location(tokenLocation());
     int initialAssignmentCount = m_parserState.assignmentCount;
     int initialNonLHSCount = m_parserState.nonLHSCount;
     bool maybeAssignmentPattern = match(OPENBRACE) || match(OPENBRACKET);
     bool wasOpenParen = match(OPENPAREN);
-    // Do not use matchSpecIdentifier() here since it is slower than isIdentifierOrKeyword.
-    // Whether spec identifier is will be validated by isArrowFunctionParameters().
-    bool wasIdentifierOrKeyword = isIdentifierOrKeyword(m_token);
-    bool maybeValidArrowFunctionStart = wasOpenParen || wasIdentifierOrKeyword;
+    bool isValidArrowFunctionStart = match(OPENPAREN) || match(IDENT);
     SavePoint savePoint = createSavePoint();
     size_t usedVariablesSize = 0;
-
-    // FIXME: This branch contributes to a 1% octane code-load regression.
-    // https://bugs.webkit.org/show_bug.cgi?id=158211
-    if (wasOpenParen || (wasIdentifierOrKeyword && m_runtimeFlags.isAsyncAwaitEnabled() && UNLIKELY(*m_token.m_data.ident == m_vm->propertyNames->async))) {
+    if (wasOpenParen) {
         usedVariablesSize = currentScope()->currentUsedVariablesSize();
         currentScope()->pushUsedVariableSet();
     }
 
+    if (match(YIELD) && !isYIELDMaskedAsIDENT(currentScope()->isGenerator()))
+        return parseYieldExpression(context);
+
     TreeExpression lhs = parseConditionalExpression(context);
 
-    if (maybeValidArrowFunctionStart && !match(EOFTOK)) {
+    if (isValidArrowFunctionStart && !match(EOFTOK)) {
         bool isArrowFunctionToken = match(ARROWFUNCTION);
         if (!lhs || isArrowFunctionToken) {
             SavePointWithError errorRestorationSavePoint = createSavePointForError();
             restoreSavePoint(savePoint);
-            bool isAsyncArrow = false;
-            if (UNLIKELY(classifier.indicatesPossibleAsyncArrowFunction())) {
-                ASSERT(m_runtimeFlags.isAsyncAwaitEnabled());
-                ASSERT(matchContextualKeyword(m_vm->propertyNames->async));
-                next();
-                isAsyncArrow = !m_lexer->prevTerminator();
-            }
             if (isArrowFunctionParameters()) {
-                if (wasOpenParen || isAsyncArrow)
+                if (wasOpenParen)
                     currentScope()->revertToPreviousUsedVariables(usedVariablesSize);
-                return parseArrowFunctionExpression(context, isAsyncArrow);
+                return parseArrowFunctionExpression(context);
             }
             restoreSavePointWithError(errorRestorationSavePoint);
             if (isArrowFunctionToken)
@@ -3399,23 +3186,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseYieldExpress
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeExpression Parser<LexerType>::parseAwaitExpression(TreeBuilder& context)
-{
-    // AwaitExpression desugared to YieldExpression
-    ASSERT(match(AWAIT));
-    ASSERT(currentScope()->isAsyncFunction());
-    failIfTrue(m_parserState.functionParsePhase == FunctionParsePhase::Parameters, "Cannot use await expression within parameters");
-    JSTokenLocation location(tokenLocation());
-    JSTextPosition divotStart = tokenStartPosition();
-    next();
-    JSTextPosition argumentStart = tokenStartPosition();
-    TreeExpression argument = parseUnaryExpression(context);
-    failIfFalse(argument, "Failed to parse await expression");
-    const bool delegate = false;
-    return context.createYield(location, argument, delegate, divotStart, argumentStart, lastTokenEndPosition());
-}
-
-template <typename LexerType>
 template <class TreeBuilder> TreeExpression Parser<LexerType>::parseConditionalExpression(TreeBuilder& context)
 {
     JSTokenLocation location(tokenLocation());
@@ -3501,26 +3271,22 @@ template <class TreeBuilder> TreeProperty Parser<LexerType>::parseProperty(TreeB
     bool wasIdent = false;
     bool isGenerator = false;
     bool isClassProperty = false;
-    bool isAsyncMethod = false;
     if (consume(TIMES))
         isGenerator = true;
-
-parseProperty:
     switch (m_token.m_type) {
     namedProperty:
     case IDENT:
-    case AWAIT:
         wasIdent = true;
         FALLTHROUGH;
     case STRING: {
         const Identifier* ident = m_token.m_data.ident;
         unsigned getterOrSetterStartOffset = tokenStart();
-        if (complete || (wasIdent && !isGenerator && (*ident == m_vm->propertyNames->get || *ident == m_vm->propertyNames->set || *ident == m_vm->propertyNames->async)))
+        if (complete || (wasIdent && !isGenerator && (*ident == m_vm->propertyNames->get || *ident == m_vm->propertyNames->set)))
             nextExpectIdentifier(LexerFlagsIgnoreReservedWords);
         else
             nextExpectIdentifier(LexerFlagsIgnoreReservedWords | TreeBuilder::DontBuildKeywords);
 
-        if (!isGenerator && !isAsyncMethod && match(COLON)) {
+        if (!isGenerator && match(COLON)) {
             next();
             TreeExpression node = parseAssignmentExpressionOrPropagateErrorClass(context);
             failIfFalse(node, "Cannot parse expression for property declaration");
@@ -3529,12 +3295,11 @@ parseProperty:
         }
 
         if (match(OPENPAREN)) {
-            auto method = parsePropertyMethod(context, ident, isGenerator, isAsyncMethod);
+            auto method = parsePropertyMethod(context, ident, isGenerator);
             propagateError();
             return context.createProperty(ident, method, PropertyNode::Constant, PropertyNode::KnownDirect, complete, SuperBinding::Needed, isClassProperty);
         }
-
-        failIfTrue(isGenerator || isAsyncMethod, "Expected a parenthesis for argument list");
+        failIfTrue(isGenerator, "Expected a parenthesis for argument list");
 
         failIfFalse(wasIdent, "Expected an identifier as property name");
 
@@ -3556,11 +3321,7 @@ parseProperty:
             type = PropertyNode::Getter;
         else if (*ident == m_vm->propertyNames->set)
             type = PropertyNode::Setter;
-        else if (UNLIKELY(m_runtimeFlags.isAsyncAwaitEnabled() && !isGenerator && !isAsyncMethod && *ident == m_vm->propertyNames->async)) {
-            isAsyncMethod = true;
-            failIfTrue(m_lexer->prevTerminator(), "Expected a property name following keyword 'async'");
-            goto parseProperty;
-        } else
+        else
             failWithMessage("Expected a ':' following the property name '", ident->impl(), "'");
         return parseGetterSetter(context, complete, type, getterOrSetterStartOffset, ConstructorKind::None, isClassProperty);
     }
@@ -3571,11 +3332,11 @@ parseProperty:
 
         if (match(OPENPAREN)) {
             const Identifier& ident = m_parserArena.identifierArena().makeNumericIdentifier(const_cast<VM*>(m_vm), propertyName);
-            auto method = parsePropertyMethod(context, &ident, isGenerator, isAsyncMethod);
+            auto method = parsePropertyMethod(context, &ident, isGenerator);
             propagateError();
             return context.createProperty(&ident, method, PropertyNode::Constant, PropertyNode::Unknown, complete, SuperBinding::Needed, isClassProperty);
         }
-        failIfTrue(isGenerator || isAsyncMethod, "Expected a parenthesis for argument list");
+        failIfTrue(isGenerator, "Expected a parenthesis for argument list");
 
         consumeOrFail(COLON, "Expected ':' after property name");
         TreeExpression node = parseAssignmentExpression(context);
@@ -3590,11 +3351,11 @@ parseProperty:
         handleProductionOrFail(CLOSEBRACKET, "]", "end", "computed property name");
 
         if (match(OPENPAREN)) {
-            auto method = parsePropertyMethod(context, &m_vm->propertyNames->nullIdentifier, isGenerator, isAsyncMethod);
+            auto method = parsePropertyMethod(context, &m_vm->propertyNames->nullIdentifier, isGenerator);
             propagateError();
             return context.createProperty(propertyName, method, static_cast<PropertyNode::Type>(PropertyNode::Constant | PropertyNode::Computed), PropertyNode::KnownDirect, complete, SuperBinding::Needed, isClassProperty);
         }
-        failIfTrue(isGenerator || isAsyncMethod, "Expected a parenthesis for argument list");
+        failIfTrue(isGenerator, "Expected a parenthesis for argument list");
 
         consumeOrFail(COLON, "Expected ':' after property name");
         TreeExpression node = parseAssignmentExpression(context);
@@ -3609,12 +3370,12 @@ parseProperty:
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeExpression Parser<LexerType>::parsePropertyMethod(TreeBuilder& context, const Identifier* methodName, bool isGenerator, bool isAsync)
+template <class TreeBuilder> TreeExpression Parser<LexerType>::parsePropertyMethod(TreeBuilder& context, const Identifier* methodName, bool isGenerator)
 {
     JSTokenLocation methodLocation(tokenLocation());
     unsigned methodStart = tokenStart();
     ParserFunctionInfo<TreeBuilder> methodInfo;
-    SourceParseMode parseMode = isGenerator ? SourceParseMode::GeneratorWrapperFunctionMode : isAsync ? SourceParseMode::AsyncMethodMode : SourceParseMode::MethodMode;
+    SourceParseMode parseMode = isGenerator ? SourceParseMode::GeneratorWrapperFunctionMode : SourceParseMode::MethodMode;
     failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, parseMode, false, ConstructorKind::None, SuperBinding::Needed, methodStart, methodInfo, FunctionDefinitionType::Method)), "Cannot parse this method");
     methodInfo.name = methodName;
     return context.createMethodDefinition(methodLocation, methodInfo);
@@ -3872,20 +3633,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseFunctionExpr
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeExpression Parser<LexerType>::parseAsyncFunctionExpression(TreeBuilder& context)
-{
-    ASSERT(match(FUNCTION));
-    JSTokenLocation location(tokenLocation());
-    unsigned functionKeywordStart = tokenStart();
-    next();
-    ParserFunctionInfo<TreeBuilder> functionInfo;
-    functionInfo.name = &m_vm->propertyNames->nullIdentifier;
-    SourceParseMode parseMode = SourceParseMode::AsyncFunctionMode;
-    failIfFalse(parseFunctionInfo(context, FunctionNoRequirements, parseMode, false, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, functionInfo, FunctionDefinitionType::Expression), "Cannot parse async function expression");
-    return context.createFunctionExpr(location, functionInfo);
-}
-
-template <typename LexerType>
 template <class TreeBuilder> typename TreeBuilder::TemplateString Parser<LexerType>::parseTemplateString(TreeBuilder& context, bool isTemplateHead, typename LexerType::RawStringsBuildMode rawStringsBuildMode, bool& elementIsTail)
 {
     if (!isTemplateHead) {
@@ -3975,19 +3722,14 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parsePrimaryExpre
             currentScope()->setInnerArrowFunctionUsesThis();
         return context.createThisExpr(location);
     }
-    case AWAIT:
     case IDENT: {
     identifierExpression:
         JSTextPosition start = tokenStartPosition();
         const Identifier* ident = m_token.m_data.ident;
         JSTokenLocation location(tokenLocation());
         next();
-        // FIXME: This branch contributes to a 1% octane code-load regression.
-        // https://bugs.webkit.org/show_bug.cgi?id=158211
-        if (UNLIKELY(match(FUNCTION) && !m_lexer->prevTerminator() && *ident == m_vm->propertyNames->async)) {
-            if (m_runtimeFlags.isAsyncAwaitEnabled())
-                return parseAsyncFunctionExpression(context);
-        }
+        if (UNLIKELY(match(ARROWFUNCTION)))
+            return 0;
         currentScope()->useVariable(ident, m_vm->propertyNames->eval == *ident);
         m_parserState.lastIdentifier = ident;
         return context.createResolve(location, *ident, start, lastTokenEndPosition());
@@ -4163,7 +3905,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres
             failDueToUnexpectedToken();
     }
 
-    bool baseIsAsyncKeyword = false;
     if (baseIsSuper) {
         ScopeRef closestOrdinaryFunctionScope = closestParentOrdinaryFunctionNonLexicalScope();
         semanticFailIfFalse(currentScope()->isFunction() || (closestOrdinaryFunctionScope->isEvalContext() && closestOrdinaryFunctionScope->expectedSuperBinding() == SuperBinding::Needed), "super is not valid in this context");
@@ -4181,24 +3922,10 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres
                 semanticFailIfTrue(functionSuperBinding == SuperBinding::NotNeeded, "super is not valid in this context");
             }
         }
-    } else if (!baseIsNewTarget) {
-        // FIXME: This branch contributes to a 1% octane code-load regression.
-        // https://bugs.webkit.org/show_bug.cgi?id=158211
-        const bool isAsync = matchContextualKeyword(m_vm->propertyNames->async);
+    } else if (!baseIsNewTarget)
         base = parsePrimaryExpression(context);
-        failIfFalse(base, "Cannot parse base expression");
-        if (UNLIKELY(m_runtimeFlags.isAsyncAwaitEnabled() && isAsync && context.isResolve(base) && !m_lexer->prevTerminator())) {
-            if (matchSpecIdentifier()) {
-                // AsyncArrowFunction
-                forceClassifyExpressionError(ErrorIndicatesAsyncArrowFunction);
-                return 0;
-            }
-            baseIsAsyncKeyword = true;
-        }
-    }
 
     failIfFalse(base, "Cannot parse base expression");
-
     while (true) {
         location = tokenLocation();
         switch (m_token.m_type) {
@@ -4231,8 +3958,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseMemberExpres
             } else {
                 JSTextPosition expressionEnd = lastTokenEndPosition();
                 TreeArguments arguments = parseArguments(context);
-                if (UNLIKELY(baseIsAsyncKeyword && (!arguments || match(ARROWFUNCTION))))
-                    forceClassifyExpressionError(ErrorIndicatesAsyncArrowFunction);
                 failIfFalse(arguments, "Cannot parse call arguments");
                 if (baseIsSuper) {
                     ScopeRef functionScope = currentFunctionScope();
@@ -4291,7 +4016,7 @@ endMemberExpression:
 }
 
 template <typename LexerType>
-template <class TreeBuilder> TreeExpression Parser<LexerType>::parseArrowFunctionExpression(TreeBuilder& context, bool isAsync)
+template <class TreeBuilder> TreeExpression Parser<LexerType>::parseArrowFunctionExpression(TreeBuilder& context)
 {
     JSTokenLocation location;
 
@@ -4299,9 +4024,7 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseArrowFunctio
     location = tokenLocation();
     ParserFunctionInfo<TreeBuilder> info;
     info.name = &m_vm->propertyNames->nullIdentifier;
-    SourceParseMode parseMode = isAsync ? SourceParseMode::AsyncArrowFunctionMode : SourceParseMode::ArrowFunctionMode;
-
-    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, parseMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, FunctionDefinitionType::Expression)), "Cannot parse arrow function expression");
+    failIfFalse((parseFunctionInfo(context, FunctionNoRequirements, SourceParseMode::ArrowFunctionMode, true, ConstructorKind::None, SuperBinding::NotNeeded, functionKeywordStart, info, FunctionDefinitionType::Expression)), "Cannot parse arrow function expression");
 
     return context.createArrowFunctionExpr(location, info);
 }
@@ -4345,14 +4068,6 @@ template <class TreeBuilder> TreeExpression Parser<LexerType>::parseUnaryExpress
     bool modifiesExpr = false;
     bool requiresLExpr = false;
     unsigned lastOperator = 0;
-
-    // FIXME: This branch contributes to a 1% octane code-load regression.
-    // https://bugs.webkit.org/show_bug.cgi?id=158211
-    if (UNLIKELY(match(AWAIT))) {
-        if (m_runtimeFlags.isAsyncAwaitEnabled() && currentFunctionScope()->isAsyncFunction())
-            return parseAwaitExpression(context);
-    }
-
     while (isUnaryOp(m_token.m_type)) {
         if (strictMode()) {
             switch (m_token.m_type) {
@@ -4533,7 +4248,7 @@ template <typename LexerType> void Parser<LexerType>::printUnexpectedTokenText(W
     case INVALID_PRIVATE_NAME_ERRORTOK:
         out.print("Invalid private name '", getToken(), "'");
         return;
-
+            
     case IDENT:
         out.print("Unexpected identifier '", getToken(), "'");
         return;
index f955710..c700f07 100644 (file)
@@ -33,7 +33,6 @@
 #include "ParserError.h"
 #include "ParserFunctionInfo.h"
 #include "ParserTokens.h"
-#include "RuntimeFlags.h"
 #include "SourceProvider.h"
 #include "SourceProviderCache.h"
 #include "SourceProviderCacheItem.h"
@@ -154,7 +153,7 @@ struct Scope {
     WTF_MAKE_NONCOPYABLE(Scope);
 
 public:
-    Scope(const VM* vm, bool isFunction, bool isGenerator, bool strictMode, bool isArrowFunction, bool isAsyncFunction)
+    Scope(const VM* vm, bool isFunction, bool isGenerator, bool strictMode, bool isArrowFunction)
         : m_vm(vm)
         , m_shadowsArguments(false)
         , m_usesEval(false)
@@ -169,8 +168,6 @@ public:
         , m_isGeneratorBoundary(false)
         , m_isArrowFunction(isArrowFunction)
         , m_isArrowFunctionBoundary(false)
-        , m_isAsyncFunction(isAsyncFunction)
-        , m_isAsyncFunctionBoundary(false)
         , m_isLexicalScope(false)
         , m_isFunctionBoundary(false)
         , m_isValidStrictMode(true)
@@ -258,14 +255,6 @@ public:
     void setSourceParseMode(SourceParseMode mode)
     {
         switch (mode) {
-        case SourceParseMode::AsyncArrowFunctionBodyMode:
-            setIsAsyncArrowFunctionBody();
-            break;
-
-        case SourceParseMode::AsyncFunctionBodyMode:
-            setIsAsyncFunctionBody();
-            break;
-
         case SourceParseMode::GeneratorBodyMode:
             setIsGenerator();
             break;
@@ -285,15 +274,6 @@ public:
             setIsArrowFunction();
             break;
 
-        case SourceParseMode::AsyncFunctionMode:
-        case SourceParseMode::AsyncMethodMode:
-            setIsAsyncFunction();
-            break;
-
-        case SourceParseMode::AsyncArrowFunctionMode:
-            setIsAsyncArrowFunction();
-            break;
-
         case SourceParseMode::ProgramMode:
             break;
 
@@ -308,8 +288,6 @@ public:
     bool isFunctionBoundary() const { return m_isFunctionBoundary; }
     bool isGenerator() const { return m_isGenerator; }
     bool isGeneratorBoundary() const { return m_isGeneratorBoundary; }
-    bool isAsyncFunction() const { return m_isAsyncFunction; }
-    bool isAsyncFunctionBoundary() const { return m_isAsyncFunctionBoundary; }
 
     bool hasArguments() const { return m_hasArguments; }
 
@@ -339,11 +317,6 @@ public:
         return *m_moduleScopeData;
     }
 
-    bool isModule() const
-    {
-        return !!m_moduleScopeData;
-    }
-
     void computeLexicallyCapturedVariablesAndPurgeCandidates()
     {
         // Because variables may be defined at any time in the range of a lexical scope, we must
@@ -726,8 +699,6 @@ private:
         m_isGeneratorBoundary = false;
         m_isArrowFunctionBoundary = false;
         m_isArrowFunction = false;
-        m_isAsyncFunctionBoundary = false;
-        m_isAsyncFunction = false;
     }
 
     void setIsGeneratorFunction()
@@ -751,34 +722,6 @@ private:
         m_isArrowFunction = true;
     }
 
-    void setIsAsyncArrowFunction()
-    {
-        setIsArrowFunction();
-        m_isAsyncFunction = true;
-    }
-
-    void setIsAsyncFunction()
-    {
-        setIsFunction();
-        m_isAsyncFunction = true;
-    }
-
-    void setIsAsyncFunctionBody()
-    {
-        setIsFunction();
-        m_hasArguments = false;
-        m_isAsyncFunction = true;
-        m_isAsyncFunctionBoundary = true;
-    }
-
-    void setIsAsyncArrowFunctionBody()
-    {
-        setIsArrowFunction();
-        m_hasArguments = false;
-        m_isAsyncFunction = true;
-        m_isAsyncFunctionBoundary = true;
-    }
-
     void setIsModule()
     {
         m_moduleScopeData = ModuleScopeData::create();
@@ -798,8 +741,6 @@ private:
     bool m_isGeneratorBoundary;
     bool m_isArrowFunction;
     bool m_isArrowFunctionBoundary;
-    bool m_isAsyncFunction;
-    bool m_isAsyncFunctionBoundary;
     bool m_isLexicalScope;
     bool m_isFunctionBoundary;
     bool m_isValidStrictMode;
@@ -873,7 +814,7 @@ class Parser {
     WTF_MAKE_FAST_ALLOCATED;
 
 public:
-    Parser(VM*, RuntimeFlags, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, SourceParseMode, SuperBinding, ConstructorKind defaultConstructorKind = ConstructorKind::None, DerivedContextType = DerivedContextType::None, bool isEvalContext = false, EvalContextType = EvalContextType::None);
+    Parser(VM*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, SourceParseMode, SuperBinding, ConstructorKind defaultConstructorKind = ConstructorKind::None, DerivedContextType = DerivedContextType::None, bool isEvalContext = false, EvalContextType = EvalContextType::None);
     ~Parser();
 
     template <class ParsedNode>
@@ -962,9 +903,8 @@ private:
     };
 
     enum ExpressionErrorClass {
-        ErrorIndicatesNothing = 0,
-        ErrorIndicatesPattern,
-        ErrorIndicatesAsyncArrowFunction
+        ErrorIndicatesNothing,
+        ErrorIndicatesPattern
     };
 
     struct ExpressionErrorClassifier {
@@ -988,11 +928,6 @@ private:
             m_class = classification;
         }
 
-        void forceClassifyExpressionError(ExpressionErrorClass classification)
-        {
-            m_class = classification;
-        }
-
         void reclassifyExpressionError(ExpressionErrorClass oldClassification, ExpressionErrorClass classification)
         {
             if (m_class != oldClassification)
@@ -1002,12 +937,12 @@ private:
 
         void propagateExpressionErrorClass()
         {
-            if (m_previous)
+            if (m_previous && m_class != ErrorIndicatesNothing)
                 m_previous->m_class = m_class;
         }
 
         bool indicatesPossiblePattern() const { return m_class == ErrorIndicatesPattern; }
-        bool indicatesPossibleAsyncArrowFunction() const { return m_class == ErrorIndicatesAsyncArrowFunction; }
+
     private:
         ExpressionErrorClass m_class;
         ExpressionErrorClassifier* m_previous;
@@ -1020,12 +955,6 @@ private:
             m_expressionErrorClassifier->classifyExpressionError(classification);
     }
 
-    ALWAYS_INLINE void forceClassifyExpressionError(ExpressionErrorClass classification)
-    {
-        if (m_expressionErrorClassifier)
-            m_expressionErrorClassifier->forceClassifyExpressionError(classification);
-    }
-
     ALWAYS_INLINE void reclassifyExpressionError(ExpressionErrorClass oldClassification, ExpressionErrorClass classification)
     {
         if (m_expressionErrorClassifier)
@@ -1047,19 +976,6 @@ private:
         return DestructuringKind::DestructureToVariables;
     }
 
-    ALWAYS_INLINE const char* declarationTypeToVariableKind(DeclarationType type)
-    {
-        switch (type) {
-        case DeclarationType::VarDeclaration:
-            return "variable name";
-        case DeclarationType::LetDeclaration:
-        case DeclarationType::ConstDeclaration:
-            return "lexical variable name";
-        }
-        RELEASE_ASSERT_NOT_REACHED();
-        return "invalid";
-    }
-
     ALWAYS_INLINE AssignmentContext assignmentContextFromDeclarationType(DeclarationType type)
     {
         switch (type) {
@@ -1072,12 +988,6 @@ private:
 
     ALWAYS_INLINE bool isEvalOrArguments(const Identifier* ident) { return isEvalOrArgumentsIdentifier(m_vm, ident); }
 
-    ScopeRef upperScope(unsigned n)
-    {
-        ASSERT(m_scopeStack.size() >= (1 + n));
-        return ScopeRef(&m_scopeStack, m_scopeStack.size() - 1 - n);
-    }
-
     ScopeRef currentScope()
     {
         return ScopeRef(&m_scopeStack, m_scopeStack.size() - 1);
@@ -1122,7 +1032,7 @@ private:
     {
         unsigned i = m_scopeStack.size() - 1;
         ASSERT(i < m_scopeStack.size() && m_scopeStack.size());
-        while (i && (!m_scopeStack[i].isFunctionBoundary() || m_scopeStack[i].isGeneratorBoundary() || m_scopeStack[i].isArrowFunctionBoundary() || m_scopeStack[i].isAsyncFunctionBoundary()))
+        while (i && (!m_scopeStack[i].isFunctionBoundary() || m_scopeStack[i].isGeneratorBoundary() || m_scopeStack[i].isArrowFunctionBoundary()))
             i--;
         // When reaching the top level scope (it can be non ordinary function scope), we return it.
         return ScopeRef(&m_scopeStack, i);
@@ -1134,15 +1044,13 @@ private:
         bool isStrict = false;
         bool isGenerator = false;
         bool isArrowFunction = false;
-        bool isAsyncFunction = false;
         if (!m_scopeStack.isEmpty()) {
             isStrict = m_scopeStack.last().strictMode();
             isFunction = m_scopeStack.last().isFunction();
             isGenerator = m_scopeStack.last().isGenerator();
             isArrowFunction = m_scopeStack.last().isArrowFunction();
-            isAsyncFunction = m_scopeStack.last().isAsyncFunction();
         }
-        m_scopeStack.constructAndAppend(m_vm, isFunction, isGenerator, isStrict, isArrowFunction, isAsyncFunction);
+        m_scopeStack.constructAndAppend(m_vm, isFunction, isGenerator, isStrict, isArrowFunction);
         return currentScope();
     }
 
@@ -1154,7 +1062,7 @@ private:
         
         if (m_scopeStack.last().isArrowFunction())
             m_scopeStack.last().setInnerArrowFunctionUsesEvalAndUseArgumentsIfNeeded();
-
+        
         if (!(m_scopeStack.last().isFunctionBoundary() && !m_scopeStack.last().isArrowFunctionBoundary()))
             m_scopeStack[m_scopeStack.size() - 2].mergeInnerArrowFunctionFeatures(m_scopeStack.last().innerArrowFunctionFeatures());
 
@@ -1451,25 +1359,21 @@ private:
     // http://ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions-static-semantics-early-errors
     ALWAYS_INLINE bool matchSpecIdentifier(bool inGenerator)
     {
-        return match(IDENT) || match(AWAIT) || isLETMaskedAsIDENT() || isYIELDMaskedAsIDENT(inGenerator);
+        return match(IDENT) || isLETMaskedAsIDENT() || isYIELDMaskedAsIDENT(inGenerator);
     }
 
-    // http://ecma-international.org/ecma-262/6.0/#sec-generator-function-definitions-static-semantics-early-errors
     ALWAYS_INLINE bool matchSpecIdentifier()
     {
-        return match(IDENT) || match(AWAIT) || isLETMaskedAsIDENT() || isYIELDMaskedAsIDENT(currentScope()->isGenerator());
+        return matchSpecIdentifier(currentScope()->isGenerator());
     }
 
     template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&, SourceElementsMode);
     template <class TreeBuilder> TreeSourceElements parseGeneratorFunctionSourceElements(TreeBuilder&, SourceElementsMode);
-    template <class TreeBuilder> TreeSourceElements parseAsyncFunctionSourceElements(TreeBuilder&, SourceParseMode, bool isArrowFunctionBodyExpression, SourceElementsMode);
     template <class TreeBuilder> TreeStatement parseStatementListItem(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength);
     template <class TreeBuilder> TreeStatement parseStatement(TreeBuilder&, const Identifier*& directive, unsigned* directiveLiteralLength = 0);
     enum class ExportType { Exported, NotExported };
     template <class TreeBuilder> TreeStatement parseClassDeclaration(TreeBuilder&, ExportType = ExportType::NotExported);
     template <class TreeBuilder> TreeStatement parseFunctionDeclaration(TreeBuilder&, ExportType = ExportType::NotExported);
-    template <class TreeBuilder> TreeStatement parseFunctionDeclarationStatement(TreeBuilder&, bool isAsync, bool parentAllowsFunctionDeclarationAsStatement);
-    template <class TreeBuilder> TreeStatement parseAsyncFunctionDeclaration(TreeBuilder&, ExportType = ExportType::NotExported);
     template <class TreeBuilder> TreeStatement parseVariableDeclaration(TreeBuilder&, DeclarationType, ExportType = ExportType::NotExported);
     template <class TreeBuilder> TreeStatement parseDoWhileStatement(TreeBuilder&);
     template <class TreeBuilder> TreeStatement parseWhileStatement(TreeBuilder&);
@@ -1496,25 +1400,23 @@ private:
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseConditionalExpression(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseBinaryExpression(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseUnaryExpression(TreeBuilder&);
-    template <class TreeBuilder> NEVER_INLINE TreeExpression parseAwaitExpression(TreeBuilder&);
     template <class TreeBuilder> TreeExpression parseMemberExpression(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parsePrimaryExpression(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseArrayLiteral(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseObjectLiteral(TreeBuilder&);
     template <class TreeBuilder> NEVER_INLINE TreeExpression parseStrictObjectLiteral(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseFunctionExpression(TreeBuilder&);
-    template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseAsyncFunctionExpression(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeArguments parseArguments(TreeBuilder&);
     template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseArgument(TreeBuilder&, ArgumentType&);
     template <class TreeBuilder> TreeProperty parseProperty(TreeBuilder&, bool strict);
-    template <class TreeBuilder> TreeExpression parsePropertyMethod(TreeBuilder& context, const Identifier* methodName, bool isGenerator, bool isAsyncMethod);
+    template <class TreeBuilder> TreeExpression parsePropertyMethod(TreeBuilder& context, const Identifier* methodName, bool isGenerator);
     template <class TreeBuilder> TreeProperty parseGetterSetter(TreeBuilder&, bool strict, PropertyNode::Type, unsigned getterOrSetterStartOffset, ConstructorKind, bool isClassProperty);
     template <class TreeBuilder> ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&, SyntaxChecker&, const JSTokenLocation&, int, int functionKeywordStart, int functionNameStart, int parametersStart, ConstructorKind, SuperBinding, FunctionBodyType, unsigned, SourceParseMode);
     template <class TreeBuilder> ALWAYS_INLINE bool parseFormalParameters(TreeBuilder&, TreeFormalParameterList, unsigned&);
     enum VarDeclarationListContext { ForLoopContext, VarDeclarationContext };
     template <class TreeBuilder> TreeExpression parseVariableDeclarationList(TreeBuilder&, int& declarations, TreeDestructuringPattern& lastPattern, TreeExpression& lastInitializer, JSTextPosition& identStart, JSTextPosition& initStart, JSTextPosition& initEnd, VarDeclarationListContext, DeclarationType, ExportType, bool& forLoopConstDoesNotHaveInitializer);
     template <class TreeBuilder> TreeSourceElements parseArrowFunctionSingleExpressionBodySourceElements(TreeBuilder&);
-    template <class TreeBuilder> TreeExpression parseArrowFunctionExpression(TreeBuilder&, bool isAsync);
+    template <class TreeBuilder> TreeExpression parseArrowFunctionExpression(TreeBuilder&);
     template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern createBindingPattern(TreeBuilder&, DestructuringKind, ExportType, const Identifier&, JSToken, AssignmentContext, const Identifier** duplicateIdentifier);
     template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern createAssignmentElement(TreeBuilder&, TreeExpression&, const JSTextPosition&, const JSTextPosition&);
     template <class TreeBuilder> NEVER_INLINE TreeDestructuringPattern parseBindingOrAssignmentElement(TreeBuilder& context, DestructuringKind, ExportType, const Identifier** duplicateIdentifier, bool* hasDestructuringPattern, AssignmentContext bindingContext, int depth);
@@ -1572,21 +1474,6 @@ private:
         return !m_errorMessage.isNull();
     }
 
-    bool isDisallowedIdentifierAwait(const JSToken& token)
-    {
-        return token.m_type == AWAIT && (!m_parserState.allowAwait || currentScope()->isAsyncFunctionBoundary() || currentScope()->isModule());
-    }
-
-    const char* disallowedIdentifierAwaitReason()
-    {
-        if (!m_parserState.allowAwait || currentScope()->isAsyncFunctionBoundary())
-            return "in an async function";
-        if (currentScope()->isModule())
-            return "in a module";
-        RELEASE_ASSERT_NOT_REACHED();
-        return nullptr;
-    }
-
     enum class FunctionParsePhase { Parameters, Body };
     struct ParserState {
         int assignmentCount { 0 };
@@ -1595,7 +1482,6 @@ private:
         FunctionParsePhase functionParsePhase { FunctionParsePhase::Body };
         const Identifier* lastIdentifier { nullptr };
         const Identifier* lastFunctionName { nullptr };
-        bool allowAwait { true };
     };
 
     // If you're using this directly, you probably should be using
@@ -1706,7 +1592,6 @@ private:
     bool m_hasStackOverflow;
     String m_errorMessage;
     JSToken m_token;
-    RuntimeFlags m_runtimeFlags;
     bool m_allowsIn;
     JSTextPosition m_lastTokenEndPosition;
     bool m_syntaxAlreadyValidated;
@@ -1839,7 +1724,7 @@ std::unique_ptr<ParsedNode> Parser<LexerType>::parse(ParserError& error, const I
 
 template <class ParsedNode>
 std::unique_ptr<ParsedNode> parse(
-    VM* vm, RuntimeFlags runtimeFlags, const SourceCode& source,
+    VM* vm, const SourceCode& source,
     const Identifier& name, JSParserBuiltinMode builtinMode,
     JSParserStrictMode strictMode, SourceParseMode parseMode, SuperBinding superBinding,
     ParserError& error, JSTextPosition* positionBeforeLastNewline = nullptr,
@@ -1847,7 +1732,7 @@ std::unique_ptr<ParsedNode> parse(
 {
     ASSERT(!source.provider()->source().isNull());
     if (source.provider()->source().is8Bit()) {
-        Parser<Lexer<LChar>> parser(vm, runtimeFlags, source, builtinMode, strictMode, parseMode, superBinding, defaultConstructorKind, derivedContextType, isEvalNode<ParsedNode>(), evalContextType);
+        Parser<Lexer<LChar>> parser(vm, source, builtinMode, strictMode, parseMode, superBinding, defaultConstructorKind, derivedContextType, isEvalNode<ParsedNode>(), evalContextType);
         std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode);
         if (positionBeforeLastNewline)
             *positionBeforeLastNewline = parser.positionBeforeLastNewline();
@@ -1858,7 +1743,7 @@ std::unique_ptr<ParsedNode> parse(
         return result;
     }
     ASSERT_WITH_MESSAGE(defaultConstructorKind == ConstructorKind::None, "BuiltinExecutables::createDefaultConstructor should always use a 8-bit string");
-    Parser<Lexer<UChar>> parser(vm, runtimeFlags, source, builtinMode, strictMode, parseMode, superBinding, defaultConstructorKind, derivedContextType, isEvalNode<ParsedNode>(), evalContextType);
+    Parser<Lexer<UChar>> parser(vm, source, builtinMode, strictMode, parseMode, superBinding, defaultConstructorKind, derivedContextType, isEvalNode<ParsedNode>(), evalContextType);
     std::unique_ptr<ParsedNode> result = parser.parse<ParsedNode>(error, name, parseMode);
     if (positionBeforeLastNewline)
         *positionBeforeLastNewline = parser.positionBeforeLastNewline();
index 7ab241d..d2571e5 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef ParserModes_h
 #define ParserModes_h
 
-#include "ConstructAbility.h"
 #include "Identifier.h"
 
 namespace JSC {
@@ -43,120 +42,80 @@ enum DebuggerMode { DebuggerOff, DebuggerOn };
 
 enum class FunctionMode { FunctionExpression, FunctionDeclaration, MethodDefinition };
 
-// When you add a new source parse mode, do not forget to ensure that the predicates defined in this
-// file work with the newly added mode.
-enum class SourceParseMode : uint16_t {
-    NormalFunctionMode            = 0b0000000000000001,
-    GeneratorBodyMode             = 0b0000000000000010,
-    GeneratorWrapperFunctionMode  = 0b0000000000000100,
-    GetterMode                    = 0b0000000000001000,
-    SetterMode                    = 0b0000000000010000,
-    MethodMode                    = 0b0000000000100000,
-    ArrowFunctionMode             = 0b0000000001000000,
-    AsyncFunctionBodyMode         = 0b0000000010000000,
-    AsyncArrowFunctionBodyMode    = 0b0000000100000000,
-    AsyncFunctionMode             = 0b0000001000000000,
-    AsyncMethodMode               = 0b0000010000000000,
-    AsyncArrowFunctionMode        = 0b0000100000000000,
-    ProgramMode                   = 0b0001000000000000,
-    ModuleAnalyzeMode             = 0b0010000000000000,
-    ModuleEvaluateMode            = 0b0100000000000000,
+enum class SourceParseMode : uint8_t {
+    NormalFunctionMode,
+    GeneratorBodyMode,
+    GeneratorWrapperFunctionMode,
+    GetterMode,
+    SetterMode,
+    MethodMode,
+    ArrowFunctionMode,
+    ProgramMode,
+    ModuleAnalyzeMode,
+    ModuleEvaluateMode
 };
 
-class SourceParseModeSet {
-public:
-    template<typename... Modes>
-    SourceParseModeSet(Modes... args)
-        : m_mask(mergeSourceParseModes(args...))
-    {
-    }
-
-    ALWAYS_INLINE bool contains(SourceParseMode mode)
-    {
-        return static_cast<unsigned>(mode) & m_mask;
-    }
-
-private:
-    ALWAYS_INLINE static unsigned mergeSourceParseModes(SourceParseMode mode)
-    {
-        return static_cast<unsigned>(mode);
-    }
-
-    template<typename... Rest>
-    ALWAYS_INLINE static unsigned mergeSourceParseModes(SourceParseMode mode, Rest... rest)
-    {
-        return static_cast<unsigned>(mode) | mergeSourceParseModes(rest...);
-    }
-
-    const unsigned m_mask;
-};
-
-ALWAYS_INLINE bool isFunctionParseMode(SourceParseMode parseMode)
-{
-    return SourceParseModeSet(
-        SourceParseMode::NormalFunctionMode,
-        SourceParseMode::GeneratorBodyMode,
-        SourceParseMode::GeneratorWrapperFunctionMode,
-        SourceParseMode::GetterMode,
-        SourceParseMode::SetterMode,
-        SourceParseMode::MethodMode,
-        SourceParseMode::ArrowFunctionMode,
-        SourceParseMode::AsyncFunctionBodyMode,
-        SourceParseMode::AsyncFunctionMode,
-        SourceParseMode::AsyncMethodMode,
-        SourceParseMode::AsyncArrowFunctionMode,
-        SourceParseMode::AsyncArrowFunctionBodyMode).contains(parseMode);
-}
-
-ALWAYS_INLINE bool isAsyncFunctionParseMode(SourceParseMode parseMode)
-{
-    return SourceParseModeSet(
-        SourceParseMode::AsyncFunctionBodyMode,
-        SourceParseMode::AsyncFunctionMode,
-        SourceParseMode::AsyncMethodMode,
-        SourceParseMode::AsyncArrowFunctionMode,
-        SourceParseMode::AsyncArrowFunctionBodyMode).contains(parseMode);
-}
-
-ALWAYS_INLINE bool isAsyncArrowFunctionParseMode(SourceParseMode parseMode)
+inline bool isFunctionParseMode(SourceParseMode parseMode)
 {
-    return SourceParseModeSet(
-        SourceParseMode::AsyncArrowFunctionMode,
-        SourceParseMode::AsyncArrowFunctionBodyMode).contains(parseMode);
-}
-
-ALWAYS_INLINE bool isAsyncFunctionWrapperParseMode(SourceParseMode parseMode)
-{
-    return SourceParseModeSet(
-        SourceParseMode::AsyncArrowFunctionMode,
-        SourceParseMode::AsyncFunctionMode,
-        SourceParseMode::AsyncMethodMode).contains(parseMode);
-}
-
-ALWAYS_INLINE bool isAsyncFunctionBodyParseMode(SourceParseMode parseMode)
-{
-    return SourceParseModeSet(
-        SourceParseMode::AsyncFunctionBodyMode,
-        SourceParseMode::AsyncArrowFunctionBodyMode).contains(parseMode);
-}
-
-ALWAYS_INLINE bool isModuleParseMode(SourceParseMode parseMode)
-{
-    return SourceParseModeSet(
-        SourceParseMode::ModuleAnalyzeMode,
-        SourceParseMode::ModuleEvaluateMode).contains(parseMode);
+    switch (parseMode) {
+    case SourceParseMode::NormalFunctionMode:
+    case SourceParseMode::GeneratorBodyMode:
+    case SourceParseMode::GeneratorWrapperFunctionMode:
+    case SourceParseMode::GetterMode:
+    case SourceParseMode::SetterMode:
+    case SourceParseMode::MethodMode:
+    case SourceParseMode::ArrowFunctionMode:
+        return true;
+
+    case SourceParseMode::ProgramMode:
+    case SourceParseMode::ModuleAnalyzeMode:
+    case SourceParseMode::ModuleEvaluateMode:
+        return false;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+    return false;
 }
 
-ALWAYS_INLINE bool isProgramParseMode(SourceParseMode parseMode)
+inline bool isModuleParseMode(SourceParseMode parseMode)
 {
-    return SourceParseModeSet(SourceParseMode::ProgramMode).contains(parseMode);
+    switch (parseMode) {
+    case SourceParseMode::ModuleAnalyzeMode:
+    case SourceParseMode::ModuleEvaluateMode:
+        return true;
+
+    case SourceParseMode::NormalFunctionMode:
+    case SourceParseMode::GeneratorBodyMode:
+    case SourceParseMode::GeneratorWrapperFunctionMode:
+    case SourceParseMode::GetterMode:
+    case SourceParseMode::SetterMode:
+    case SourceParseMode::MethodMode:
+    case SourceParseMode::ArrowFunctionMode:
+    case SourceParseMode::ProgramMode:
+        return false;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+    return false;
 }
 
-ALWAYS_INLINE ConstructAbility constructAbilityForParseMode(SourceParseMode parseMode)
+inline bool isProgramParseMode(SourceParseMode parseMode)
 {
-    if (parseMode == SourceParseMode::NormalFunctionMode)
-        return ConstructAbility::CanConstruct;
-    return ConstructAbility::CannotConstruct;
+    switch (parseMode) {
+    case SourceParseMode::ProgramMode:
+        return true;
+
+    case SourceParseMode::NormalFunctionMode:
+    case SourceParseMode::GeneratorBodyMode:
+    case SourceParseMode::GeneratorWrapperFunctionMode:
+    case SourceParseMode::GetterMode:
+    case SourceParseMode::SetterMode:
+    case SourceParseMode::MethodMode:
+    case SourceParseMode::ArrowFunctionMode:
+    case SourceParseMode::ModuleAnalyzeMode:
+    case SourceParseMode::ModuleEvaluateMode:
+        return false;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+    return false;
 }
 
 inline bool functionNameIsInScope(const Identifier& name, FunctionMode functionMode)
index 248d0ee..aff4a30 100644 (file)
@@ -82,7 +82,6 @@ enum JSTokenType {
     CLASSTOKEN,
     EXTENDS,
     SUPER,
-    AWAIT,
     OPENBRACE = 0,
     CLOSEBRACE,
     OPENPAREN,
index b32f245..ee8a50f 100644 (file)
@@ -28,7 +28,6 @@
 #define SourceCodeKey_h
 
 #include "ParserModes.h"
-#include "RuntimeFlags.h"
 #include "SourceCode.h"
 #include <wtf/HashTraits.h>
 
@@ -67,12 +66,11 @@ public:
     {
     }
 
-    SourceCodeKey(const SourceCode& sourceCode, const RuntimeFlags& runtimeFlags, const String& name, SourceCodeType codeType, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext)
+    SourceCodeKey(const SourceCode& sourceCode, const String& name, SourceCodeType codeType, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DerivedContextType derivedContextType, EvalContextType evalContextType, bool isArrowFunctionContext)
         : m_sourceCode(sourceCode)
         , m_name(name)
         , m_flags(codeType, builtinMode, strictMode, derivedContextType, evalContextType, isArrowFunctionContext)
         , m_hash(sourceCode.hash())
-        , m_runtimeFlags(runtimeFlags)
     {
     }
 
@@ -93,16 +91,13 @@ public:
     // providers cache their strings to make this efficient.
     StringView string() const { return m_sourceCode.view(); }
 
-    const RuntimeFlags& runtimeFlags() const { return m_runtimeFlags; }
-
     bool operator==(const SourceCodeKey& other) const
     {
         return m_hash == other.m_hash
             && length() == other.length()
             && m_flags == other.m_flags
             && m_name == other.m_name
-            && string() == other.string()
-            && m_runtimeFlags == other.runtimeFlags();
+            && string() == other.string();
     }
 
     struct Hash {
@@ -121,7 +116,6 @@ private:
     String m_name;
     SourceCodeFlags m_flags;
     unsigned m_hash;
-    RuntimeFlags m_runtimeFlags;
 };
 
 }
index 92ae31a..bf0d8ff 100644 (file)
@@ -184,7 +184,6 @@ public:
     ExpressionType createYield(const JSTokenLocation&, ExpressionType, bool, int, int, int) { return YieldExpr; }
     ClassExpression createClassExpr(const JSTokenLocation&, const ParserClassInfo<SyntaxChecker>&, VariableEnvironment&, ExpressionType, ExpressionType, PropertyList, PropertyList) { return ClassExpr; }
     ExpressionType createFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
-    ExpressionType createAsyncFunctionBody(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
     int createFunctionMetadata(const JSTokenLocation&, const JSTokenLocation&, int, int, bool, int, int, int, ConstructorKind, SuperBinding, unsigned, SourceParseMode, bool, InnerArrowFunctionCodeFeatures = NoInnerArrowFunctionFeatures) { return FunctionBodyResult; }
     ExpressionType createArrowFunctionExpr(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
     ExpressionType createMethodDefinition(const JSTokenLocation&, const ParserFunctionInfo<SyntaxChecker>&) { return FunctionExpr; }
diff --git a/Source/JavaScriptCore/runtime/AsyncFunctionConstructor.cpp b/Source/JavaScriptCore/runtime/AsyncFunctionConstructor.cpp
deleted file mode 100644 (file)
index 55246f9..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AsyncFunctionConstructor.h"
-
-#include "AsyncFunctionPrototype.h"
-#include "FunctionConstructor.h"
-#include "JSCInlines.h"
-
-namespace JSC {
-
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(AsyncFunctionConstructor);
-
-const ClassInfo AsyncFunctionConstructor::s_info = { "AsyncFunction", &Base::s_info, nullptr, CREATE_METHOD_TABLE(AsyncFunctionConstructor) };
-
-AsyncFunctionConstructor::AsyncFunctionConstructor(VM& vm, Structure* structure)
-    : InternalFunction(vm, structure)
-{
-}
-
-void AsyncFunctionConstructor::finishCreation(VM& vm, AsyncFunctionPrototype* asyncFunctionPrototype)
-{
-    Base::finishCreation(vm, "AsyncFunction");
-    putDirectWithoutTransition(vm, vm.propertyNames->prototype, asyncFunctionPrototype, DontEnum | DontDelete | ReadOnly);
-
-    // Number of arguments for constructor
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontDelete | DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL callAsyncFunctionConstructor(ExecState* exec)
-{
-    ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->callee())->globalObject(), args, FunctionConstructionMode::Async));
-}
-
-static EncodedJSValue JSC_HOST_CALL constructAsyncFunctionConstructor(ExecState* exec)
-{
-    ArgList args(exec);
-    return JSValue::encode(constructFunction(exec, asInternalFunction(exec->callee())->globalObject(), args, FunctionConstructionMode::Async));
-}
-
-CallType AsyncFunctionConstructor::getCallData(JSCell*, CallData& callData)
-{
-    callData.native.function = callAsyncFunctionConstructor;
-    return CallType::Host;
-}
-
-ConstructType AsyncFunctionConstructor::getConstructData(JSCell*, ConstructData& constructData)
-{
-    constructData.native.function = constructAsyncFunctionConstructor;
-    return ConstructType::Host;
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/AsyncFunctionConstructor.h b/Source/JavaScriptCore/runtime/AsyncFunctionConstructor.h
deleted file mode 100644 (file)
index 3c4afcf..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AsyncFunctionConstructor_h
-#define AsyncFunctionConstructor_h
-
-#include "InternalFunction.h"
-
-namespace WTF {
-class TextPosition;
-}
-
-namespace JSC {
-
-class AsyncFunctionPrototype;
-
-class AsyncFunctionConstructor : public InternalFunction {
-public:
-    typedef InternalFunction Base;
-
-    static AsyncFunctionConstructor* create(VM& vm, Structure* structure, AsyncFunctionPrototype* asyncFunctionPrototype)
-    {
-        AsyncFunctionConstructor* constructor = new (NotNull, allocateCell<AsyncFunctionConstructor>(vm.heap)) AsyncFunctionConstructor(vm, structure);
-        constructor->finishCreation(vm, asyncFunctionPrototype);
-        return constructor;
-    }
-
-    DECLARE_INFO;
-
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-    {
-        return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
-    }
-
-private:
-    AsyncFunctionConstructor(VM&, Structure*);
-    void finishCreation(VM&, AsyncFunctionPrototype*);
-    static ConstructType getConstructData(JSCell*, ConstructData&);
-    static CallType getCallData(JSCell*, CallData&);
-};
-
-} // namespace JSC
-
-#endif // AsyncFunctionConstructor_h
diff --git a/Source/JavaScriptCore/runtime/AsyncFunctionPrototype.cpp b/Source/JavaScriptCore/runtime/AsyncFunctionPrototype.cpp
deleted file mode 100644 (file)
index 9b814b7..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AsyncFunctionPrototype.h"
-
-#include "BuiltinExecutables.h"
-#include "BuiltinNames.h"
-#include "Error.h"
-#include "JSArray.h"
-#include "JSCInlines.h"
-#include "JSFunction.h"
-#include "JSString.h"
-#include "JSStringBuilder.h"
-#include "Lexer.h"
-
-namespace JSC {
-
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(AsyncFunctionPrototype);
-
-const ClassInfo AsyncFunctionPrototype::s_info = { "AsyncFunction", &Base::s_info, nullptr, CREATE_METHOD_TABLE(AsyncFunctionPrototype) };
-
-AsyncFunctionPrototype::AsyncFunctionPrototype(VM& vm, Structure* structure)
-    : JSNonFinalObject(vm, structure)
-{
-}
-
-void AsyncFunctionPrototype::finishCreation(VM& vm)
-{
-    Base::finishCreation(vm);
-    ASSERT(inherits(info()));
-    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
-    putDirectWithoutTransition(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "AsyncFunction"), DontEnum | ReadOnly);
-    vm.prototypeMap.addPrototype(this);
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/AsyncFunctionPrototype.h b/Source/JavaScriptCore/runtime/AsyncFunctionPrototype.h
deleted file mode 100644 (file)
index 171af42..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AsyncFunctionPrototype_h
-#define AsyncFunctionPrototype_h
-
-#include "JSObject.h"
-
-namespace JSC {
-
-class AsyncFunctionPrototype : public JSNonFinalObject {
-public:
-    typedef JSNonFinalObject Base;
-
-    static AsyncFunctionPrototype* create(VM& vm, Structure* structure)
-    {
-        AsyncFunctionPrototype* prototype = new (NotNull, allocateCell<AsyncFunctionPrototype>(vm.heap)) AsyncFunctionPrototype(vm, structure);
-        prototype->finishCreation(vm);
-        return prototype;
-    }
-
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue proto)
-    {
-        return Structure::create(vm, globalObject, proto, TypeInfo(ObjectType, StructureFlags), info());
-    }
-
-    DECLARE_INFO;
-
-protected:
-    void finishCreation(VM&);
-
-private:
-    AsyncFunctionPrototype(VM&, Structure*);
-};
-
-} // namespace JSC
-
-#endif // AsyncFunctionPrototype_h
index c31e27b..96bbd17 100644 (file)
@@ -81,11 +81,11 @@ template <> struct CacheTypes<UnlinkedModuleProgramCodeBlock> {
 };
 
 template <class UnlinkedCodeBlockType, class ExecutableType>
-UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, const RuntimeFlags& runtimeFlags, ExecutableType* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
+UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, ExecutableType* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
 {
     DerivedContextType derivedContextType = executable->derivedContextType();
     bool isArrowFunctionContext = executable->isArrowFunctionContext();
-    SourceCodeKey key(source, runtimeFlags, String(), CacheTypes<UnlinkedCodeBlockType>::codeType, builtinMode, strictMode, derivedContextType, evalContextType, isArrowFunctionContext);
+    SourceCodeKey key(source, String(), CacheTypes<UnlinkedCodeBlockType>::codeType, builtinMode, strictMode, derivedContextType, evalContextType, isArrowFunctionContext);
     SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key);
     // FIXME: We should do something smart for TDZ instead of just disabling caching.
     // https://bugs.webkit.org/show_bug.cgi?id=154010
@@ -104,7 +104,7 @@ UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, const RuntimeFlags&
     }
     typedef typename CacheTypes<UnlinkedCodeBlockType>::RootNode RootNode;
     std::unique_ptr<RootNode> rootNode = parse<RootNode>(
-        &vm, runtimeFlags, source, Identifier(), builtinMode, strictMode, CacheTypes<UnlinkedCodeBlockType>::parseMode, SuperBinding::NotNeeded, error, nullptr, ConstructorKind::None, derivedContextType, evalContextType);
+        &vm, source, Identifier(), builtinMode, strictMode, CacheTypes<UnlinkedCodeBlockType>::parseMode, SuperBinding::NotNeeded, error, nullptr, ConstructorKind::None, derivedContextType, evalContextType);
     if (!rootNode)
         return nullptr;
 
@@ -133,29 +133,29 @@ UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, const RuntimeFlags&
     return unlinkedCodeBlock;
 }
 
-UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM& vm, const RuntimeFlags& runtimeFlags, ProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error)
+UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM& vm, ProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error)
 {
     VariableEnvironment emptyParentTDZVariables;
-    return getGlobalCodeBlock<UnlinkedProgramCodeBlock>(vm, runtimeFlags, executable, source, builtinMode, strictMode, debuggerMode, error, EvalContextType::None, &emptyParentTDZVariables);
+    return getGlobalCodeBlock<UnlinkedProgramCodeBlock>(vm, executable, source, builtinMode, strictMode, debuggerMode, error, EvalContextType::None, &emptyParentTDZVariables);
 }
 
-UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM& vm, const RuntimeFlags& runtimeFlags, EvalExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
+UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM& vm, EvalExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
 {
-    return getGlobalCodeBlock<UnlinkedEvalCodeBlock>(vm, runtimeFlags, executable, source, builtinMode, strictMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
+    return getGlobalCodeBlock<UnlinkedEvalCodeBlock>(vm, executable, source, builtinMode, strictMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
 }
 
-UnlinkedModuleProgramCodeBlock* CodeCache::getModuleProgramCodeBlock(VM& vm, const RuntimeFlags& runtimeFlags, ModuleProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, DebuggerMode debuggerMode, ParserError& error)
+UnlinkedModuleProgramCodeBlock* CodeCache::getModuleProgramCodeBlock(VM& vm, ModuleProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, DebuggerMode debuggerMode, ParserError& error)
 {
     VariableEnvironment emptyParentTDZVariables;
-    return getGlobalCodeBlock<UnlinkedModuleProgramCodeBlock>(vm, runtimeFlags, executable, source, builtinMode, JSParserStrictMode::Strict, debuggerMode, error, EvalContextType::None, &emptyParentTDZVariables);
+    return getGlobalCodeBlock<UnlinkedModuleProgramCodeBlock>(vm, executable, source, builtinMode, JSParserStrictMode::Strict, debuggerMode, error, EvalContextType::None, &emptyParentTDZVariables);
 }
 
 // FIXME: There's no need to add the function's name to the key here. It's already in the source code.
-UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& vm, const RuntimeFlags& runtimeFlags, const Identifier& name, const SourceCode& source, ParserError& error)
+UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& vm, const Identifier& name, const SourceCode& source, ParserError& error)
 {
     bool isArrowFunctionContext = false;
     SourceCodeKey key(
-        source, runtimeFlags, name.string(), SourceCodeType::FunctionType,
+        source, name.string(), SourceCodeType::FunctionType,
         JSParserBuiltinMode::NotBuiltin,
         JSParserStrictMode::NotStrict,
         DerivedContextType::None,
@@ -171,7 +171,7 @@ UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& v
 
     JSTextPosition positionBeforeLastNewline;
     std::unique_ptr<ProgramNode> program = parse<ProgramNode>(
-        &vm, runtimeFlags, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+        &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
         JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, SuperBinding::NotNeeded,
         error, &positionBeforeLastNewline);
     if (!program) {
@@ -201,9 +201,7 @@ UnlinkedFunctionExecutable* CodeCache::getFunctionExecutableFromGlobalCode(VM& v
     metadata->setEndPosition(positionBeforeLastNewline);
     // The Function constructor only has access to global variables, so no variables will be under TDZ.
     VariableEnvironment emptyTDZVariables;
-
-    ConstructAbility constructAbility = constructAbilityForParseMode(metadata->parseMode());
-    UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&vm, source, metadata, UnlinkedNormalFunction, constructAbility, emptyTDZVariables, DerivedContextType::None);
+    UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&vm, source, metadata, UnlinkedNormalFunction, ConstructAbility::CanConstruct, emptyTDZVariables, DerivedContextType::None);
 
     functionExecutable->setSourceURLDirective(source.provider()->sourceURL());
     functionExecutable->setSourceMappingURLDirective(source.provider()->sourceMappingURL());
index 2b64b3e..529c489 100644 (file)
@@ -49,7 +49,6 @@ class UnlinkedFunctionExecutable;
 class UnlinkedModuleProgramCodeBlock;
 class UnlinkedProgramCodeBlock;
 class VM;
-class RuntimeFlags;
 class VariableEnvironment;
 
 struct SourceCodeValue {
@@ -188,10 +187,10 @@ public:
     CodeCache();
     ~CodeCache();
 
-    UnlinkedProgramCodeBlock* getProgramCodeBlock(VM&, const RuntimeFlags&, ProgramExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&);
-    UnlinkedEvalCodeBlock* getEvalCodeBlock(VM&, const RuntimeFlags&, EvalExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType, const VariableEnvironment*);
-    UnlinkedModuleProgramCodeBlock* getModuleProgramCodeBlock(VM&, const RuntimeFlags&, ModuleProgramExecutable*, const SourceCode&, JSParserBuiltinMode, DebuggerMode, ParserError&);
-    UnlinkedFunctionExecutable* getFunctionExecutableFromGlobalCode(VM&, const RuntimeFlags&, const Identifier&, const SourceCode&, ParserError&);
+    UnlinkedProgramCodeBlock* getProgramCodeBlock(VM&, ProgramExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&);
+    UnlinkedEvalCodeBlock* getEvalCodeBlock(VM&, EvalExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType, const VariableEnvironment*);
+    UnlinkedModuleProgramCodeBlock* getModuleProgramCodeBlock(VM&, ModuleProgramExecutable*, const SourceCode&, JSParserBuiltinMode, DebuggerMode, ParserError&);
+    UnlinkedFunctionExecutable* getFunctionExecutableFromGlobalCode(VM&, const Identifier&, const SourceCode&, ParserError&);
 
     void clear()
     {
@@ -200,7 +199,7 @@ public:
 
 private:
     template <class UnlinkedCodeBlockType, class ExecutableType> 
-    UnlinkedCodeBlockType* getGlobalCodeBlock(VM&, const RuntimeFlags&, ExecutableType*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType, const VariableEnvironment*);
+    UnlinkedCodeBlockType* getGlobalCodeBlock(VM&, ExecutableType*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&, EvalContextType, const VariableEnvironment*);
 
     CodeCacheMap m_sourceCode;
 };
index 642e7ef..1d32539 100644 (file)
     macro(arguments) \
     macro(as) \
     macro(assign) \
-    macro(async) \
     macro(back) \
     macro(bind) \
     macro(blur) \
     macro(year)
 
 #define JSC_COMMON_IDENTIFIERS_EACH_KEYWORD(macro) \
-    macro(await) \
     macro(break) \
     macro(case) \
     macro(catch) \
index ce742af..dec5553 100644 (file)
@@ -39,7 +39,6 @@
 #include "ModuleAnalyzer.h"
 #include "ModuleLoaderObject.h"
 #include "Parser.h"
-#include "RuntimeFlags.h"
 #include "ScriptProfilingScope.h"
 #include <wtf/WTFThreadData.h>
 
@@ -61,12 +60,12 @@ bool checkSyntax(ExecState* exec, const SourceCode& source, JSValue* returnedExc
     return true;
 }
     
-bool checkSyntax(VM& vm, const RuntimeFlags& runtimeFlags, const SourceCode& source, ParserError& error)
+bool checkSyntax(VM& vm, const SourceCode& source, ParserError& error)
 {
     JSLockHolder lock(vm);
     RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
     return !!parse<ProgramNode>(
-        &vm, runtimeFlags, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+        &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
         JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, SuperBinding::NotNeeded, error);
 }
 
@@ -76,7 +75,7 @@ bool checkModuleSyntax(ExecState* exec, const SourceCode& source, ParserError& e
     JSLockHolder lock(vm);
     RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
     std::unique_ptr<ModuleProgramNode> moduleProgramNode = parse<ModuleProgramNode>(
-        &vm, exec->lexicalGlobalObject()->runtimeFlags(), source, Identifier(), JSParserBuiltinMode::NotBuiltin,
+        &vm, source, Identifier(), JSParserBuiltinMode::NotBuiltin,
         JSParserStrictMode::Strict, SourceParseMode::ModuleAnalyzeMode, SuperBinding::NotNeeded, error);
     if (!moduleProgramNode)
         return false;
index b9d90af..f131cc5 100644 (file)
@@ -33,12 +33,11 @@ class Exception;
 class ExecState;
 class JSObject;
 class ParserError;
-class RuntimeFlags;
 class SourceCode;
 class VM;
 class JSInternalPromise;
 
-JS_EXPORT_PRIVATE bool checkSyntax(VM&, const RuntimeFlags&, const SourceCode&, ParserError&);
+JS_EXPORT_PRIVATE bool checkSyntax(VM&, const SourceCode&, ParserError&);
 JS_EXPORT_PRIVATE bool checkSyntax(ExecState*, const SourceCode&, JSValue* exception = 0);
 JS_EXPORT_PRIVATE bool checkModuleSyntax(ExecState*, const SourceCode&, ParserError&);
 
index b1de99f..49d9f98 100644 (file)
@@ -314,7 +314,7 @@ CodeBlock* ScriptExecutable::newCodeBlockFor(
     DebuggerMode debuggerMode = globalObject->hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
     UnlinkedFunctionCodeBlock* unlinkedCodeBlock = 
         executable->m_unlinkedExecutable->unlinkedCodeBlockFor(
-            *vm, globalObject->runtimeFlags(), executable->m_source, kind, debuggerMode, error, 
+            *vm, executable->m_source, kind, debuggerMode, error, 
             executable->parseMode());
     recordParse(
         executable->m_unlinkedExecutable->features(), 
@@ -569,7 +569,7 @@ JSObject* ProgramExecutable::checkSyntax(ExecState* exec)
     VM* vm = &exec->vm();
     JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
     std::unique_ptr<ProgramNode> programNode = parse<ProgramNode>(
-        vm, lexicalGlobalObject->runtimeFlags(), m_source, Identifier(), JSParserBuiltinMode::NotBuiltin, 
+        vm, m_source, Identifier(), JSParserBuiltinMode::NotBuiltin, 
         JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, SuperBinding::NotNeeded, error);
     if (programNode)
         return 0;
index ecce274..b79a59b 100644 (file)
@@ -652,7 +652,6 @@ public:
     ConstructAbility constructAbility() const { return m_unlinkedExecutable->constructAbility(); }
     bool isClass() const { return !classSource().isNull(); }
     bool isArrowFunction() const { return parseMode() == SourceParseMode::ArrowFunctionMode; }
-    bool isAsyncFunction() const { return isAsyncFunctionParseMode(parseMode()); }
     bool isGetter() const { return parseMode() == SourceParseMode::GetterMode; }
     bool isSetter() const { return parseMode() == SourceParseMode::SetterMode; }
     DerivedContextType derivedContextType() const { return m_unlinkedExecutable->derivedContextType(); }
index 98d6304..d439066 100644 (file)
@@ -95,18 +95,14 @@ JSObject* constructFunctionSkippingEvalEnabledCheck(
     // See https://bugs.webkit.org/show_bug.cgi?id=24350.
     String program;
     if (args.isEmpty())
-        program = makeString("{", functionConstructionMode == FunctionConstructionMode::Async ? "async function " : "function ", functionConstructionMode == FunctionConstructionMode::Generator ? "*" : "", functionName.string(), "() {\n\n}}");
+        program = makeString("{function ", functionConstructionMode == FunctionConstructionMode::Generator ? "*" : "", functionName.string(), "() {\n\n}}");
     else if (args.size() == 1)
-        program = makeString("{", functionConstructionMode == FunctionConstructionMode::Async ? "async function " : "function ", functionConstructionMode == FunctionConstructionMode::Generator ? "*" : "", functionName.string(), "() {\n", args.at(0).toString(exec)->value(exec), "\n}}");
+        program = makeString("{function ", functionConstructionMode == FunctionConstructionMode::Generator ? "*" : "", functionName.string(), "() {\n", args.at(0).toString(exec)->value(exec), "\n}}");
     else {
         StringBuilder builder;
-        if (functionConstructionMode == FunctionConstructionMode::Async)
-            builder.appendLiteral("{async function ");
-        else {
-            builder.appendLiteral("{function ");
-            if (functionConstructionMode == FunctionConstructionMode::Generator)
-                builder.append('*');
-        }
+        builder.appendLiteral("{function ");
+        if (functionConstructionMode == FunctionConstructionMode::Generator)
+            builder.append('*');
         builder.append(functionName.string());
         builder.append('(');
         builder.append(args.at(0).toString(exec)->view(exec).get());
index 54c12f4..63bc408 100644 (file)
@@ -59,7 +59,6 @@ private:
 enum class FunctionConstructionMode {
     Function,
     Generator,
-    Async
 };
 
 JSObject* constructFunction(ExecState*, JSGlobalObject*, const ArgList&, const Identifier& functionName, const String& sourceURL, const WTF::TextPosition&, FunctionConstructionMode = FunctionConstructionMode::Function, JSValue newTarget = JSValue());
diff --git a/Source/JavaScriptCore/runtime/JSAsyncFunction.cpp b/Source/JavaScriptCore/runtime/JSAsyncFunction.cpp
deleted file mode 100644 (file)
index d349096..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSAsyncFunction.h"
-
-#include "Error.h"
-#include "JSCInlines.h"
-#include "JSCJSValue.h"
-#include "JSFunction.h"
-#include "JSFunctionInlines.h"
-#include "JSObject.h"
-#include "PropertySlot.h"
-#include "VM.h"
-
-namespace JSC {
-
-const ClassInfo JSAsyncFunction::s_info = { "AsyncFunction", &Base::s_info, nullptr, CREATE_METHOD_TABLE(JSAsyncFunction) };
-
-JSAsyncFunction::JSAsyncFunction(VM& vm, FunctionExecutable* executable, JSScope* scope)
-    : Base(vm, executable, scope, scope->globalObject()->asyncFunctionStructure())
-{
-}
-
-JSAsyncFunction* JSAsyncFunction::createImpl(VM& vm, FunctionExecutable* executable, JSScope* scope)
-{
-    JSAsyncFunction* asyncFunction = new (NotNull, allocateCell<JSAsyncFunction>(vm.heap)) JSAsyncFunction(vm, executable, scope);
-    ASSERT(asyncFunction->structure()->globalObject());
-    asyncFunction->finishCreation(vm);
-    return asyncFunction;
-}
-
-JSAsyncFunction* JSAsyncFunction::create(VM& vm, FunctionExecutable* executable, JSScope* scope)
-{
-    JSAsyncFunction* asyncFunction = createImpl(vm, executable, scope);
-    executable->singletonFunction()->notifyWrite(vm, asyncFunction, "Allocating an async function");
-    return asyncFunction;
-}
-
-JSAsyncFunction* JSAsyncFunction::createWithInvalidatedReallocationWatchpoint(VM& vm, FunctionExecutable* executable, JSScope* scope)
-{
-    return createImpl(vm, executable, scope);
-}
-
-} // namespace JSC
-
-
diff --git a/Source/JavaScriptCore/runtime/JSAsyncFunction.h b/Source/JavaScriptCore/runtime/JSAsyncFunction.h
deleted file mode 100644 (file)
index e9959ec..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2016 Caitlin Potter <caitp@igalia.com>.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSAsyncFunction_h
-#define JSAsyncFunction_h
-
-#include "JSFunction.h"
-
-namespace JSC {
-
-class JSGlobalObject;
-class LLIntOffsetsExtractor;
-class LLIntDesiredOffsets;
-
-class JSAsyncFunction : public JSFunction {
-    friend class JIT;
-#if ENABLE(DFG_JIT)
-    friend class DFG::SpeculativeJIT;
-    friend class DFG::JITCompiler;
-#endif
-    friend class VM;
-public:
-    typedef JSFunction Base;
-
-    const static unsigned StructureFlags = Base::StructureFlags;
-
-    DECLARE_EXPORT_INFO;
-
-    static JSAsyncFunction* create(VM&, FunctionExecutable*, JSScope*);
-    static JSAsyncFunction* createWithInvalidatedReallocationWatchpoint(VM&, FunctionExecutable*, JSScope*);
-
-    static size_t allocationSize(size_t inlineCapacity)
-    {
-        ASSERT_UNUSED(inlineCapacity, !inlineCapacity);
-        return sizeof(JSAsyncFunction);
-    }
-
-    static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
-    {
-        ASSERT(globalObject);
-        return Structure::create(vm, globalObject, prototype, TypeInfo(JSFunctionType, StructureFlags), info());
-    }
-
-private:
-    JSAsyncFunction(VM&, FunctionExecutable*, JSScope*);
-
-    static JSAsyncFunction* createImpl(VM&, FunctionExecutable*, JSScope*);
-
-    friend class LLIntOffsetsExtractor;
-};
-
-} // namespace JSC
-
-#endif // JSAsyncFunction_h
index 3174abc..ae30dcc 100644 (file)
@@ -351,7 +351,7 @@ bool JSFunction::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyN
     if (thisObject->isHostOrBuiltinFunction())
         return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
 
-    if (propertyName == exec->propertyNames().prototype && !thisObject->jsExecutable()->isArrowFunction() && !thisObject->jsExecutable()->isAsyncFunction()) {
+    if (propertyName == exec->propertyNames().prototype && !thisObject->jsExecutable()->isArrowFunction()) {
         VM& vm = exec->vm();
         unsigned attributes;
         PropertyOffset offset = thisObject->getDirectOffset(vm, propertyName, attributes);
index 40ea889..7a5b05c 100644 (file)
@@ -33,8 +33,6 @@
 #include "ArrayConstructor.h"
 #include "ArrayIteratorPrototype.h"
 #include "ArrayPrototype.h"
-#include "AsyncFunctionConstructor.h"
-#include "AsyncFunctionPrototype.h"
 #include "BooleanConstructor.h"
 #include "BooleanPrototype.h"
 #include "BuiltinNames.h"
@@ -66,7 +64,6 @@
 #include "JSArrayBufferConstructor.h"
 #include "JSArrayBufferPrototype.h"
 #include "JSArrayIterator.h"
-#include "JSAsyncFunction.h"
 #include "JSBoundFunction.h"
 #include "JSBoundSlotBaseFunction.h"
 #include "JSCInlines.h"
@@ -615,11 +612,6 @@ m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->c
             init.set(NativeErrorConstructor::create(init.vm, init.owner, init.owner->m_nativeErrorStructure.get(), init.owner->m_nativeErrorPrototypeStructure.get(), ASCIILiteral("URIError")));
         });
 
-    m_asyncFunctionPrototype.set(vm, this, AsyncFunctionPrototype::create(vm, AsyncFunctionPrototype::createStructure(vm, this, m_functionPrototype.get())));
-    AsyncFunctionConstructor* asyncFunctionConstructor = AsyncFunctionConstructor::create(vm, AsyncFunctionConstructor::createStructure(vm, this, functionConstructor), m_asyncFunctionPrototype.get());
-    m_asyncFunctionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, asyncFunctionConstructor, DontEnum | ReadOnly);
-    m_asyncFunctionStructure.set(vm, this, JSAsyncFunction::createStructure(vm, this, m_asyncFunctionPrototype.get()));
-
     m_generatorFunctionPrototype.set(vm, this, GeneratorFunctionPrototype::create(vm, GeneratorFunctionPrototype::createStructure(vm, this, m_functionPrototype.get())));
     GeneratorFunctionConstructor* generatorFunctionConstructor = GeneratorFunctionConstructor::create(vm, GeneratorFunctionConstructor::createStructure(vm, this, functionConstructor), m_generatorFunctionPrototype.get());
     m_generatorFunctionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, generatorFunctionConstructor, DontEnum);
@@ -772,8 +764,6 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct
         GlobalPropertyInfo(vm.propertyNames->builtinNames().generatorResumePrivateName(), JSFunction::createBuiltinFunction(vm, generatorPrototypeGeneratorResumeCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
         GlobalPropertyInfo(vm.propertyNames->builtinNames().thisTimeValuePrivateName(), privateFuncThisTimeValue, DontEnum | DontDelete | ReadOnly),
         GlobalPropertyInfo(vm.propertyNames->builtinNames().thisNumberValuePrivateName(), privateFuncThisNumberValue, DontEnum | DontDelete | ReadOnly),
-        GlobalPropertyInfo(vm.propertyNames->builtinNames().asyncFunctionResumePrivateName(), JSFunction::createBuiltinFunction(vm, asyncFunctionPrototypeAsyncFunctionResumeCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly),
-
 #if ENABLE(INTL)
         GlobalPropertyInfo(vm.propertyNames->builtinNames().CollatorPrivateName(), intl->getDirect(vm, vm.propertyNames->Collator), DontEnum | DontDelete | ReadOnly),
         GlobalPropertyInfo(vm.propertyNames->builtinNames().DateTimeFormatPrivateName(), intl->getDirect(vm, vm.propertyNames->DateTimeFormat), DontEnum | DontDelete | ReadOnly),
@@ -1226,7 +1216,7 @@ UnlinkedProgramCodeBlock* JSGlobalObject::createProgramCodeBlock(CallFrame* call
     JSParserStrictMode strictMode = executable->isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
     DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
     UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getProgramCodeBlock(
-        vm(), runtimeFlags(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, 
+        vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, 
         debuggerMode, error);
 
     if (hasDebugger())
@@ -1248,7 +1238,7 @@ UnlinkedEvalCodeBlock* JSGlobalObject::createEvalCodeBlock(CallFrame* callFrame,
     EvalContextType evalContextType = executable->executableInfo().evalContextType();
     
     UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm().codeCache()->getEvalCodeBlock(
-        vm(), runtimeFlags(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
+        vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
 
     if (hasDebugger())
         debugger()->sourceParsed(callFrame, executable->source().provider(), error.line(), error.message());
@@ -1266,7 +1256,7 @@ UnlinkedModuleProgramCodeBlock* JSGlobalObject::createModuleProgramCodeBlock(Cal
     ParserError error;
     DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
     UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getModuleProgramCodeBlock(
-        vm(), runtimeFlags(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, error);
+        vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, error);
 
     if (hasDebugger())
         debugger()->sourceParsed(callFrame, executable->source().provider(), error.line(), error.message());
index 0d5e9d6..e952342 100644 (file)
@@ -56,7 +56,6 @@ class JSGlobalObjectInspectorController;
 namespace JSC {
 
 class ArrayPrototype;
-class AsyncFunctionPrototype;
 class BooleanPrototype;
 class ConsoleClient;
 class Debugger;
@@ -257,7 +256,6 @@ public:
     WriteBarrier<ObjectPrototype> m_objectPrototype;
     WriteBarrier<FunctionPrototype> m_functionPrototype;
     WriteBarrier<ArrayPrototype> m_arrayPrototype;
-    WriteBarrier<AsyncFunctionPrototype> m_asyncFunctionPrototype;
     WriteBarrier<RegExpPrototype> m_regExpPrototype;
     WriteBarrier<IteratorPrototype> m_iteratorPrototype;
     WriteBarrier<GeneratorFunctionPrototype> m_generatorFunctionPrototype;
@@ -299,7 +297,6 @@ public:
     PropertyOffset m_functionNameOffset;
     WriteBarrier<Structure> m_privateNameStructure;
     WriteBarrier<Structure> m_regExpStructure;
-    WriteBarrier<Structure> m_asyncFunctionStructure;
     WriteBarrier<Structure> m_generatorFunctionStructure;
     WriteBarrier<Structure> m_dollarVMStructure;
     WriteBarrier<Structure> m_iteratorResultObjectStructure;
@@ -504,7 +501,6 @@ public:
     ObjectPrototype* objectPrototype() const { return m_objectPrototype.get(); }
     FunctionPrototype* functionPrototype() const { return m_functionPrototype.get(); }
     ArrayPrototype* arrayPrototype() const { return m_arrayPrototype.get(); }
-    AsyncFunctionPrototype* asyncFunctionPrototype() const { return m_asyncFunctionPrototype.get(); }
     JSObject* booleanPrototype() const { return m_booleanObjectStructure.prototype(this); }
     StringPrototype* stringPrototype() const { return m_stringPrototype.get(); }
     SymbolPrototype* symbolPrototype() const { return m_symbolPrototype.get(); }
@@ -573,7 +569,6 @@ public:
     Structure* privateNameStructure() const { return m_privateNameStructure.get(); }
     Structure* mapStructure() const { return m_mapStructure.get(); }
     Structure* regExpStructure() const { return m_regExpStructure.get(); }
-    Structure* asyncFunctionStructure() const { return m_asyncFunctionStructure.get(); }
     Structure* generatorFunctionStructure() const { return m_generatorFunctionStructure.get(); }
     Structure* setStructure() const { return m_setStructure.get(this); }
     Structure* stringObjectStructure() const { return m_stringObjectStructure.get(); }
index 5555d0b..20a4a6a 100644 (file)
@@ -275,7 +275,7 @@ EncodedJSValue JSC_HOST_CALL moduleLoaderObjectParseModule(ExecState* exec)
 
     ParserError error;
     std::unique_ptr<ModuleProgramNode> moduleProgramNode = parse<ModuleProgramNode>(
-        &vm, exec->vmEntryGlobalObject()->runtimeFlags(), sourceCode, Identifier(), JSParserBuiltinMode::NotBuiltin,
+        &vm, sourceCode, Identifier(), JSParserBuiltinMode::NotBuiltin,
         JSParserStrictMode::Strict, SourceParseMode::ModuleAnalyzeMode, SuperBinding::NotNeeded, error);
 
     if (error.isValid()) {
index 25a777c..8cd30c6 100644 (file)
@@ -30,9 +30,8 @@
 
 namespace JSC {
 
-// macro(name, flagName, isEnabledFlag)
-#define JSC_RUNTIME_FLAG(macro) \
-    macro(AsyncAwaitEnabled, true)
+// macro(name, isEnabledFlag)
+#define JSC_RUNTIME_FLAG(macro)
 
 class RuntimeFlags {
 private:
@@ -91,16 +90,6 @@ public:
         );
     }
 
-    bool operator==(const RuntimeFlags& other) const
-    {
-        return m_flags == other.m_flags;
-    }
-
-    bool operator!=(const RuntimeFlags& other) const
-    {
-        return m_flags != other.m_flags;
-    }
-
 private:
     unsigned m_flags;
 };
diff --git a/Source/JavaScriptCore/tests/stress/async-await-basic.js b/Source/JavaScriptCore/tests/stress/async-await-basic.js
deleted file mode 100644 (file)
index cdf79c7..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-function shouldBe(expected, actual, msg) {
-    if (msg === void 0)
-        msg = "";
-    else
-        msg = " for " + msg;
-    if (actual !== expected)
-        throw new Error("bad value" + msg + ": " + actual + ". Expected " + expected);
-}
-
-function shouldBeAsync(expected, run, msg) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (hadError)
-        throw actual;
-
-    shouldBe(expected, actual, msg);
-}
-
-function shouldThrow(run, errorType, message) {
-    let actual;
-    var hadError = false;
-
-    try {
-        actual = run();
-    } catch (e) {
-        hadError = true;
-        actual = e;
-    }
-
-    if (!hadError)
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but did not throw.");
-    if (!(actual instanceof errorType))
-        throw new Error("Expeced " + run + "() to throw " + errorType.name + " , but threw '" + actual + "'");
-    if (message !== void 0 && actual.message !== message)
-        throw new Error("Expected " + run + "() to throw '" + message + "', but threw '" + actual.message + "'");
-}
-
-function shouldThrowAsync(run, errorType, message) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (!hadError)
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but did not throw.");
-    if (!(actual instanceof errorType))
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but threw '" + actual + "'");
-    if (message !== void 0 && actual.message !== message)
-        throw new Error("Expected " + run + "() to throw '" + message + "', but threw '" + actual.message + "'");
-}
-
-function shouldThrowSyntaxError(str, message) {
-    try {
-        eval(str);
-        throw new Error("Expected `" + str + "` to throw a SyntaxError, but did not throw.")
-    } catch (e) {
-        if (e.constructor !== SyntaxError)
-            throw new Error("Expected `" + str + "` to throw a SyntaxError, but threw '" + e + "'");
-        if (message !== void 0 && e.message !== message)
-            throw new Error("Expected `" + str + "` to throw SyntaxError: '" + message + "', but threw '" + e + "'");
-    }
-}
-
-// Do not install `AsyncFunction` constructor on global object
-shouldBe(undefined, this.AsyncFunction);
-let AsyncFunction = (async function() {}).constructor;
-
-// Let functionPrototype be the intrinsic object %AsyncFunctionPrototype%.
-async function asyncFunctionForProto() {}
-shouldBe(AsyncFunction.prototype, Object.getPrototypeOf(asyncFunctionForProto));
-shouldBe(AsyncFunction.prototype, Object.getPrototypeOf(async function() {}));
-shouldBe(AsyncFunction.prototype, Object.getPrototypeOf(async () => {}));
-shouldBe(AsyncFunction.prototype, Object.getPrototypeOf({ async method() {} }.method));
-
-// FIXME: AsyncFunction constructor should build functions with correct prototype.
-// shouldBe(AsyncFunction.prototype, Object.getPrototypeOf(AsyncFunction()));
-
-// AsyncFunctionCreate does not produce an object with a Prototype
-shouldBe(undefined, asyncFunctionForProto.prototype);
-shouldBe(false, asyncFunctionForProto.hasOwnProperty("prototype"));
-shouldBe(undefined, (async function() {}).prototype);
-shouldBe(false, (async function() {}).hasOwnProperty("prototype"));
-shouldBe(undefined, (async() => {}).prototype);
-shouldBe(false, (async() => {}).hasOwnProperty("prototype"));
-shouldBe(undefined, ({ async method() {} }).method.prototype);
-shouldBe(false, ({ async method() {} }).method.hasOwnProperty("prototype"));
-shouldBe(undefined, AsyncFunction().prototype);
-shouldBe(false, AsyncFunction().hasOwnProperty("prototype"));
-
-// AsyncFunction.prototype[ @@toStringTag ]
-var descriptor = Object.getOwnPropertyDescriptor(AsyncFunction.prototype, Symbol.toStringTag);
-shouldBe("AsyncFunction", descriptor.value);
-shouldBe(false, descriptor.enumerable);
-shouldBe(false, descriptor.writable);
-shouldBe(true, descriptor.configurable);
-
-shouldBe(1, AsyncFunction.length);
-
-// Let F be ! FunctionAllocate(functionPrototype, Strict, "non-constructor")
-async function asyncNonConstructorDecl() {}
-shouldThrow(() => new asyncNonConstructorDecl(), TypeError);
-shouldThrow(() => new (async function() {}), TypeError);
-shouldThrow(() => new ({ async nonConstructor() {} }).nonConstructor(), TypeError);
-shouldThrow(() => new (() => "not a constructor!"), TypeError);
-shouldThrow(() => new (AsyncFunction()), TypeError);
-
-// Normal completion
-async function asyncDecl() { return "test"; }
-shouldBeAsync("test", asyncDecl);
-shouldBeAsync("test2", async function() { return "test2"; });
-shouldBeAsync("test3", async () => "test3");
-shouldBeAsync("test4", () => ({ async f() { return "test4"; } }).f());
-
-class MyError extends Error {};
-
-// Throw completion
-async function asyncDeclThrower(e) { throw new MyError(e); }
-shouldThrowAsync(() => asyncDeclThrower("boom!"), MyError, "boom!");
-shouldThrowAsync(() => (async function(e) { throw new MyError(e); })("boom!!!"), MyError, "boom!!!");
-shouldThrowAsync(() => (async e => { throw new MyError(e) })("boom!!"), MyError, "boom!!");
-shouldThrowAsync(() => ({ async thrower(e) { throw new MyError(e); } }).thrower("boom!!!!"), MyError, "boom!!!!");
-
-function resolveLater(value) { return Promise.resolve(value); }
-function rejectLater(error) { return Promise.reject(error); }
-
-// Resume after Normal completion
-var log = [];
-async function resumeAfterNormal(value) {
-    log.push("start:" + value);
-    value = await resolveLater(value + 1);
-    log.push("resume:" + value);
-    value = await resolveLater(value + 1);
-    log.push("resume:" + value);
-    return value + 1;
-}
-
-shouldBeAsync(4, () => resumeAfterNormal(1));
-shouldBe("start:1 resume:2 resume:3", log.join(" "));
-
-var O = {
-    async resumeAfterNormal(value) {
-        log.push("start:" + value);
-        value = await resolveLater(value + 1);
-        log.push("resume:" + value);
-        value = await resolveLater(value + 1);
-        log.push("resume:" + value);
-        return value + 1;
-    }
-};
-log = [];
-shouldBeAsync(5, () => O.resumeAfterNormal(2));
-shouldBe("start:2 resume:3 resume:4", log.join(" "));
-
-var resumeAfterNormalArrow = async (value) => {
-    log.push("start:" + value);
-    value = await resolveLater(value + 1);
-    log.push("resume:" + value);
-    value = await resolveLater(value + 1);
-    log.push("resume:" + value);
-    return value + 1;
-};
-log = [];
-shouldBeAsync(6, () => resumeAfterNormalArrow(3));
-shouldBe("start:3 resume:4 resume:5", log.join(" "));
-
-var resumeAfterNormalEval = AsyncFunction("value", `
-    log.push("start:" + value);
-    value = await resolveLater(value + 1);
-    log.push("resume:" + value);
-    value = await resolveLater(value + 1);
-    log.push("resume:" + value);
-    return value + 1;
-`);
-log = [];
-shouldBeAsync(7, () => resumeAfterNormalEval(4));
-shouldBe("start:4 resume:5 resume:6", log.join(" "));
-
-// Resume after Throw completion
-async function resumeAfterThrow(value) {
-    log.push("start:" + value);
-    try {
-        value = await rejectLater("throw1");
-    } catch (e) {
-        log.push("resume:" + e);
-    }
-    try {
-        value = await rejectLater("throw2");
-    } catch (e) {
-        log.push("resume:" + e);
-    }
-    return value + 1;
-}
-
-log = [];
-shouldBeAsync(2, () => resumeAfterThrow(1));
-shouldBe("start:1 resume:throw1 resume:throw2", log.join(" "));
-
-var O = {
-    async resumeAfterThrow(value) {
-        log.push("start:" + value);
-        try {
-            value = await rejectLater("throw1");
-        } catch (e) {
-            log.push("resume:" + e);
-        }
-        try {
-            value = await rejectLater("throw2");
-        } catch (e) {
-            log.push("resume:" + e);
-        }
-        return value + 1;
-    }
-}
-log = [];
-shouldBeAsync(3, () => O.resumeAfterThrow(2));
-shouldBe("start:2 resume:throw1 resume:throw2", log.join(" "));
-
-var resumeAfterThrowArrow = async (value) => {
-    log.push("start:" + value);
-    try {
-        value = await rejectLater("throw1");
-    } catch (e) {
-        log.push("resume:" + e);
-    }
-    try {
-        value = await rejectLater("throw2");
-    } catch (e) {
-        log.push("resume:" + e);
-    }
-    return value + 1;
-};
-log = [];
-shouldBeAsync(4, () => resumeAfterThrowArrow(3));
-shouldBe("start:3 resume:throw1 resume:throw2", log.join(" "));
-
-var resumeAfterThrowEval = AsyncFunction("value", `
-    log.push("start:" + value);
-    try {
-        value = await rejectLater("throw1");
-    } catch (e) {
-        log.push("resume:" + e);
-    }
-    try {
-        value = await rejectLater("throw2");
-    } catch (e) {
-        log.push("resume:" + e);
-    }
-    return value + 1;
-`);
-log = [];
-shouldBeAsync(5, () => resumeAfterThrowEval(4));
-shouldBe("start:4 resume:throw1 resume:throw2", log.join(" "));
-
-// MethoodDefinition SyntaxErrors
-shouldThrowSyntaxError("var obj = { async foo : true };", "Unexpected token ':'. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async foo = true };", "Unexpected token '='. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async foo , bar };", "Unexpected token ','. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async foo }", "Unexpected token '}'. Expected a parenthesis for argument list.");
-
-shouldThrowSyntaxError("var obj = { async 0 : true };", "Unexpected token ':'. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async 0 = true };", "Unexpected token '='. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async 0 , bar };", "Unexpected token ','. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async 0 }", "Unexpected token '}'. Expected a parenthesis for argument list.");
-
-shouldThrowSyntaxError("var obj = { async 'foo' : true };", "Unexpected token ':'. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async 'foo' = true };", "Unexpected token '='. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async 'foo' , bar };", "Unexpected token ','. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async 'foo' }", "Unexpected token '}'. Expected a parenthesis for argument list.");
-
-shouldThrowSyntaxError("var obj = { async ['foo'] : true };", "Unexpected token ':'. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async ['foo'] = true };", "Unexpected token '='. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async ['foo'] , bar };", "Unexpected token ','. Expected a parenthesis for argument list.");
-shouldThrowSyntaxError("var obj = { async ['foo'] }", "Unexpected token '}'. Expected a parenthesis for argument list.");
-
-shouldThrowSyntaxError("class C { async foo : true };", "Unexpected token ':'. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async foo = true };", "Unexpected token '='. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async foo , bar };", "Unexpected token ','. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async foo }", "Unexpected token '}'. Expected an opening '(' before a async method's parameter list.");
-
-shouldThrowSyntaxError("class C { async 0 : true };", "Unexpected token ':'. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async 0 = true };", "Unexpected token '='. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async 0 , bar };", "Unexpected token ','. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async 0 }", "Unexpected token '}'. Expected an opening '(' before a async method's parameter list.");
-
-shouldThrowSyntaxError("class C { async 'foo' : true };", "Unexpected token ':'. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async 'foo' = true };", "Unexpected token '='. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async 'foo' , bar };", "Unexpected token ','. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async 'foo' }", "Unexpected token '}'. Expected an opening '(' before a async method's parameter list.");
-
-shouldThrowSyntaxError("class C { async ['foo'] : true };", "Unexpected token ':'. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async ['foo'] = true };", "Unexpected token '='. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async ['foo'] , bar };", "Unexpected token ','. Expected an opening '(' before a async method's parameter list.");
-shouldThrowSyntaxError("class C { async ['foo'] }", "Unexpected token '}'. Expected an opening '(' before a async method's parameter list.");
-
diff --git a/Source/JavaScriptCore/tests/stress/async-await-module-reserved-word.js b/Source/JavaScriptCore/tests/stress/async-await-module-reserved-word.js
deleted file mode 100644 (file)
index eb2562c..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-function shouldThrow(func, errorMessage) {
-    var errorThrown = false;
-    var error = null;
-    try {
-        func();
-    } catch (e) {
-        errorThrown = true;
-        error = e;
-    }
-    if (!errorThrown)
-        throw new Error('not thrown');
-    if (String(error) !== errorMessage)
-        throw new Error(`bad error: ${String(error)}`);
-}
-
-function checkModuleSyntaxError(source, errorMessage) {
-    shouldThrow(() => checkModuleSyntax(source), errorMessage);
-}
-
-checkModuleSyntaxError(String.raw`
-var await;
-`, `SyntaxError: Can't use 'await' as a variable name in a module.:2`);
-checkModuleSyntaxError(`
-export var await;
-`, `SyntaxError: Can't use 'await' as a variable name in a module.:2`);
-checkModuleSyntaxError(String.raw`
-let await;
-`, `SyntaxError: Can't use 'await' as a lexical variable name in a module.:2`);
-checkModuleSyntaxError(String.raw`
-export let await;
-`, `SyntaxError: Can't use 'await' as a lexical variable name in a module.:2`);
-checkModuleSyntaxError(String.raw`
-const await = 1
-`, `SyntaxError: Can't use 'await' as a lexical variable name in a module.:2`);
-checkModuleSyntaxError(String.raw`
-export const await = 1
-`, `SyntaxError: Can't use 'await' as a lexical variable name in a module.:2`);
-
-checkModuleSyntaxError(String.raw`
-function await() {}
-`, `SyntaxError: Cannot declare function named 'await' in a module.:2`);
-checkModuleSyntaxError(String.raw`
-function* await() {}
-`, `SyntaxError: Cannot declare function named 'await' in a module.:2`);
-checkModuleSyntaxError(String.raw`
-async function await() {}
-`, `SyntaxError: Cannot declare function named 'await' in a module.:2`);
-
-checkModuleSyntaxError(String.raw`
-import {await} from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
-checkModuleSyntaxError(String.raw`
-import {foo as await} from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
-checkModuleSyntaxError(String.raw`
-import * as await from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
-checkModuleSyntaxError(String.raw`
-import await, {x, y, z} from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
-checkModuleSyntaxError(String.raw`
-import await, {x, y, z,} from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
-checkModuleSyntaxError(String.raw`
-import await from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
-checkModuleSyntaxError(String.raw`
-import await, * as foo from 'foo';
-`, `SyntaxError: Cannot use 'await' as an imported binding name.:2`);
diff --git a/Source/JavaScriptCore/tests/stress/async-await-mozilla.js b/Source/JavaScriptCore/tests/stress/async-await-mozilla.js
deleted file mode 100644 (file)
index eac71aa..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://moz.org/MPL/2.0/. */
-
-function shouldBe(expected, actual, msg) {
-    if (msg === void 0)
-        msg = "";
-    else
-        msg = " for " + msg;
-    if (actual !== expected)
-        throw new Error("bad value" + msg + ": " + actual + ". Expected " + expected);
-}
-
-function shouldBeAsync(expected, run, msg) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-    if (hadError)
-        throw actual;
-    shouldBe(expected, actual, msg);
-}
-
-function shouldThrow(run, errorType, message) {
-    let actual;
-    var hadError = false;
-    try {
-        actual = run();
-    } catch (e) {
-        hadError = true;
-        actual = e;
-    }
-    if (!hadError)
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but did not throw.");
-    if (!(actual instanceof errorType))
-        throw new Error("Expeced " + run + "() to throw " + errorType.name + " , but threw '" + actual + "'");
-    if (message !== void 0 && actual.message !== message)
-        throw new Error("Expected " + run + "() to throw '" + message + "', but threw '" + actual.message + "'");
-}
-
-function shouldThrowAsync(run, errorType, message) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-    if (!hadError)
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but did not throw.");
-    if (!(actual instanceof errorType))
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but threw '" + actual + "'");
-    if (message !== void 0 && actual.message !== message)
-        throw new Error("Expected " + run + "() to throw '" + message + "', but threw '" + actual.message + "'");
-}
-
-function assert(cond, msg = "") {
-    if (!cond)
-        throw new Error(msg);
-}
-
-function shouldThrowSyntaxError(str, message) {
-    var hadError = false;
-    try {
-        eval(str);
-    } catch (e) {
-        if (e instanceof SyntaxError) {
-            hadError = true;
-            if (typeof message === "string")
-                assert(e.message === message, "Expected '" + message + "' but threw '" + e.message + "'");
-        }
-    }
-    assert(hadError, "Did not throw syntax error");
-}
-
-// semantics.js
-(function mozSemantics() {
-
-async function empty() {
-}
-
-async function simpleReturn() {
-    return 1;
-}
-
-async function simpleAwait() {
-    var result = await 2;
-    return result;
-}
-
-async function simpleAwaitAsync() {
-    var result = await simpleReturn();
-    return 2 + result;
-}
-
-async function returnOtherAsync() {
-    return 1 + await simpleAwaitAsync();
-}
-
-async function simpleThrower() {
-    throw new Error();
-}
-
-async function delegatedThrower() {
-    var val = await simpleThrower();
-    return val;
-}
-
-async function tryCatch() {
-    try {
-        await delegatedThrower();
-        return 'FAILED';
-    } catch (_) {
-        return 5;
-    }
-}
-
-async function tryCatchThrow() {
-    try {
-        await delegatedThrower();
-        return 'FAILED';
-    } catch (_) {
-        return delegatedThrower();
-    }
-}
-
-async function wellFinally() {
-    try {
-        await delegatedThrower();
-    } catch (_) {
-        return 'FAILED';
-    } finally {
-        return 6;
-    }
-}
-
-async function finallyMayFail() {
-    try {
-        await delegatedThrower();
-    } catch (_) {
-        return 5;
-    } finally {
-        return delegatedThrower();
-    }
-}
-
-async function embedded() {
-    async function inner() {
-        return 7;
-    }
-    return await inner();
-}
-
-// recursion, it works!
-async function fib(n) {
-    return (n == 0 || n == 1) ? n : await fib(n - 1) + await fib(n - 2);
-}
-
-// mutual recursion
-async function isOdd(n) {
-    async function isEven(n) {
-        return n === 0 || await isOdd(n - 1);
-    }
-    return n !== 0 && await isEven(n - 1);
-}
-
-// recursion, take three!
-var hardcoreFib = async function fib2(n) {
-    return (n == 0 || n == 1) ? n : await fib2(n - 1) + await fib2(n - 2);
-}
-
-var asyncExpr = async function() {
-    return 10;
-}
-
-var namedAsyncExpr = async function simple() {
-    return 11;
-}
-
-async function executionOrder() {
-    var value = 0;
-    async function first() {
-        return (value = value === 0 ? 1 : value);
-    }
-    async function second() {
-        return (value = value === 0 ? 2 : value);
-    }
-    async function third() {
-        return (value = value === 0 ? 3 : value);
-    }
-    return await first() + await second() + await third() + 6;
-}
-
-async function miscellaneous() {
-    if (arguments.length === 3 &&
-        arguments.callee.name === "miscellaneous")
-        return 14;
-}
-
-function thrower() {
-    throw 15;
-}
-
-async function defaultArgs(arg = thrower()) {
-}
-
-// Async functions are not constructible
-shouldThrow(() => {
-    async function Person() {
-    }
-    new Person();
-}, TypeError);
-
-shouldBeAsync(undefined, empty);
-shouldBeAsync(1, simpleReturn);
-shouldBeAsync(2, simpleAwait);
-shouldBeAsync(3, simpleAwaitAsync);
-shouldBeAsync(4, returnOtherAsync);
-shouldThrowAsync(simpleThrower, Error);
-shouldBeAsync(5, tryCatch);
-shouldBeAsync(6, wellFinally);
-shouldThrowAsync(finallyMayFail, Error);
-shouldBeAsync(7, embedded);
-shouldBeAsync(8, () => fib(6));
-shouldBeAsync(9, executionOrder);
-shouldBeAsync(10, asyncExpr);
-shouldBeAsync(11, namedAsyncExpr);
-shouldBeAsync(12, () => isOdd(12).then(v => v ? "oops" : 12));
-shouldBeAsync(13, () => hardcoreFib(7));
-shouldBeAsync(14, () => miscellaneous(1, 2, 3));
-shouldBeAsync(15, () => defaultArgs().catch(e => e));
-
-})();
-
-// methods.js
-(function mozMethods() {
-
-class X {
-    constructor() {
-        this.value = 42;
-    }
-    async getValue() {
-        return this.value;
-    }
-    setValue(value) {
-        this.value = value;
-    }
-    async increment() {
-        var value = await this.getValue();
-        this.setValue(value + 1);
-        return this.getValue();
-    }
-    async getBaseClassName() {
-        return 'X';
-    }
-    static async getStaticValue() {
-        return 44;
-    }
-}
-
-class Y extends X {
-    async getBaseClassName() {
-        return super.getBaseClassName();
-    }
-}
-
-var objLiteral = {
-    async get() {
-        return 45;
-    },
-    someStuff: 5
-};
-
-var x = new X();
-var y = new Y();
-
-shouldBeAsync(42, () => x.getValue());
-shouldBeAsync(43, () => x.increment());
-shouldBeAsync(44, () => X.getStaticValue());
-shouldBeAsync(45, () => objLiteral.get());
-shouldBeAsync('X', () => y.getBaseClassName());
-
-})();
-
-(function mozFunctionNameInferrence() {
-
-async function test() { }
-
-var anon = async function() { }
-
-shouldBe("test", test.name);
-shouldBe("anon", anon.name);
-
-})();
-
-(function mozSyntaxErrors() {
-
-shouldThrowSyntaxError("'use strict'; async function eval() {}");
-shouldThrowSyntaxError("'use strict'; async function arguments() {}");
-shouldThrowSyntaxError("async function a(k = super.prop) { }");
-shouldThrowSyntaxError("async function a() { super.prop(); }");
-shouldThrowSyntaxError("async function a() { super(); }");
-shouldThrowSyntaxError("async function a(k = await 3) {}");
-
-})();
diff --git a/Source/JavaScriptCore/tests/stress/async-await-reserved-word.js b/Source/JavaScriptCore/tests/stress/async-await-reserved-word.js
deleted file mode 100644 (file)
index 9c9f104..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-function assert(cond, msg = "") {
-    if (!cond)
-        throw new Error(msg);
-}
-noInline(assert);
-
-function shouldThrowSyntaxError(str, message) {
-    var hadError = false;
-    try {
-        eval(str);
-    } catch (e) {
-        if (e instanceof SyntaxError) {
-            hadError = true;
-            if (typeof message === "string")
-                assert(e.message === message, "Expected '" + message + "' but threw '" + e.message + "'");
-        }
-    }
-    assert(hadError, "Did not throw syntax error");
-}
-noInline(shouldThrowSyntaxError);
-
-var AsyncFunction = (async function() {}).constructor;
-
-// AsyncFunctionExpression
-shouldThrowSyntaxError("(async function() { var await; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("(async function() { var [await] = []; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("(async function() { var [...await] = []; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("(async function() { var {await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("(async function() { var {isAsync: await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("(async function() { var {isAsync: await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("(async function() { let await; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { let [await] = []; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { let [...await] = []; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { let {await} = {}; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { let {isAsync: await} = {}; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { let {isAsync: await} = {}; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { const await; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { const [await] = []; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { const [...await] = []; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { const {await} = {}; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { const {isAsync: await} = {}; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { const {isAsync: await} = {}; })", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("(async function() { function await() {} })", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("(async function() { async function await() {} })", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("(async function(await) {})", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("(async function f([await]) {})", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("(async function f([...await]) {})", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("(async function f(...await) {})", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("(async function f({await}) {})", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("(async function f({isAsync: await}) {})", "Can't use 'await' as a parameter name in an async function.");
-
-// AsyncFunctionDeclaration
-shouldThrowSyntaxError("async function f() { var await; }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("async function f() { var [await] = []; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("async function f() { var [...await] = []; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("async function f() { var {await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("async function f() { var {isAsync: await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("async function f() { var {isAsync: await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("async function f() { let await; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { let [await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { let [...await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { let {await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { let {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { let {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { const await; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { const [await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { const [...await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { const {await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { const {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { const {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("async function f() { function await() {} }", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("async function f() { async function await() {} }", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("async function f(await) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("async function f([await]) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("async function f([...await]) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("async function f(...await) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("async function f({await}) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("async function f({isAsync: await}) {}", "Can't use 'await' as a parameter name in an async function.");
-
-// AsyncArrowFunction
-shouldThrowSyntaxError("var f = async () => { var await; }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { var [await] = []; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { var [...await] = []; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { var {await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { var {isAsync: await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { var {isAsync: await} = {}; })", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { let await; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { let [await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { let [...await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { let {await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { let {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { let {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { const await; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { const [await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { const [...await] = []; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { const {await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { const {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { const {isAsync: await} = {}; }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var f = async () => { function await() {} }", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("var f = async () => { async function await() {} }", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("var f = async (await) => {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var f = async ([await]) => {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var f = async ([...await]) => {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var f = async (...await) => {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var f = async ({await}) => {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var f = async ({isAsync: await}) => {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var f = async await => {}", "Can't use 'await' as a parameter name in an async function.");
-
-// AsyncMethod
-shouldThrowSyntaxError("var O = { async f() { var await; } }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { var [await] = []; } }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { var [...await] = []; } }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { var {await} = {}; } }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { var {isAsync: await} = {}; } }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { var {isAsync: await} = {}; } }", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { let await; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { let [await] = []; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { let [...await] = []; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { let {await} = {}; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { let {isAsync: await} = {}; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { let {isAsync: await} = {}; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { const await; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { const [await] = []; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { const [...await] = []; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { const {await} = {}; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { const {isAsync: await} = {}; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { const {isAsync: await} = {}; } }", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("var O = { async f() { function await() {} }", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("var O = { async f() { async function await() {} } }", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("var O = { async f(await) {} } ", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var O = { async f([await]) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var O = { async f([...await]) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var O = { async f(...await) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var O = { async f({await}) {}", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("var O = { async f({isAsync: await}) {}", "Can't use 'await' as a parameter name in an async function.");
-
-// AsyncFunction constructor
-shouldThrowSyntaxError("AsyncFunction('var await;')", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('var [await] = [];')", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('var [...await] = [];')", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('var {await} = {};')", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('var {isAsync: await} = {};')", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('var {isAsync: await} = {};')", "Can't use 'await' as a variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('let await;')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('let [await] = [];')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('let [...await] = [];')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('let {await} = {};')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('let {isAsync: await} = {};')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('let {isAsync: await} = {};')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('const await;')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('const [await] = [];')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('const [...await] = [];')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('const {await} = {};')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('const {isAsync: await} = {};')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('const {isAsync: await} = {};')", "Can't use 'await' as a lexical variable name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('function await() {}')", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("AsyncFunction('async function await() {}')", "Cannot declare function named 'await' in an async function.");
-shouldThrowSyntaxError("AsyncFunction('await', '')", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('[await]', '')", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('[...await]', '')", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('...await', '')", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('{await}', '')", "Can't use 'await' as a parameter name in an async function.");
-shouldThrowSyntaxError("AsyncFunction('{isAsync: await}', '')", "Can't use 'await' as a parameter name in an async function.");
diff --git a/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_arguments_binding.js b/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_arguments_binding.js
deleted file mode 100644 (file)
index 1c6764a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-function shouldBe(expected, actual, msg) {
-    if (msg === void 0)
-        msg = "";
-    else
-        msg = " for " + msg;
-    if (actual !== expected)
-        throw new Error("bad value" + msg + ": " + actual + ". Expected " + expected);
-}
-
-function shouldBeAsync(expected, run, msg) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (hadError)
-        throw actual;
-
-    shouldBe(expected, actual, msg);
-}
-
-function shouldThrowAsync(run, errorType, message) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (!hadError)
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but did not throw.");
-    if (!(actual instanceof errorType))
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but threw '" + actual + "'");
-    if (message !== void 0 && actual.message !== message)
-        throw new Error("Expected " + run + "() to throw '" + message + "', but threw '" + actual.message + "'");
-}
-
-var noArgumentsArrow = async () => await [...arguments];
-shouldThrowAsync(() => noArgumentsArrow(1, 2, 3), ReferenceError);
-var noArgumentsArrow2 = async () => { return await [...arguments]; }
-shouldThrowAsync(() => noArgumentsArrow2(1, 2, 3), ReferenceError);
-
-shouldBeAsync("[1,2,3]", () => (function() { return (async () => JSON.stringify([...arguments]))(); })(1, 2, 3));
-shouldBeAsync("[4,5,6]", () => (function() { return (async () => { return JSON.stringify([...await arguments]) })(); })(4, 5, 6));
diff --git a/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_new.target_binding.js b/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_new.target_binding.js
deleted file mode 100644 (file)
index 36df0a3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-function shouldBe(expected, actual, msg) {
-    if (msg === void 0)
-        msg = "";
-    else
-        msg = " for " + msg;
-    if (actual !== expected)
-        throw new Error("bad value" + msg + ": " + actual + ". Expected " + expected);
-}
-
-function shouldBeAsync(expected, run, msg) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (hadError)
-        throw actual;
-
-    shouldBe(expected, actual, msg);
-}
-
-function shouldThrowAsync(run, errorType, message) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (!hadError)
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but did not throw.");
-    if (!(actual instanceof errorType))
-        throw new Error("Expected " + run + "() to throw " + errorType.name + ", but threw '" + actual + "'");
-    if (message !== void 0 && actual.message !== message)
-        throw new Error("Expected " + run + "() to throw '" + message + "', but threw '" + actual.message + "'");
-}
-
-function C1() {
-    return async () => await new.target;
-}
-
-function C2() {
-    return async () => { return await new.target };
-}
-
-shouldBeAsync(C1, new C1());
-shouldBeAsync(undefined, C1());
-shouldBeAsync(C2, new C2());
-shouldBeAsync(undefined, C2());
-
-shouldThrowAsync(async () => await new.target, ReferenceError);
-shouldThrowAsync(async () => { return await new.target; }, ReferenceError);
diff --git a/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_super_binding.js b/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_super_binding.js
deleted file mode 100644 (file)
index a000463..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-function shouldBe(expected, actual, msg) {
-    if (msg === void 0)
-        msg = "";
-    else
-        msg = " for " + msg;
-    if (actual !== expected)
-        throw new Error("bad value" + msg + ": " + actual + ". Expected " + expected);
-}
-
-function shouldBeAsync(expected, run, msg) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (hadError)
-        throw actual;
-
-    shouldBe(expected, actual, msg);
-}
-
-class BaseClass {
-    baseClassValue() {
-        return "BaseClassValue";
-    }
-    get property() {
-        return "test!";
-    }
-}
-
-class ChildClass extends BaseClass {
-    asyncSuperProp() {
-        return async x => super.baseClassValue();
-    }
-    asyncSuperProp2() {
-        return async x => { return super.baseClassValue(); }
-    }
-}
-
-shouldBeAsync("BaseClassValue", new ChildClass().asyncSuperProp());
-shouldBeAsync("BaseClassValue", new ChildClass().asyncSuperProp2());
-
-class ChildClass2 extends BaseClass {
-    constructor() {
-        return async (self = super()) => self.baseClassValue() + ' ' + super.property;
-    }
-}
-
-shouldBeAsync("BaseClassValue test!", new ChildClass2());
diff --git a/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_this_binding.js b/Source/JavaScriptCore/tests/stress/async_arrow_functions_lexical_this_binding.js
deleted file mode 100644 (file)
index 3d06682..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-function shouldBe(expected, actual, msg) {
-    if (msg === void 0)
-        msg = "";
-    else
-        msg = " for " + msg;
-    if (actual !== expected)
-        throw new Error("bad value" + msg + ": " + actual + ". Expected " + expected);
-}
-
-function shouldBeAsync(expected, run, msg) {
-    let actual;
-    var hadError = false;
-    run().then(function(value) { actual = value; },
-               function(error) { hadError = true; actual = error; });
-    drainMicrotasks();
-
-    if (hadError)
-        throw actual;
-
-    shouldBe(expected, actual, msg);
-}
-
-var d = ({ x : "bar", y : function() { return async z => this.x + z; }}).y();
-var e = { x : "baz", y : d };
-
-shouldBeAsync("barley", () => d("ley"));
-shouldBeAsync("barley", () => e.y("ley"));
index 82b6ec3..9d1f17d 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
+        https://bugs.webkit.org/show_bug.cgi?id=158249
+
+        * WebView/WebPreferencesPrivate.h:
+
 2016-05-27  Chris Dumez  <cdumez@apple.com>
 
         callOnMainThread() should not copy captured lambda variables
index 40ce4d0..23994a6 100644 (file)
@@ -53,7 +53,6 @@ typedef enum {
 } WebStorageBlockingPolicy;
 
 typedef enum {
-    WebKitJavaScriptRuntimeFlagsAsyncAwaitEnabled = 1u << 0,
     WebKitJavaScriptRuntimeFlagsAllEnabled = 0
 } WebKitJavaScriptRuntimeFlags;
 
index 611fdfb..5a6f121 100644 (file)
@@ -1,3 +1,10 @@
+2016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
+        https://bugs.webkit.org/show_bug.cgi?id=158249
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+
 2016-05-27  Caitlin Potter  <caitp@igalia.com>
 
         [JSC] implement async functions proposal
index cdd1689..16af296 100644 (file)
@@ -32,7 +32,6 @@ import "ocidl.idl";
 #endif
 
 typedef enum WebKitJavaScriptRuntimeFlags {
-    WebKitJavaScriptRuntimeFlagsAsyncAwaitEnabled = 1, // 1u << 0
     WebKitJavaScriptRuntimeFlagsAllEnabled = 0
 } WebKitJavaScriptRuntimeFlags;
 
index 6ec9418..b8f6d4e 100644 (file)
@@ -1,3 +1,11 @@
+2016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
+        https://bugs.webkit.org/show_bug.cgi?id=158249
+
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
+
 2016-05-31  Beth Dakin  <bdakin@apple.com>
 
         Add two optional items to WebViewImplDelegate
index 2427223..5e09f66 100644 (file)
@@ -50,7 +50,6 @@ enum WKEditableLinkBehavior {
 typedef enum WKEditableLinkBehavior WKEditableLinkBehavior;
 
 enum WKJavaScriptRuntimeFlags {
-    kWKJavaScriptRuntimeFlagsAsyncAwaitEnabled = 1 << 0,
     kWKJavaScriptRuntimeFlagsAllEnabled = 0
 };
 typedef unsigned WKJavaScriptRuntimeFlagSet;
index d016010..af8dde3 100644 (file)
@@ -43,7 +43,6 @@ typedef NS_OPTIONS(NSUInteger, _WKDebugOverlayRegions) {
 } WK_ENUM_AVAILABLE(10_11, 9_0);
 
 typedef NS_OPTIONS(NSUInteger, _WKJavaScriptRuntimeFlags) {
-    _WKJavaScriptRuntimeFlagsAsyncAwaitEnabled = 1 << 0,
     _WKJavaScriptRuntimeFlagsAllEnabled = 0
 } WK_ENUM_AVAILABLE(10_11, 9_0);