| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 3680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3691 case Token::NOT: | 3691 case Token::NOT: |
| 3692 case Token::DELETE: | 3692 case Token::DELETE: |
| 3693 case Token::TYPEOF: | 3693 case Token::TYPEOF: |
| 3694 UNREACHABLE(); // handled above | 3694 UNREACHABLE(); // handled above |
| 3695 break; | 3695 break; |
| 3696 | 3696 |
| 3697 case Token::SUB: { | 3697 case Token::SUB: { |
| 3698 bool overwrite = | 3698 bool overwrite = |
| 3699 (node->expression()->AsBinaryOperation() != NULL && | 3699 (node->expression()->AsBinaryOperation() != NULL && |
| 3700 node->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); | 3700 node->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); |
| 3701 UnarySubStub stub(overwrite); | 3701 GenericUnaryOpStub stub(Token::SUB, overwrite); |
| 3702 frame_->CallStub(&stub, 0); | 3702 frame_->CallStub(&stub, 0); |
| 3703 break; | 3703 break; |
| 3704 } | 3704 } |
| 3705 | 3705 |
| 3706 case Token::BIT_NOT: { | 3706 case Token::BIT_NOT: { |
| 3707 // smi check | 3707 // smi check |
| 3708 JumpTarget smi_label; | 3708 JumpTarget smi_label; |
| 3709 JumpTarget continue_label; | 3709 JumpTarget continue_label; |
| 3710 __ tst(r0, Operand(kSmiTagMask)); | 3710 __ tst(r0, Operand(kSmiTagMask)); |
| 3711 smi_label.Branch(eq); | 3711 smi_label.Branch(eq); |
| (...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5933 // Do tail-call to runtime routine. Runtime routines expect at least one | 5933 // Do tail-call to runtime routine. Runtime routines expect at least one |
| 5934 // argument, so give it a Smi. | 5934 // argument, so give it a Smi. |
| 5935 __ mov(r0, Operand(Smi::FromInt(0))); | 5935 __ mov(r0, Operand(Smi::FromInt(0))); |
| 5936 __ push(r0); | 5936 __ push(r0); |
| 5937 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1, 1); | 5937 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1, 1); |
| 5938 | 5938 |
| 5939 __ StubReturn(1); | 5939 __ StubReturn(1); |
| 5940 } | 5940 } |
| 5941 | 5941 |
| 5942 | 5942 |
| 5943 void UnarySubStub::Generate(MacroAssembler* masm) { | 5943 void GenericUnaryOpStub::Generate(MacroAssembler* masm) { |
| 5944 ASSERT(op_ == Token::SUB); |
| 5945 |
| 5944 Label undo; | 5946 Label undo; |
| 5945 Label slow; | 5947 Label slow; |
| 5946 Label not_smi; | 5948 Label not_smi; |
| 5947 | 5949 |
| 5948 // Enter runtime system if the value is not a smi. | 5950 // Enter runtime system if the value is not a smi. |
| 5949 __ tst(r0, Operand(kSmiTagMask)); | 5951 __ tst(r0, Operand(kSmiTagMask)); |
| 5950 __ b(ne, ¬_smi); | 5952 __ b(ne, ¬_smi); |
| 5951 | 5953 |
| 5952 // Enter runtime system if the value of the expression is zero | 5954 // Enter runtime system if the value of the expression is zero |
| 5953 // to make sure that we switch between 0 and -0. | 5955 // to make sure that we switch between 0 and -0. |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6567 int CompareStub::MinorKey() { | 6569 int CompareStub::MinorKey() { |
| 6568 // Encode the two parameters in a unique 16 bit value. | 6570 // Encode the two parameters in a unique 16 bit value. |
| 6569 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6571 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
| 6570 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6572 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
| 6571 } | 6573 } |
| 6572 | 6574 |
| 6573 | 6575 |
| 6574 #undef __ | 6576 #undef __ |
| 6575 | 6577 |
| 6576 } } // namespace v8::internal | 6578 } } // namespace v8::internal |
| OLD | NEW |