| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 LOperand* right = NULL; | 706 LOperand* right = NULL; |
| 707 int constant_value = 0; | 707 int constant_value = 0; |
| 708 if (right_value->IsConstant()) { | 708 if (right_value->IsConstant()) { |
| 709 HConstant* constant = HConstant::cast(right_value); | 709 HConstant* constant = HConstant::cast(right_value); |
| 710 right = chunk_->DefineConstantOperand(constant); | 710 right = chunk_->DefineConstantOperand(constant); |
| 711 constant_value = constant->Integer32Value() & 0x1f; | 711 constant_value = constant->Integer32Value() & 0x1f; |
| 712 } else { | 712 } else { |
| 713 right = UseRegisterAtStart(right_value); | 713 right = UseRegisterAtStart(right_value); |
| 714 } | 714 } |
| 715 | 715 |
| 716 // Shift operations can only deoptimize if we do a logical shift |
| 717 // by 0 and the result cannot be truncated to int32. |
| 716 bool does_deopt = false; | 718 bool does_deopt = false; |
| 717 | 719 if (op == Token::SHR && constant_value == 0) { |
| 718 if (FLAG_opt_safe_uint32_operations) { | 720 if (FLAG_opt_safe_uint32_operations) { |
| 719 does_deopt = !instr->CheckFlag(HInstruction::kUint32); | 721 does_deopt = !instr->CheckFlag(HInstruction::kUint32); |
| 720 } else { | 722 } else { |
| 721 // Shift operations can only deoptimize if we do a logical shift | |
| 722 // by 0 and the result cannot be truncated to int32. | |
| 723 bool may_deopt = (op == Token::SHR && constant_value == 0); | |
| 724 if (may_deopt) { | |
| 725 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { | 723 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { |
| 726 if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { | 724 if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { |
| 727 does_deopt = true; | 725 does_deopt = true; |
| 728 break; | 726 break; |
| 729 } | 727 } |
| 730 } | 728 } |
| 731 } | 729 } |
| 732 } | 730 } |
| 733 | 731 |
| 734 LInstruction* result = | 732 LInstruction* result = |
| (...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 | 2312 |
| 2315 | 2313 |
| 2316 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2314 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2317 LOperand* object = UseRegister(instr->object()); | 2315 LOperand* object = UseRegister(instr->object()); |
| 2318 LOperand* index = UseRegister(instr->index()); | 2316 LOperand* index = UseRegister(instr->index()); |
| 2319 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2317 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2320 } | 2318 } |
| 2321 | 2319 |
| 2322 | 2320 |
| 2323 } } // namespace v8::internal | 2321 } } // namespace v8::internal |
| OLD | NEW |