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

Side by Side Diff: src/hydrogen.cc

Issue 198833002: Make translation of modulus operation '--stress-opt'-proof. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test Created 6 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 | « no previous file | test/mjsunit/regress/regress-352059.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 9207 matching lines...) Expand 10 before | Expand all | Expand 10 after
9218 case Token::ADD: 9218 case Token::ADD:
9219 instr = AddUncasted<HAdd>(left, right); 9219 instr = AddUncasted<HAdd>(left, right);
9220 break; 9220 break;
9221 case Token::SUB: 9221 case Token::SUB:
9222 instr = AddUncasted<HSub>(left, right); 9222 instr = AddUncasted<HSub>(left, right);
9223 break; 9223 break;
9224 case Token::MUL: 9224 case Token::MUL:
9225 instr = AddUncasted<HMul>(left, right); 9225 instr = AddUncasted<HMul>(left, right);
9226 break; 9226 break;
9227 case Token::MOD: { 9227 case Token::MOD: {
9228 if (fixed_right_arg.has_value) { 9228 if (fixed_right_arg.has_value &&
9229 if (right->IsConstant()) { 9229 !right->EqualsInteger32Constant(fixed_right_arg.value)) {
9230 HConstant* c_right = HConstant::cast(right); 9230 HConstant* fixed_right = Add<HConstant>(
9231 if (c_right->HasInteger32Value()) { 9231 static_cast<int>(fixed_right_arg.value));
9232 ASSERT_EQ(fixed_right_arg.value, c_right->Integer32Value()); 9232 IfBuilder if_same(this);
9233 } 9233 if_same.If<HCompareNumericAndBranch>(right, fixed_right, Token::EQ);
9234 } else { 9234 if_same.Then();
9235 HConstant* fixed_right = Add<HConstant>( 9235 if_same.ElseDeopt("Unexpected RHS of binary operation");
9236 static_cast<int>(fixed_right_arg.value)); 9236 right = fixed_right;
9237 IfBuilder if_same(this);
9238 if_same.If<HCompareNumericAndBranch>(right, fixed_right, Token::EQ);
9239 if_same.Then();
9240 if_same.ElseDeopt("Unexpected RHS of binary operation");
9241 right = fixed_right;
9242 }
9243 } 9237 }
9244 instr = AddUncasted<HMod>(left, right); 9238 instr = AddUncasted<HMod>(left, right);
9245 break; 9239 break;
9246 } 9240 }
9247 case Token::DIV: 9241 case Token::DIV:
9248 instr = AddUncasted<HDiv>(left, right); 9242 instr = AddUncasted<HDiv>(left, right);
9249 break; 9243 break;
9250 case Token::BIT_XOR: 9244 case Token::BIT_XOR:
9251 case Token::BIT_AND: 9245 case Token::BIT_AND:
9252 instr = AddUncasted<HBitwise>(op, left, right); 9246 instr = AddUncasted<HBitwise>(op, left, right);
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after
11298 if (ShouldProduceTraceOutput()) { 11292 if (ShouldProduceTraceOutput()) {
11299 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11293 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11300 } 11294 }
11301 11295
11302 #ifdef DEBUG 11296 #ifdef DEBUG
11303 graph_->Verify(false); // No full verify. 11297 graph_->Verify(false); // No full verify.
11304 #endif 11298 #endif
11305 } 11299 }
11306 11300
11307 } } // namespace v8::internal 11301 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-352059.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698