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

Side by Side Diff: src/ia32/lithium-ia32.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 | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 LInstruction* result = new(zone()) LSeqStringSetChar(context, string, 1858 LInstruction* result = new(zone()) LSeqStringSetChar(context, string,
1859 index, value); 1859 index, value);
1860 if (FLAG_debug_code) { 1860 if (FLAG_debug_code) {
1861 result = MarkAsCall(result, instr); 1861 result = MarkAsCall(result, instr);
1862 } 1862 }
1863 return result; 1863 return result;
1864 } 1864 }
1865 1865
1866 1866
1867 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { 1867 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1868 return AssignEnvironment(new(zone()) LBoundsCheck( 1868 if (!FLAG_debug_code && instr->skip_check()) return NULL;
1869 UseRegisterOrConstantAtStart(instr->index()), 1869 LOperand* index = UseRegisterOrConstantAtStart(instr->index());
1870 UseAtStart(instr->length()))); 1870 LOperand* length = !index->IsConstantOperand()
1871 ? UseOrConstantAtStart(instr->length())
1872 : UseAtStart(instr->length());
1873 LInstruction* result = new(zone()) LBoundsCheck(index, length);
1874 if (!FLAG_debug_code || !instr->skip_check()) {
1875 result = AssignEnvironment(result);
1876 }
1877 return result;
1871 } 1878 }
1872 1879
1873 1880
1874 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation( 1881 LInstruction* LChunkBuilder::DoBoundsCheckBaseIndexInformation(
1875 HBoundsCheckBaseIndexInformation* instr) { 1882 HBoundsCheckBaseIndexInformation* instr) {
1876 UNREACHABLE(); 1883 UNREACHABLE();
1877 return NULL; 1884 return NULL;
1878 } 1885 }
1879 1886
1880 1887
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2711 LOperand* index = UseTempRegister(instr->index()); 2718 LOperand* index = UseTempRegister(instr->index());
2712 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2719 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2713 LInstruction* result = DefineSameAsFirst(load); 2720 LInstruction* result = DefineSameAsFirst(load);
2714 return AssignPointerMap(result); 2721 return AssignPointerMap(result);
2715 } 2722 }
2716 2723
2717 2724
2718 } } // namespace v8::internal 2725 } } // namespace v8::internal
2719 2726
2720 #endif // V8_TARGET_ARCH_IA32 2727 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698