Commit 60267da6 authored by danno@chromium.org's avatar danno@chromium.org

MIPS: Cleanup handling of shifts: SHR can deoptimize only when its a shift by...

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=

Review URL: https://chromiumcodereview.appspot.com/10876054
Patch from Akos Palfi <palfia@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12831 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8ed2e560
...@@ -702,15 +702,13 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, ...@@ -702,15 +702,13 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
right = UseRegisterAtStart(right_value); 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; bool does_deopt = false;
if (op == Token::SHR && constant_value == 0) {
if (FLAG_opt_safe_uint32_operations) { if (FLAG_opt_safe_uint32_operations) {
does_deopt = !instr->CheckFlag(HInstruction::kUint32); does_deopt = !instr->CheckFlag(HInstruction::kUint32);
} else { } 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) {
for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
does_deopt = true; does_deopt = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment