| 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 LOperand* right = NULL; | 697 LOperand* right = NULL; |
| 698 int constant_value = 0; | 698 int constant_value = 0; |
| 699 if (right_value->IsConstant()) { | 699 if (right_value->IsConstant()) { |
| 700 HConstant* constant = HConstant::cast(right_value); | 700 HConstant* constant = HConstant::cast(right_value); |
| 701 right = chunk_->DefineConstantOperand(constant); | 701 right = chunk_->DefineConstantOperand(constant); |
| 702 constant_value = constant->Integer32Value() & 0x1f; | 702 constant_value = constant->Integer32Value() & 0x1f; |
| 703 } else { | 703 } else { |
| 704 right = UseRegisterAtStart(right_value); | 704 right = UseRegisterAtStart(right_value); |
| 705 } | 705 } |
| 706 | 706 |
| 707 // Shift operations can only deoptimize if we do a logical shift |
| 708 // by 0 and the result cannot be truncated to int32. |
| 707 bool does_deopt = false; | 709 bool does_deopt = false; |
| 708 | 710 if (op == Token::SHR && constant_value == 0) { |
| 709 if (FLAG_opt_safe_uint32_operations) { | 711 if (FLAG_opt_safe_uint32_operations) { |
| 710 does_deopt = !instr->CheckFlag(HInstruction::kUint32); | 712 does_deopt = !instr->CheckFlag(HInstruction::kUint32); |
| 711 } else { | 713 } else { |
| 712 // Shift operations can only deoptimize if we do a logical shift | |
| 713 // by 0 and the result cannot be truncated to int32. | |
| 714 bool may_deopt = (op == Token::SHR && constant_value == 0); | |
| 715 if (may_deopt) { | |
| 716 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { | 714 for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) { |
| 717 if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { | 715 if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) { |
| 718 does_deopt = true; | 716 does_deopt = true; |
| 719 break; | 717 break; |
| 720 } | 718 } |
| 721 } | 719 } |
| 722 } | 720 } |
| 723 } | 721 } |
| 724 | 722 |
| 725 LInstruction* result = | 723 LInstruction* result = |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2245 | 2243 |
| 2246 | 2244 |
| 2247 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2245 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2248 LOperand* object = UseRegister(instr->object()); | 2246 LOperand* object = UseRegister(instr->object()); |
| 2249 LOperand* index = UseRegister(instr->index()); | 2247 LOperand* index = UseRegister(instr->index()); |
| 2250 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2248 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2251 } | 2249 } |
| 2252 | 2250 |
| 2253 | 2251 |
| 2254 } } // namespace v8::internal | 2252 } } // namespace v8::internal |
| OLD | NEW |