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

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

Issue 246423005: Improve code generation for bounds checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.h » ('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 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 LOperand* index = FLAG_debug_code 1823 LOperand* index = FLAG_debug_code
1824 ? UseRegisterAtStart(instr->index()) 1824 ? UseRegisterAtStart(instr->index())
1825 : UseRegisterOrConstantAtStart(instr->index()); 1825 : UseRegisterOrConstantAtStart(instr->index());
1826 LOperand* value = UseRegisterAtStart(instr->value()); 1826 LOperand* value = UseRegisterAtStart(instr->value());
1827 LOperand* context = FLAG_debug_code ? UseFixed(instr->context(), cp) : NULL; 1827 LOperand* context = FLAG_debug_code ? UseFixed(instr->context(), cp) : NULL;
1828 return new(zone()) LSeqStringSetChar(context, string, index, value); 1828 return new(zone()) LSeqStringSetChar(context, string, index, value);
1829 } 1829 }
1830 1830
1831 1831
1832 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { 1832 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1833 LOperand* value = UseRegisterOrConstantAtStart(instr->index()); 1833 if (!FLAG_debug_code && instr->skip_check()) return NULL;
1834 LOperand* length = UseRegister(instr->length()); 1834 LOperand* index = UseRegisterOrConstantAtStart(instr->index());
1835 return AssignEnvironment(new(zone()) LBoundsCheck(value, length)); 1835 LOperand* length = !index->IsConstantOperand()
1836 ? UseRegisterOrConstantAtStart(instr->length())
1837 : UseRegisterAtStart(instr->length());
1838 LInstruction* result = new(zone()) LBoundsCheck(index, length);
1839 if (!FLAG_debug_code || !instr->skip_check()) {
1840 result = AssignEnvironment(result);
1841 }
1842 return result;
1836 } 1843 }
1837 1844
1838 1845
1839 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation( 1846 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation(
1840 HBoundsCheckBaseIndexInformation* instr) { 1847 HBoundsCheckBaseIndexInformation* instr) {
1841 UNREACHABLE(); 1848 UNREACHABLE();
1842 return NULL; 1849 return NULL;
1843 } 1850 }
1844 1851
1845 1852
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 2578
2572 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2579 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2573 LOperand* object = UseRegister(instr->object()); 2580 LOperand* object = UseRegister(instr->object());
2574 LOperand* index = UseRegister(instr->index()); 2581 LOperand* index = UseRegister(instr->index());
2575 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2582 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2576 LInstruction* result = DefineSameAsFirst(load); 2583 LInstruction* result = DefineSameAsFirst(load);
2577 return AssignPointerMap(result); 2584 return AssignPointerMap(result);
2578 } 2585 }
2579 2586
2580 } } // namespace v8::internal 2587 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698