summaryrefslogtreecommitdiffstats
path: root/Source/JavaScriptCore/interpreter/Interpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/interpreter/Interpreter.cpp')
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index cf9f8a1..392e8b8 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -4802,12 +4802,13 @@ JSValue Interpreter::retrieveArguments(CallFrame* callFrame, JSFunction* functio
if (codeBlock->usesArguments()) {
ASSERT(codeBlock->codeType() == FunctionCode);
int argumentsRegister = codeBlock->argumentsRegister();
- if (!functionCallFrame->r(argumentsRegister).jsValue()) {
- JSValue arguments = JSValue(new (callFrame) Arguments(functionCallFrame));
- functionCallFrame->r(argumentsRegister) = arguments;
- functionCallFrame->r(unmodifiedArgumentsRegister(argumentsRegister)) = arguments;
- }
- return functionCallFrame->r(argumentsRegister).jsValue();
+ int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister);
+ if (JSValue arguments = functionCallFrame->uncheckedR(argumentsRegister).jsValue())
+ return arguments;
+ JSValue arguments = JSValue(new (callFrame) Arguments(functionCallFrame));
+ functionCallFrame->r(argumentsRegister) = arguments;
+ functionCallFrame->r(realArgumentsRegister) = arguments;
+ return arguments;
}
Arguments* arguments = new (functionCallFrame) Arguments(functionCallFrame);