Reviewers: Vyacheslav Egorov, danno, Paul Lind, kisg,

Message:
This patch requires the following CL to be landed first:
https://chromiumcodereview.appspot.com/10874047

Description:
MIPS: Cleanup handling of shifts: SHR can deoptimize only when its a shift by 0,
all other shift never deoptimize.

Port r12373 (9fdde2ad)

Original commit message:
Fix DoDeferredNumberTagU to keep the value in xmm1 instead of xmm0 on x64.

xmm0 is not saved across runtime call on x64 because
MacroAssembler::EnterExitFrameEpilogue preserves only allocatable XMM registers
unlike on ia32 where it preserves all registers.

Cleanup handling of shifts: SHR can deoptimize only when its a shift by 0, all
other shift never deoptimize.

Fix type inference for i-to-t change instruction. On X64 this ensures that
write-barrier is generated correctly.

BUG=
TEST=


Please review this at https://chromiumcodereview.appspot.com/10876054/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/mips/lithium-mips.cc


Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index 1c9859edd54cc1fb75a9591407d27b4011b7800b..0266f1375a22bfae0a46bc7e8ead0c045934f28f 100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -713,15 +713,13 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
     right = UseRegisterAtStart(right_value);
   }

+  // Shift operations can only deoptimize if we do a logical shift
+  // by 0 and the result cannot be truncated to int32.
   bool does_deopt = false;
-
-  if (FLAG_opt_safe_uint32_operations) {
-    does_deopt = !instr->CheckFlag(HInstruction::kUint32);
-  } else {
-    // Shift operations can only deoptimize if we do a logical shift
-    // by 0 and the result cannot be truncated to int32.
-    bool may_deopt = (op == Token::SHR && constant_value == 0);
-    if (may_deopt) {
+  if (op == Token::SHR && constant_value == 0) {
+    if (FLAG_opt_safe_uint32_operations) {
+      does_deopt = !instr->CheckFlag(HInstruction::kUint32);
+    } else {
       for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
         if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
           does_deopt = true;


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to