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

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

Issue 6685052: Version 3.2.2. Fixed a number of crash and correctness bugs. Improved Cranksh... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 9 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/arm/lithium-arm.h ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 1343
1344 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1344 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1345 if (instr->representation().IsInteger32()) { 1345 if (instr->representation().IsInteger32()) {
1346 // TODO(1042) The fixed register allocation 1346 // TODO(1042) The fixed register allocation
1347 // is needed because we call GenericBinaryOpStub from 1347 // is needed because we call GenericBinaryOpStub from
1348 // the generated code, which requires registers r0 1348 // the generated code, which requires registers r0
1349 // and r1 to be used. We should remove that 1349 // and r1 to be used. We should remove that
1350 // when we provide a native implementation. 1350 // when we provide a native implementation.
1351 ASSERT(instr->left()->representation().IsInteger32()); 1351 ASSERT(instr->left()->representation().IsInteger32());
1352 ASSERT(instr->right()->representation().IsInteger32()); 1352 ASSERT(instr->right()->representation().IsInteger32());
1353 LOperand* value = UseFixed(instr->left(), r0); 1353
1354 LOperand* divisor = UseFixed(instr->right(), r1); 1354 LInstruction* result;
1355 LInstruction* result = DefineFixed(new LModI(value, divisor), r0); 1355 if (instr->HasPowerOf2Divisor()) {
1356 result = AssignEnvironment(AssignPointerMap(result)); 1356 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1357 LOperand* value = UseRegisterAtStart(instr->left());
1358 LModI* mod = new LModI(value, UseOrConstant(instr->right()));
1359 result = DefineSameAsFirst(mod);
1360 result = AssignEnvironment(result);
1361 } else {
1362 LOperand* value = UseFixed(instr->left(), r0);
1363 LOperand* divisor = UseFixed(instr->right(), r1);
1364 result = DefineFixed(new LModI(value, divisor), r0);
1365 result = AssignEnvironment(AssignPointerMap(result));
1366 }
1367
1357 return result; 1368 return result;
1358 } else if (instr->representation().IsTagged()) { 1369 } else if (instr->representation().IsTagged()) {
1359 return DoArithmeticT(Token::MOD, instr); 1370 return DoArithmeticT(Token::MOD, instr);
1360 } else { 1371 } else {
1361 ASSERT(instr->representation().IsDouble()); 1372 ASSERT(instr->representation().IsDouble());
1362 // We call a C function for double modulo. It can't trigger a GC. 1373 // We call a C function for double modulo. It can't trigger a GC.
1363 // We need to use fixed result register for the call. 1374 // We need to use fixed result register for the call.
1364 // TODO(fschneider): Allow any register as input registers. 1375 // TODO(fschneider): Allow any register as input registers.
1365 LOperand* left = UseFixedDouble(instr->left(), d1); 1376 LOperand* left = UseFixedDouble(instr->left(), d1);
1366 LOperand* right = UseFixedDouble(instr->right(), d2); 1377 LOperand* right = UseFixedDouble(instr->right(), d2);
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 1897
1887 1898
1888 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { 1899 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
1889 LOperand* string = UseRegister(instr->string()); 1900 LOperand* string = UseRegister(instr->string());
1890 LOperand* index = UseRegisterOrConstant(instr->index()); 1901 LOperand* index = UseRegisterOrConstant(instr->index());
1891 LStringCharCodeAt* result = new LStringCharCodeAt(string, index); 1902 LStringCharCodeAt* result = new LStringCharCodeAt(string, index);
1892 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); 1903 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
1893 } 1904 }
1894 1905
1895 1906
1907 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
1908 LOperand* char_code = UseRegister(instr->value());
1909 LStringCharFromCode* result = new LStringCharFromCode(char_code);
1910 return AssignPointerMap(DefineAsRegister(result));
1911 }
1912
1913
1896 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { 1914 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
1897 LOperand* string = UseRegisterAtStart(instr->value()); 1915 LOperand* string = UseRegisterAtStart(instr->value());
1898 return DefineAsRegister(new LStringLength(string)); 1916 return DefineAsRegister(new LStringLength(string));
1899 } 1917 }
1900 1918
1901 1919
1902 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { 1920 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
1903 return MarkAsCall(DefineFixed(new LArrayLiteral, r0), instr); 1921 return MarkAsCall(DefineFixed(new LArrayLiteral, r0), instr);
1904 } 1922 }
1905 1923
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 2056
2039 2057
2040 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2058 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2041 HEnvironment* outer = current_block_->last_environment()->outer(); 2059 HEnvironment* outer = current_block_->last_environment()->outer();
2042 current_block_->UpdateEnvironment(outer); 2060 current_block_->UpdateEnvironment(outer);
2043 return NULL; 2061 return NULL;
2044 } 2062 }
2045 2063
2046 2064
2047 } } // namespace v8::internal 2065 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698