Changeset 188752 in webkit for trunk/Source/JavaScriptCore/runtime/Completion.cpp
- Timestamp:
- Aug 20, 2015, 9:59:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Completion.cpp
r188417 r188752 29 29 #include "Exception.h" 30 30 #include "Interpreter.h" 31 #include "JSCInlines.h" 31 32 #include "JSGlobalObject.h" 32 33 #include "JSLock.h" 33 #include "JS CInlines.h"34 #include "JSModuleRecord.h" 34 35 #include "ModuleAnalyzer.h" 35 #include "Module Record.h"36 #include "ModuleLoaderObject.h" 36 37 #include "Parser.h" 37 38 #include <wtf/WTFThreadData.h> … … 64 65 } 65 66 66 bool checkModuleSyntax( VM& vm, const SourceCode& source, ParserError& error)67 bool checkModuleSyntax(ExecState* exec, const SourceCode& source, ParserError& error) 67 68 { 69 VM& vm = exec->vm(); 68 70 JSLockHolder lock(vm); 69 71 RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable()); … … 74 76 return false; 75 77 76 ModuleAnalyzer moduleAnalyzer(vm, moduleProgramNode->varDeclarations(), moduleProgramNode->lexicalVariables()); 78 PrivateName privateName(PrivateName::Description, "EntryPointModule"); 79 ModuleAnalyzer moduleAnalyzer(exec, Identifier::fromUid(privateName), moduleProgramNode->varDeclarations(), moduleProgramNode->lexicalVariables()); 77 80 moduleAnalyzer.analyze(*moduleProgramNode); 78 81 return true; … … 109 112 } 110 113 114 void evaluateModule(ExecState* exec, const SourceCode& source, NakedPtr<Exception>& returnedException) 115 { 116 JSLockHolder lock(exec); 117 RELEASE_ASSERT(exec->vm().atomicStringTable() == wtfThreadData().atomicStringTable()); 118 RELEASE_ASSERT(!exec->vm().isCollectorBusy()); 119 120 CodeProfiling profile(source); 121 122 JSGlobalObject* globalObject = exec->vmEntryGlobalObject(); 123 124 // Generate the unique key for the source-provided module. 125 PrivateName privateName(PrivateName::Description, "EntryPointModule"); 126 Symbol* key = Symbol::create(exec->vm(), *privateName.uid()); 127 128 ModuleLoaderObject* moduleLoader = globalObject->moduleLoader(); 129 130 // Insert the given source code to the ModuleLoader registry as the fetched registry entry. 131 moduleLoader->provide(exec, key, ModuleLoaderObject::Status::Fetch, source.toString()); 132 if (exec->hadException()) { 133 returnedException = exec->exception(); 134 exec->clearException(); 135 return; 136 } 137 138 // FIXME: Now, we don't implement the linking phase yet. 139 // So here, we just call requestInstantiateAll to only perform the module loading. 140 // At last, it should be replaced with requestReady. 141 // https://bugs.webkit.org/show_bug.cgi?id=148172 142 moduleLoader->requestInstantiateAll(exec, key); 143 144 // FIXME: We should also handle the asynchronous Syntax Errors that will be delivered by the rejected promise. 145 // https://bugs.webkit.org/show_bug.cgi?id=148173 146 if (exec->hadException()) { 147 returnedException = exec->exception(); 148 exec->clearException(); 149 return; 150 } 151 } 152 111 153 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.