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

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

Issue 955001: Added fast case for shift operations when the left parameter is a double and ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 // Check that both operands are smis using the answer register as a 1461 // Check that both operands are smis using the answer register as a
1462 // temporary. 1462 // temporary.
1463 DeferredInlineBinaryOperation* deferred = 1463 DeferredInlineBinaryOperation* deferred =
1464 new DeferredInlineBinaryOperation(op, 1464 new DeferredInlineBinaryOperation(op,
1465 answer.reg(), 1465 answer.reg(),
1466 left->reg(), 1466 left->reg(),
1467 ecx, 1467 ecx,
1468 left->number_info(), 1468 left->number_info(),
1469 right->number_info(), 1469 right->number_info(),
1470 overwrite_mode); 1470 overwrite_mode);
1471 CheckTwoForSminess(masm_, left->reg(), right->reg(), answer.reg(),
1472 left->number_info(), right->number_info(), deferred);
1473 1471
1474 // Untag both operands. 1472 Label do_op, left_nonsmi;
1475 __ mov(answer.reg(), left->reg()); 1473 // if right is a smi we make a fast case if left is either a smi
1476 __ SmiUntag(answer.reg()); 1474 // or a heapnumber.
1475 if (CpuFeatures::IsSupported(SSE2) && right->number_info().IsSmi()) {
1476 __ mov(answer.reg(), left->reg());
1477 // Fast case - both are actually smis.
1478 if (!left->number_info().IsSmi()) {
1479 __ test(answer.reg(), Immediate(kSmiTagMask));
1480 __ j(not_zero, &left_nonsmi);
1481 }
1482 __ SmiUntag(answer.reg());
1483 __ jmp(&do_op);
1484
1485 __ bind(&left_nonsmi);
1486 // Branch if not a heapnumber.
1487 __ cmp(FieldOperand(answer.reg(), HeapObject::kMapOffset),
1488 Factory::heap_number_map());
1489 deferred->Branch(not_equal);
1490
1491 // Load integer value into answer register using truncation.
1492 __ cvttsd2si(answer.reg(),
1493 FieldOperand(answer.reg(), HeapNumber::kValueOffset));
1494 // Branch if we do not fit in a smi.
1495 __ cmp(answer.reg(), 0xc0000000);
1496 deferred->Branch(negative);
1497 } else {
1498 CheckTwoForSminess(masm_, left->reg(), right->reg(), answer.reg(),
1499 left->number_info(), right->number_info(), deferred);
1500
1501 // Untag both operands.
1502 __ mov(answer.reg(), left->reg());
1503 __ SmiUntag(answer.reg());
1504 }
1505
1477 __ SmiUntag(ecx); 1506 __ SmiUntag(ecx);
1478 // Perform the operation. 1507 // Perform the operation.
1479 switch (op) { 1508 switch (op) {
1480 case Token::SAR: 1509 case Token::SAR:
1481 __ sar_cl(answer.reg()); 1510 __ sar_cl(answer.reg());
1482 // No checks of result necessary 1511 // No checks of result necessary
1483 break; 1512 break;
1484 case Token::SHR: { 1513 case Token::SHR: {
1485 Label result_ok; 1514 Label result_ok;
1486 __ shr_cl(answer.reg()); 1515 __ shr_cl(answer.reg());
(...skipping 10327 matching lines...) Expand 10 before | Expand all | Expand 10 after
11814 11843
11815 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 11844 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
11816 // tagged as a small integer. 11845 // tagged as a small integer.
11817 __ bind(&runtime); 11846 __ bind(&runtime);
11818 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); 11847 __ TailCallRuntime(Runtime::kStringCompare, 2, 1);
11819 } 11848 }
11820 11849
11821 #undef __ 11850 #undef __
11822 11851
11823 } } // namespace v8::internal 11852 } } // 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