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

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

Issue 6677076: Merge up to bleeding_edge r7201 to isolates branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: Fix lint. 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/x64/lithium-x64.h ('k') | src/x64/macro-assembler-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 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 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 ASSERT(instr->representation().IsTagged()); 1340 ASSERT(instr->representation().IsTagged());
1341 return DoArithmeticT(Token::DIV, instr); 1341 return DoArithmeticT(Token::DIV, instr);
1342 } 1342 }
1343 } 1343 }
1344 1344
1345 1345
1346 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1346 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1347 if (instr->representation().IsInteger32()) { 1347 if (instr->representation().IsInteger32()) {
1348 ASSERT(instr->left()->representation().IsInteger32()); 1348 ASSERT(instr->left()->representation().IsInteger32());
1349 ASSERT(instr->right()->representation().IsInteger32()); 1349 ASSERT(instr->right()->representation().IsInteger32());
1350 // The temporary operand is necessary to ensure that right is not allocated 1350
1351 // into edx. 1351 LInstruction* result;
1352 LOperand* temp = FixedTemp(rdx); 1352 if (instr->HasPowerOf2Divisor()) {
1353 LOperand* value = UseFixed(instr->left(), rax); 1353 ASSERT(!instr->CheckFlag(HValue::kCanBeDivByZero));
1354 LOperand* divisor = UseRegister(instr->right()); 1354 LOperand* value = UseRegisterAtStart(instr->left());
1355 LModI* mod = new LModI(value, divisor, temp); 1355 LModI* mod = new LModI(value, UseOrConstant(instr->right()), NULL);
1356 LInstruction* result = DefineFixed(mod, rdx); 1356 result = DefineSameAsFirst(mod);
1357 } else {
1358 // The temporary operand is necessary to ensure that right is not
1359 // allocated into edx.
1360 LOperand* temp = FixedTemp(rdx);
1361 LOperand* value = UseFixed(instr->left(), rax);
1362 LOperand* divisor = UseRegister(instr->right());
1363 LModI* mod = new LModI(value, divisor, temp);
1364 result = DefineFixed(mod, rdx);
1365 }
1366
1357 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) || 1367 return (instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1358 instr->CheckFlag(HValue::kCanBeDivByZero)) 1368 instr->CheckFlag(HValue::kCanBeDivByZero))
1359 ? AssignEnvironment(result) 1369 ? AssignEnvironment(result)
1360 : result; 1370 : result;
1361 } else if (instr->representation().IsTagged()) { 1371 } else if (instr->representation().IsTagged()) {
1362 return DoArithmeticT(Token::MOD, instr); 1372 return DoArithmeticT(Token::MOD, instr);
1363 } else { 1373 } else {
1364 ASSERT(instr->representation().IsDouble()); 1374 ASSERT(instr->representation().IsDouble());
1365 // We call a C function for double modulo. It can't trigger a GC. 1375 // We call a C function for double modulo. It can't trigger a GC.
1366 // We need to use fixed result register for the call. 1376 // We need to use fixed result register for the call.
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 1899
1890 1900
1891 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { 1901 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) {
1892 LOperand* string = UseRegister(instr->string()); 1902 LOperand* string = UseRegister(instr->string());
1893 LOperand* index = UseRegisterOrConstant(instr->index()); 1903 LOperand* index = UseRegisterOrConstant(instr->index());
1894 LStringCharCodeAt* result = new LStringCharCodeAt(string, index); 1904 LStringCharCodeAt* result = new LStringCharCodeAt(string, index);
1895 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); 1905 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result)));
1896 } 1906 }
1897 1907
1898 1908
1909 LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) {
1910 LOperand* char_code = UseRegister(instr->value());
1911 LStringCharFromCode* result = new LStringCharFromCode(char_code);
1912 return AssignPointerMap(DefineAsRegister(result));
1913 }
1914
1915
1899 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { 1916 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) {
1900 LOperand* string = UseRegisterAtStart(instr->value()); 1917 LOperand* string = UseRegisterAtStart(instr->value());
1901 return DefineAsRegister(new LStringLength(string)); 1918 return DefineAsRegister(new LStringLength(string));
1902 } 1919 }
1903 1920
1904 1921
1905 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { 1922 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) {
1906 return MarkAsCall(DefineFixed(new LArrayLiteral, rax), instr); 1923 return MarkAsCall(DefineFixed(new LArrayLiteral, rax), instr);
1907 } 1924 }
1908 1925
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2040 2057
2041 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2058 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2042 HEnvironment* outer = current_block_->last_environment()->outer(); 2059 HEnvironment* outer = current_block_->last_environment()->outer();
2043 current_block_->UpdateEnvironment(outer); 2060 current_block_->UpdateEnvironment(outer);
2044 return NULL; 2061 return NULL;
2045 } 2062 }
2046 2063
2047 } } // namespace v8::internal 2064 } } // namespace v8::internal
2048 2065
2049 #endif // V8_TARGET_ARCH_X64 2066 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698