aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/x86/LowerJump.cpp
diff options
context:
space:
mode:
authorUdayan Banerji <udayan.banerji@intel.com>2013-03-29 14:05:18 -0700
committerElliott Hughes <enh@google.com>2013-04-01 16:34:35 -0700
commited2876e520bbdf295f894c5fb7c5a58bf90bf60f (patch)
tree7328054d0c2069aa2ca3d57a97f2fcd5086cf733 /vm/compiler/codegen/x86/LowerJump.cpp
parent82c80de14da66b80474b298ae99cbff37cdf9b53 (diff)
[x86] Fix errors with WITH_JIT_TUNING defined
This patch makes the necessary changes to pass on correct information to dvmBumpNoChain, so that WITH_JIT_TUNING flag can be enabled for x86 codegen Signed-off-by: Udayan Banerji <udayan.banerji@intel.com> (cherry picked from commit 19eb287ac848f10e03ca2614bf53bd9d1ddd3724) Change-Id: I6871dd0839b3656beed4633e3a0f3df780af98a0
Diffstat (limited to 'vm/compiler/codegen/x86/LowerJump.cpp')
-rw-r--r--vm/compiler/codegen/x86/LowerJump.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/vm/compiler/codegen/x86/LowerJump.cpp b/vm/compiler/codegen/x86/LowerJump.cpp
index 2b10d6bbf..d4b0df3ef 100644
--- a/vm/compiler/codegen/x86/LowerJump.cpp
+++ b/vm/compiler/codegen/x86/LowerJump.cpp
@@ -1163,6 +1163,13 @@ int op_packed_switch() {
//get rPC, %eax has the relative PC offset
alu_binary_imm_reg(OpndSize_32, add_opc, (int)rPC, PhysicalReg_EAX, true);
scratchRegs[0] = PhysicalReg_SCRATCH_2;
+#if defined(WITH_JIT_TUNING)
+ /* Fall back to interpreter after resolving address of switch target.
+ * Indicate a kSwitchOverflow. Note: This is not an "overflow". But it helps
+ * count the times we return from a Switch
+ */
+ move_imm_to_mem(OpndSize_32, kSwitchOverflow, 0, PhysicalReg_ESP, true);
+#endif
jumpToInterpNoChain();
rPC += 3;
return 0;
@@ -1220,6 +1227,13 @@ int op_sparse_switch() {
//get rPC, %eax has the relative PC offset
alu_binary_imm_reg(OpndSize_32, add_opc, (int)rPC, PhysicalReg_EAX, true);
scratchRegs[0] = PhysicalReg_SCRATCH_2;
+#if defined(WITH_JIT_TUNING)
+ /* Fall back to interpreter after resolving address of switch target.
+ * Indicate a kSwitchOverflow. Note: This is not an "overflow". But it helps
+ * count the times we return from a Switch
+ */
+ move_imm_to_mem(OpndSize_32, kSwitchOverflow, 0, PhysicalReg_ESP, true);
+#endif
jumpToInterpNoChain();
rPC += 3;
return 0;