Refactor the function call generator to take the arguments by value
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Apr 2014 21:27:31 +0000 (21:27 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Apr 2014 21:27:31 +0000 (21:27 +0000)
commit2e6dd8476c89c807297a69dc4861a0d9de81f449
treeeba151d19ba9a486734e91124e3e7253b75f3275
parent9e25cb00bf8494c0e39e06fdca18086736d410db
Refactor the function call generator to take the arguments by value
https://bugs.webkit.org/show_bug.cgi?id=131129

Reviewed by Andreas Kling.

Nothing forces the pointed address to stay alive between setOneArgument/setTwoArguments
and prepareAndCall.

This patch changes FunctionCall to:
-Keep the register by value instead of using pointers.
-Crash at compile time if a register is invalid.

* cssjit/FunctionCall.h:
(WebCore::FunctionCall::FunctionCall):
(WebCore::FunctionCall::setOneArgument):
(WebCore::FunctionCall::setTwoArguments):
(WebCore::FunctionCall::swapArguments):
(WebCore::FunctionCall::prepareAndCall):
* cssjit/RegisterAllocator.h:
(WebCore::RegisterAllocator::isValidRegister):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/cssjit/FunctionCall.h
Source/WebCore/cssjit/RegisterAllocator.h