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

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

Issue 10963032: Avoid wrong imul deopt on ia32 and x64 (fixes v8 bug 2339). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments. Created 8 years, 2 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
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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 } 1116 }
1117 1117
1118 if (can_overflow) { 1118 if (can_overflow) {
1119 DeoptimizeIf(overflow, instr->environment()); 1119 DeoptimizeIf(overflow, instr->environment());
1120 } 1120 }
1121 1121
1122 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { 1122 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) {
1123 // Bail out if the result is supposed to be negative zero. 1123 // Bail out if the result is supposed to be negative zero.
1124 Label done; 1124 Label done;
1125 __ testl(left, left); 1125 __ testl(left, left);
1126 __ j(not_zero, &done, Label::kNear); 1126 __ j(not_zero, &done, Label::kNear);
Vyacheslav Egorov (Google) 2012/09/26 10:07:36 This code is redundant if right is 0. (left is alw
1127 if (right->IsConstantOperand()) { 1127 if (right->IsConstantOperand()) {
1128 if (ToInteger32(LConstantOperand::cast(right)) <= 0) { 1128 if (ToInteger32(LConstantOperand::cast(right)) < 0) {
1129 DeoptimizeIf(no_condition, instr->environment()); 1129 DeoptimizeIf(no_condition, instr->environment());
1130 } else if (ToInteger32(LConstantOperand::cast(right)) == 0) {
1131 __ cmpl(kScratchRegister, Immediate(0));
1132 DeoptimizeIf(less, instr->environment());
1130 } 1133 }
1131 } else if (right->IsStackSlot()) { 1134 } else if (right->IsStackSlot()) {
1132 __ orl(kScratchRegister, ToOperand(right)); 1135 __ orl(kScratchRegister, ToOperand(right));
1133 DeoptimizeIf(sign, instr->environment()); 1136 DeoptimizeIf(sign, instr->environment());
1134 } else { 1137 } else {
1135 // Test the non-zero operand for negative sign. 1138 // Test the non-zero operand for negative sign.
1136 __ orl(kScratchRegister, ToRegister(right)); 1139 __ orl(kScratchRegister, ToRegister(right));
1137 DeoptimizeIf(sign, instr->environment()); 1140 DeoptimizeIf(sign, instr->environment());
1138 } 1141 }
1139 __ bind(&done); 1142 __ bind(&done);
(...skipping 4179 matching lines...) Expand 10 before | Expand all | Expand 10 after
5319 FixedArray::kHeaderSize - kPointerSize)); 5322 FixedArray::kHeaderSize - kPointerSize));
5320 __ bind(&done); 5323 __ bind(&done);
5321 } 5324 }
5322 5325
5323 5326
5324 #undef __ 5327 #undef __
5325 5328
5326 } } // namespace v8::internal 5329 } } // namespace v8::internal
5327 5330
5328 #endif // V8_TARGET_ARCH_X64 5331 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698