https://bugs.webkit.org/show_bug.cgi?id=142430
Reviewed by Darin Adler.
Removed the debugger argument from UnlinkedFunctionExecutable::fromGlobalCode and
FunctionExecutable::fromGlobalCode since it's not used in either function.
Also use reference in other arguments.
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::fromGlobalCode):
* bytecode/UnlinkedCodeBlock.h:
* runtime/Executable.cpp:
(JSC::FunctionExecutable::fromGlobalCode):
* runtime/Executable.h:
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181208
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-03-07 Ryosuke Niwa <rniwa@webkit.org>
+
+ fromGlobalCode has an unused Debugger* argument
+ https://bugs.webkit.org/show_bug.cgi?id=142430
+
+ Reviewed by Darin Adler.
+
+ Removed the debugger argument from UnlinkedFunctionExecutable::fromGlobalCode and
+ FunctionExecutable::fromGlobalCode since it's not used in either function.
+
+ Also use reference in other arguments.
+
+ * bytecode/UnlinkedCodeBlock.cpp:
+ (JSC::UnlinkedFunctionExecutable::fromGlobalCode):
+ * bytecode/UnlinkedCodeBlock.h:
+ * runtime/Executable.cpp:
+ (JSC::FunctionExecutable::fromGlobalCode):
+ * runtime/Executable.h:
+ * runtime/FunctionConstructor.cpp:
+ (JSC::constructFunctionSkippingEvalEnabledCheck):
+
2015-03-06 Brent Fulgham <bfulgham@apple.com>
[Win] Turn off a warning on Windows.
return FunctionExecutable::create(vm, code, this, firstLine, firstLine + m_lineCount, startColumn, endColumn);
}
-UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(const Identifier& name, ExecState* exec, Debugger*, const SourceCode& source, JSObject** exception)
+UnlinkedFunctionExecutable* UnlinkedFunctionExecutable::fromGlobalCode(const Identifier& name, ExecState& exec, const SourceCode& source, JSObject*& exception)
{
ParserError error;
- VM& vm = exec->vm();
+ VM& vm = exec.vm();
CodeCache* codeCache = vm.codeCache();
UnlinkedFunctionExecutable* executable = codeCache->getFunctionExecutableFromGlobalCode(vm, name, source, error);
- if (exec->lexicalGlobalObject()->hasDebugger())
- exec->lexicalGlobalObject()->debugger()->sourceParsed(exec, source.provider(), error.line(), error.message());
+ auto& globalObject = *exec.lexicalGlobalObject();
+ if (globalObject.hasDebugger())
+ globalObject.debugger()->sourceParsed(&exec, source.provider(), error.line(), error.message());
if (error.isValid()) {
- *exception = error.toErrorObject(exec->lexicalGlobalObject(), source);
+ exception = error.toErrorObject(&globalObject, source);
return nullptr;
}
UnlinkedFunctionCodeBlock* codeBlockFor(VM&, const SourceCode&, CodeSpecializationKind, DebuggerMode, ProfilerMode, bool bodyIncludesBraces, ParserError&);
- static UnlinkedFunctionExecutable* fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
+ static UnlinkedFunctionExecutable* fromGlobalCode(const Identifier&, ExecState&, const SourceCode&, JSObject*& exception);
FunctionExecutable* link(VM&, const SourceCode&, size_t lineOffset);
#endif
}
-FunctionExecutable* FunctionExecutable::fromGlobalCode(const Identifier& name, ExecState* exec, Debugger* debugger, const SourceCode& source, JSObject** exception)
+FunctionExecutable* FunctionExecutable::fromGlobalCode(const Identifier& name, ExecState& exec, const SourceCode& source, JSObject*& exception)
{
- UnlinkedFunctionExecutable* unlinkedExecutable = UnlinkedFunctionExecutable::fromGlobalCode(name, exec, debugger, source, exception);
+ UnlinkedFunctionExecutable* unlinkedExecutable = UnlinkedFunctionExecutable::fromGlobalCode(name, exec, source, exception);
if (!unlinkedExecutable)
return 0;
unsigned lineCount = unlinkedExecutable->lineCount();
unsigned endOffsetExcludingCloseBrace = startOffset + sourceLength - 1;
SourceCode bodySource(source.provider(), startOffsetExcludingOpenBrace, endOffsetExcludingCloseBrace, firstLine, startColumn);
- return FunctionExecutable::create(exec->vm(), bodySource, unlinkedExecutable, firstLine, firstLine + lineCount, startColumn, endColumnExcludingBraces, false);
+ return FunctionExecutable::create(exec.vm(), bodySource, unlinkedExecutable, firstLine, firstLine + lineCount, startColumn, endColumnExcludingBraces, false);
}
String FunctionExecutable::paramString() const
executable->finishCreation(vm);
return executable;
}
- static FunctionExecutable* fromGlobalCode(const Identifier& name, ExecState*, Debugger*, const SourceCode&, JSObject** exception);
+ static FunctionExecutable* fromGlobalCode(const Identifier& name, ExecState&, const SourceCode&, JSObject*& exception);
static void destroy(JSCell*);
}
SourceCode source = makeSource(program, sourceURL, position);
- JSObject* exception = 0;
- FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, exec, exec->vmEntryGlobalObject()->debugger(), source, &exception);
+ JSObject* exception = nullptr;
+ FunctionExecutable* function = FunctionExecutable::fromGlobalCode(functionName, *exec, source, exception);
if (!function) {
ASSERT(exception);
return exec->vm().throwException(exec, exception);