Changeset 190155 in webkit for trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
- Timestamp:
- Sep 23, 2015, 12:24:42 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
r190113 r190155 36 36 namespace JSC { 37 37 38 static UnlinkedFunctionExecutable* createExecutableInternal(VM&, const SourceCode&, const Identifier&, ConstructorKind, ConstructAbility); 39 38 40 BuiltinExecutables::BuiltinExecutables(VM& vm) 39 41 : m_vm(vm) … … 53 55 break; 54 56 case ConstructorKind::Base: 55 return createExecutableInternal(m akeSource(baseConstructorCode), name, constructorKind, ConstructAbility::CanConstruct);57 return createExecutableInternal(m_vm, makeSource(baseConstructorCode), name, constructorKind, ConstructAbility::CanConstruct); 56 58 case ConstructorKind::Derived: 57 return createExecutableInternal(m akeSource(derivedConstructorCode), name, constructorKind, ConstructAbility::CanConstruct);59 return createExecutableInternal(m_vm, makeSource(derivedConstructorCode), name, constructorKind, ConstructAbility::CanConstruct); 58 60 } 59 61 ASSERT_NOT_REACHED(); … … 61 63 } 62 64 63 UnlinkedFunctionExecutable* BuiltinExecutables::createExecutableInternal(const SourceCode& source, const Identifier& name, ConstructorKind constructorKind, ConstructAbility constructAbility) 65 UnlinkedFunctionExecutable* BuiltinExecutables::createBuiltinExecutable(const SourceCode& code, const Identifier& name, ConstructAbility constructAbility) 66 { 67 return createExecutableInternal(m_vm, code, name, ConstructorKind::None, constructAbility); 68 } 69 70 UnlinkedFunctionExecutable* createBuiltinExecutable(VM& vm, const SourceCode& code, const Identifier& name, ConstructAbility constructAbility) 71 { 72 return createExecutableInternal(vm, code, name, ConstructorKind::None, constructAbility); 73 } 74 75 UnlinkedFunctionExecutable* createExecutableInternal(VM& vm, const SourceCode& source, const Identifier& name, ConstructorKind constructorKind, ConstructAbility constructAbility) 64 76 { 65 77 JSTextPosition positionBeforeLastNewline; … … 70 82 RefPtr<SourceProvider> sourceOverride = isParsingDefaultConstructor ? source.provider() : nullptr; 71 83 std::unique_ptr<ProgramNode> program = parse<ProgramNode>( 72 & m_vm, source, Identifier(), builtinMode,84 &vm, source, Identifier(), builtinMode, 73 85 JSParserStrictMode::NotStrict, SourceParseMode::ProgramMode, error, 74 86 &positionBeforeLastNewline, constructorKind); … … 96 108 RELEASE_ASSERT(metadata); 97 109 for (const auto& closedVariable : program->closedVariables()) { 98 if (closedVariable == m_vm.propertyNames->arguments.impl())110 if (closedVariable == vm.propertyNames->arguments.impl()) 99 111 continue; 100 112 101 if (closedVariable == m_vm.propertyNames->undefinedKeyword.impl())113 if (closedVariable == vm.propertyNames->undefinedKeyword.impl()) 102 114 continue; 103 115 } 104 116 metadata->overrideName(name); 105 117 VariableEnvironment dummyTDZVariables; 106 UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(& m_vm, source, metadata, kind, constructAbility, dummyTDZVariables, WTF::move(sourceOverride));107 functionExecutable-> m_nameValue.set(m_vm, functionExecutable, jsString(&m_vm, name.string()));118 UnlinkedFunctionExecutable* functionExecutable = UnlinkedFunctionExecutable::create(&vm, source, metadata, kind, constructAbility, dummyTDZVariables, WTF::move(sourceOverride)); 119 functionExecutable->setNameValue(vm, jsString(&vm, name.string())); 108 120 return functionExecutable; 109 121 }
Note:
See TracChangeset
for help on using the changeset viewer.