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

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

Issue 3388005: Make the CompareStub and the UnaryOpStub accept smi inputs.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: x64 and ARM port Created 10 years, 3 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 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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 __ orr(scratch, lhs, Operand(rhs)); 1644 __ orr(scratch, lhs, Operand(rhs));
1645 smi_test_reg = scratch; 1645 smi_test_reg = scratch;
1646 } 1646 }
1647 __ tst(smi_test_reg, Operand(kSmiTagMask)); 1647 __ tst(smi_test_reg, Operand(kSmiTagMask));
1648 JumpTarget smi; 1648 JumpTarget smi;
1649 smi.Branch(eq); 1649 smi.Branch(eq);
1650 1650
1651 // Perform non-smi comparison by stub. 1651 // Perform non-smi comparison by stub.
1652 // CompareStub takes arguments in r0 and r1, returns <0, >0 or 0 in r0. 1652 // CompareStub takes arguments in r0 and r1, returns <0, >0 or 0 in r0.
1653 // We call with 0 args because there are 0 on the stack. 1653 // We call with 0 args because there are 0 on the stack.
1654 CompareStub stub(cc, strict, kBothCouldBeNaN, true, lhs, rhs); 1654 CompareStub stub(cc, strict, NO_SMI_COMPARE_IN_STUB, lhs, rhs);
1655 frame_->CallStub(&stub, 0); 1655 frame_->CallStub(&stub, 0);
1656 __ cmp(r0, Operand(0, RelocInfo::NONE)); 1656 __ cmp(r0, Operand(0, RelocInfo::NONE));
1657 exit.Jump(); 1657 exit.Jump();
1658 1658
1659 smi.Bind(); 1659 smi.Bind();
1660 } 1660 }
1661 1661
1662 // Do smi comparisons by pointer comparison. 1662 // Do smi comparisons by pointer comparison.
1663 __ cmp(lhs, Operand(rhs)); 1663 __ cmp(lhs, Operand(rhs));
1664 1664
(...skipping 4313 matching lines...) Expand 10 before | Expand all | Expand 10 after
5978 case Token::DELETE: 5978 case Token::DELETE:
5979 case Token::TYPEOF: 5979 case Token::TYPEOF:
5980 UNREACHABLE(); // handled above 5980 UNREACHABLE(); // handled above
5981 break; 5981 break;
5982 5982
5983 case Token::SUB: { 5983 case Token::SUB: {
5984 frame_->PopToR0(); 5984 frame_->PopToR0();
5985 GenericUnaryOpStub stub( 5985 GenericUnaryOpStub stub(
5986 Token::SUB, 5986 Token::SUB,
5987 overwrite, 5987 overwrite,
5988 NO_UNARY_FLAGS,
5988 no_negative_zero ? kIgnoreNegativeZero : kStrictNegativeZero); 5989 no_negative_zero ? kIgnoreNegativeZero : kStrictNegativeZero);
5989 frame_->CallStub(&stub, 0); 5990 frame_->CallStub(&stub, 0);
5990 frame_->EmitPush(r0); // r0 has result 5991 frame_->EmitPush(r0); // r0 has result
5991 break; 5992 break;
5992 } 5993 }
5993 5994
5994 case Token::BIT_NOT: { 5995 case Token::BIT_NOT: {
5995 Register tos = frame_->PopToRegister(); 5996 Register tos = frame_->PopToRegister();
5996 JumpTarget not_smi_label; 5997 JumpTarget not_smi_label;
5997 JumpTarget continue_label; 5998 JumpTarget continue_label;
5998 // Smi check. 5999 // Smi check.
5999 __ tst(tos, Operand(kSmiTagMask)); 6000 __ tst(tos, Operand(kSmiTagMask));
6000 not_smi_label.Branch(ne); 6001 not_smi_label.Branch(ne);
6001 6002
6002 __ mvn(tos, Operand(tos)); 6003 __ mvn(tos, Operand(tos));
6003 __ bic(tos, tos, Operand(kSmiTagMask)); // Bit-clear inverted smi-tag. 6004 __ bic(tos, tos, Operand(kSmiTagMask)); // Bit-clear inverted smi-tag.
6004 frame_->EmitPush(tos); 6005 frame_->EmitPush(tos);
6005 // The fast case is the first to jump to the continue label, so it gets 6006 // The fast case is the first to jump to the continue label, so it gets
6006 // to decide the virtual frame layout. 6007 // to decide the virtual frame layout.
6007 continue_label.Jump(); 6008 continue_label.Jump();
6008 6009
6009 not_smi_label.Bind(); 6010 not_smi_label.Bind();
6010 frame_->SpillAll(); 6011 frame_->SpillAll();
6011 __ Move(r0, tos); 6012 __ Move(r0, tos);
6012 GenericUnaryOpStub stub(Token::BIT_NOT, overwrite); 6013 GenericUnaryOpStub stub(Token::BIT_NOT,
6014 overwrite,
6015 NO_UNARY_SMI_CODE_IN_STUB);
6013 frame_->CallStub(&stub, 0); 6016 frame_->CallStub(&stub, 0);
6014 frame_->EmitPush(r0); 6017 frame_->EmitPush(r0);
6015 6018
6016 continue_label.Bind(); 6019 continue_label.Bind();
6017 break; 6020 break;
6018 } 6021 }
6019 6022
6020 case Token::VOID: 6023 case Token::VOID:
6021 frame_->Drop(); 6024 frame_->Drop();
6022 frame_->EmitPushRoot(Heap::kUndefinedValueRootIndex); 6025 frame_->EmitPushRoot(Heap::kUndefinedValueRootIndex);
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
7301 BinaryOpIC::GetName(runtime_operands_type_)); 7304 BinaryOpIC::GetName(runtime_operands_type_));
7302 return name_; 7305 return name_;
7303 } 7306 }
7304 7307
7305 7308
7306 #undef __ 7309 #undef __
7307 7310
7308 } } // namespace v8::internal 7311 } } // namespace v8::internal
7309 7312
7310 #endif // V8_TARGET_ARCH_ARM 7313 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/full-codegen-arm.cc » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698