summaryrefslogtreecommitdiffstats
path: root/js/src/jit/MIRGraph.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-03-27 13:21:13 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-03-27 13:21:13 +0200
commit72721d1d032db2099593076bf96f274623af3c26 (patch)
tree33db746920d307db8270ab90ba12fc0c30850b96 /js/src/jit/MIRGraph.cpp
parent2b7f231ca7f64c9750f65922d92e3b98a3351f79 (diff)
parent2a57d73c3b5304be3f9be51018a1bbee79f007e2 (diff)
downloadUXP-72721d1d032db2099593076bf96f274623af3c26.tar
UXP-72721d1d032db2099593076bf96f274623af3c26.tar.gz
UXP-72721d1d032db2099593076bf96f274623af3c26.tar.lz
UXP-72721d1d032db2099593076bf96f274623af3c26.tar.xz
UXP-72721d1d032db2099593076bf96f274623af3c26.zip
Merge remote-tracking branch 'janek/js_lhs-before-rhs_1'
Diffstat (limited to 'js/src/jit/MIRGraph.cpp')
-rw-r--r--js/src/jit/MIRGraph.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit/MIRGraph.cpp b/js/src/jit/MIRGraph.cpp
index 3a363a5bf..d6e0fa8ff 100644
--- a/js/src/jit/MIRGraph.cpp
+++ b/js/src/jit/MIRGraph.cpp
@@ -790,6 +790,19 @@ MBasicBlock::pick(int32_t depth)
}
void
+MBasicBlock::unpick(int32_t depth)
+{
+ // unpick take the top of the stack element and move it under the depth-th
+ // element;
+ // unpick(-2):
+ // A B C D E
+ // A B C E D [ swapAt(-1) ]
+ // A B E C D [ swapAt(-2) ]
+ for (int32_t n = -1; n >= depth; n--)
+ swapAt(n);
+}
+
+void
MBasicBlock::swapAt(int32_t depth)
{
uint32_t lhsDepth = stackPosition_ + depth - 1;