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

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

Issue 54393002: Fix uint32-to-smi conversion in Lithium (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: your wish is my command 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/x64/lithium-x64.h ('k') | test/mjsunit/regress/regress-crbug-309623.js » ('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 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1876 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
1877 } else if (val->HasRange() && val->range()->IsInSmiRange()) { 1877 } else if (val->HasRange() && val->range()->IsInSmiRange()) {
1878 return DefineSameAsFirst(new(zone()) LSmiTag(value)); 1878 return DefineSameAsFirst(new(zone()) LSmiTag(value));
1879 } else { 1879 } else {
1880 LNumberTagI* result = new(zone()) LNumberTagI(value); 1880 LNumberTagI* result = new(zone()) LNumberTagI(value);
1881 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); 1881 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
1882 } 1882 }
1883 } else if (to.IsSmi()) { 1883 } else if (to.IsSmi()) {
1884 HValue* val = instr->value(); 1884 HValue* val = instr->value();
1885 LOperand* value = UseRegister(val); 1885 LOperand* value = UseRegister(val);
1886 LInstruction* result = 1886 LInstruction* result = NULL;
1887 DefineAsRegister(new(zone()) LInteger32ToSmi(value)); 1887 if (val->CheckFlag(HInstruction::kUint32)) {
1888 if (val->HasRange() && val->range()->IsInSmiRange()) { 1888 result = DefineAsRegister(new(zone()) LUint32ToSmi(value));
1889 return result; 1889 if (val->HasRange() && val->range()->IsInSmiRange() &&
1890 val->range()->upper() != kMaxInt) {
1891 return result;
1892 }
1893 } else {
1894 result = DefineAsRegister(new(zone()) LInteger32ToSmi(value));
1895 if (val->HasRange() && val->range()->IsInSmiRange()) {
1896 return result;
1897 }
1890 } 1898 }
1891 return AssignEnvironment(result); 1899 return AssignEnvironment(result);
1892 } else { 1900 } else {
1893 if (instr->value()->CheckFlag(HInstruction::kUint32)) { 1901 if (instr->value()->CheckFlag(HInstruction::kUint32)) {
1894 LOperand* temp = FixedTemp(xmm1); 1902 LOperand* temp = FixedTemp(xmm1);
1895 return DefineAsRegister( 1903 return DefineAsRegister(
1896 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp)); 1904 new(zone()) LUint32ToDouble(UseRegister(instr->value()), temp));
1897 } else { 1905 } else {
1898 ASSERT(to.IsDouble()); 1906 ASSERT(to.IsDouble());
1899 LOperand* value = Use(instr->value()); 1907 LOperand* value = Use(instr->value());
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2537 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2545 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2538 LOperand* object = UseRegister(instr->object()); 2546 LOperand* object = UseRegister(instr->object());
2539 LOperand* index = UseTempRegister(instr->index()); 2547 LOperand* index = UseTempRegister(instr->index());
2540 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2548 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2541 } 2549 }
2542 2550
2543 2551
2544 } } // namespace v8::internal 2552 } } // namespace v8::internal
2545 2553
2546 #endif // V8_TARGET_ARCH_X64 2554 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | test/mjsunit/regress/regress-crbug-309623.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698