Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: src/mips/lithium-mips.cc

Issue 246253007: MIPS: Improve code generation for bounds checks. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698