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

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

Issue 72813004: Fixed crashes exposed though fuzzing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nits Created 7 years, 1 month 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-ia32.h ('k') | src/ia32/macro-assembler-ia32.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 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 } 1885 }
1886 1886
1887 1887
1888 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) { 1888 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) {
1889 LOperand* string = UseRegisterAtStart(instr->string()); 1889 LOperand* string = UseRegisterAtStart(instr->string());
1890 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); 1890 LOperand* index = UseRegisterOrConstantAtStart(instr->index());
1891 return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index)); 1891 return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index));
1892 } 1892 }
1893 1893
1894 1894
1895 LOperand* LChunkBuilder::GetSeqStringSetCharOperand(HSeqStringSetChar* instr) {
1896 if (instr->encoding() == String::ONE_BYTE_ENCODING) {
1897 if (FLAG_debug_code) {
1898 return UseFixed(instr->value(), eax);
1899 } else {
1900 return UseFixedOrConstant(instr->value(), eax);
1901 }
1902 } else {
1903 if (FLAG_debug_code) {
1904 return UseRegisterAtStart(instr->value());
1905 } else {
1906 return UseRegisterOrConstantAtStart(instr->value());
1907 }
1908 }
1909 }
1910
1911
1895 LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) { 1912 LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) {
1896 LOperand* string = UseRegisterAtStart(instr->string()); 1913 LOperand* string = UseRegisterAtStart(instr->string());
1897 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); 1914 LOperand* index = FLAG_debug_code
1898 LOperand* value = (instr->encoding() == String::ONE_BYTE_ENCODING) 1915 ? UseRegisterAtStart(instr->index())
1899 ? UseFixedOrConstant(instr->value(), eax) 1916 : UseRegisterOrConstantAtStart(instr->index());
1900 : UseRegisterOrConstantAtStart(instr->value()); 1917 LOperand* value = GetSeqStringSetCharOperand(instr);
1901 return new(zone()) LSeqStringSetChar(string, index, value); 1918 LOperand* context = FLAG_debug_code ? UseFixed(instr->context(), esi) : NULL;
1919 LInstruction* result = new(zone()) LSeqStringSetChar(context, string,
1920 index, value);
1921 if (FLAG_debug_code) {
1922 result = MarkAsCall(result, instr);
1923 }
1924 return result;
1902 } 1925 }
1903 1926
1904 1927
1905 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { 1928 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1906 return AssignEnvironment(new(zone()) LBoundsCheck( 1929 return AssignEnvironment(new(zone()) LBoundsCheck(
1907 UseRegisterOrConstantAtStart(instr->index()), 1930 UseRegisterOrConstantAtStart(instr->index()),
1908 UseAtStart(instr->length()))); 1931 UseAtStart(instr->length())));
1909 } 1932 }
1910 1933
1911 1934
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
2767 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2790 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2768 LOperand* object = UseRegister(instr->object()); 2791 LOperand* object = UseRegister(instr->object());
2769 LOperand* index = UseTempRegister(instr->index()); 2792 LOperand* index = UseTempRegister(instr->index());
2770 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2793 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2771 } 2794 }
2772 2795
2773 2796
2774 } } // namespace v8::internal 2797 } } // namespace v8::internal
2775 2798
2776 #endif // V8_TARGET_ARCH_IA32 2799 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698