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

Side by Side Diff: src/codegen-ia32.cc

Issue 20420: Fix reversed arguments in comparison to a smi constant. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 11 years, 10 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 // where both sides are Smis. 1298 // where both sides are Smis.
1299 left_side.ToRegister(); 1299 left_side.ToRegister();
1300 ASSERT(left_side.is_valid()); 1300 ASSERT(left_side.is_valid());
1301 JumpTarget is_smi(this); 1301 JumpTarget is_smi(this);
1302 __ test(left_side.reg(), Immediate(kSmiTagMask)); 1302 __ test(left_side.reg(), Immediate(kSmiTagMask));
1303 is_smi.Branch(zero, &left_side, &right_side, taken); 1303 is_smi.Branch(zero, &left_side, &right_side, taken);
1304 1304
1305 // Setup and call the compare stub, which expects arguments in edx 1305 // Setup and call the compare stub, which expects arguments in edx
1306 // and eax. 1306 // and eax.
1307 CompareStub stub(cc, strict); 1307 CompareStub stub(cc, strict);
1308 left_side.ToRegister(eax); 1308 left_side.ToRegister(edx); // Only left_side currently uses a register.
1309 right_side.ToRegister(edx); 1309 right_side.ToRegister(eax); // left_side is not in eax. eax is free.
1310 Result result = frame_->CallStub(&stub, &left_side, &right_side, 0); 1310 Result result = frame_->CallStub(&stub, &left_side, &right_side, 0);
1311 result.ToRegister(); 1311 result.ToRegister();
1312 __ cmp(result.reg(), 0); 1312 __ cmp(result.reg(), 0);
1313 result.Unuse(); 1313 result.Unuse();
1314 dest->true_target()->Branch(cc); 1314 dest->true_target()->Branch(cc);
1315 dest->false_target()->Jump(); 1315 dest->false_target()->Jump();
1316 1316
1317 is_smi.Bind(&left_side, &right_side); 1317 is_smi.Bind(&left_side, &right_side);
1318 left_side.ToRegister(); 1318 left_side.ToRegister();
1319 // Test smi equality and comparison by signed int comparison. 1319 // Test smi equality and comparison by signed int comparison.
(...skipping 5235 matching lines...) Expand 10 before | Expand all | Expand 10 after
6555 6555
6556 // Slow-case: Go through the JavaScript implementation. 6556 // Slow-case: Go through the JavaScript implementation.
6557 __ bind(&slow); 6557 __ bind(&slow);
6558 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); 6558 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION);
6559 } 6559 }
6560 6560
6561 6561
6562 #undef __ 6562 #undef __
6563 6563
6564 } } // namespace v8::internal 6564 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698