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 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 LOperand* index = FLAG_debug_code | 1775 LOperand* index = FLAG_debug_code |
1776 ? UseRegisterAtStart(instr->index()) | 1776 ? UseRegisterAtStart(instr->index()) |
1777 : UseRegisterOrConstantAtStart(instr->index()); | 1777 : UseRegisterOrConstantAtStart(instr->index()); |
1778 LOperand* value = UseRegisterAtStart(instr->value()); | 1778 LOperand* value = UseRegisterAtStart(instr->value()); |
1779 LOperand* context = FLAG_debug_code ? UseFixed(instr->context(), cp) : NULL; | 1779 LOperand* context = FLAG_debug_code ? UseFixed(instr->context(), cp) : NULL; |
1780 return new(zone()) LSeqStringSetChar(context, string, index, value); | 1780 return new(zone()) LSeqStringSetChar(context, string, index, value); |
1781 } | 1781 } |
1782 | 1782 |
1783 | 1783 |
1784 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1784 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
1785 LOperand* value = UseRegisterOrConstantAtStart(instr->index()); | 1785 if (!FLAG_debug_code && instr->skip_check()) return NULL; |
1786 LOperand* length = UseRegister(instr->length()); | 1786 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |
1787 return AssignEnvironment(new(zone()) LBoundsCheck(value, length)); | 1787 LOperand* length = !index->IsConstantOperand() |
| 1788 ? UseRegisterOrConstantAtStart(instr->length()) |
| 1789 : UseRegisterAtStart(instr->length()); |
| 1790 LInstruction* result = new(zone()) LBoundsCheck(index, length); |
| 1791 if (!FLAG_debug_code || !instr->skip_check()) { |
| 1792 result = AssignEnvironment(result); |
| 1793 } |
| 1794 return result; |
1788 } | 1795 } |
1789 | 1796 |
1790 | 1797 |
1791 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation( | 1798 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation( |
1792 HBoundsCheckBaseIndexInformation* instr) { | 1799 HBoundsCheckBaseIndexInformation* instr) { |
1793 UNREACHABLE(); | 1800 UNREACHABLE(); |
1794 return NULL; | 1801 return NULL; |
1795 } | 1802 } |
1796 | 1803 |
1797 | 1804 |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2525 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2532 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2526 LOperand* object = UseRegister(instr->object()); | 2533 LOperand* object = UseRegister(instr->object()); |
2527 LOperand* index = UseRegister(instr->index()); | 2534 LOperand* index = UseRegister(instr->index()); |
2528 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2535 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2529 LInstruction* result = DefineSameAsFirst(load); | 2536 LInstruction* result = DefineSameAsFirst(load); |
2530 return AssignPointerMap(result); | 2537 return AssignPointerMap(result); |
2531 } | 2538 } |
2532 | 2539 |
2533 | 2540 |
2534 } } // namespace v8::internal | 2541 } } // namespace v8::internal |
OLD | NEW |