| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 __ b(eq, &no_conversion); | 2729 __ b(eq, &no_conversion); |
| 2730 __ push(r0); | 2730 __ push(r0); |
| 2731 __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS); | 2731 __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS); |
| 2732 __ bind(&no_conversion); | 2732 __ bind(&no_conversion); |
| 2733 Apply(context_, result_register()); | 2733 Apply(context_, result_register()); |
| 2734 break; | 2734 break; |
| 2735 } | 2735 } |
| 2736 | 2736 |
| 2737 case Token::SUB: { | 2737 case Token::SUB: { |
| 2738 Comment cmt(masm_, "[ UnaryOperation (SUB)"); | 2738 Comment cmt(masm_, "[ UnaryOperation (SUB)"); |
| 2739 bool overwrite = | 2739 bool can_overwrite = |
| 2740 (expr->expression()->AsBinaryOperation() != NULL && | 2740 (expr->expression()->AsBinaryOperation() != NULL && |
| 2741 expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); | 2741 expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); |
| 2742 UnaryOverwriteMode overwrite = |
| 2743 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; |
| 2742 GenericUnaryOpStub stub(Token::SUB, overwrite); | 2744 GenericUnaryOpStub stub(Token::SUB, overwrite); |
| 2743 // GenericUnaryOpStub expects the argument to be in the | 2745 // GenericUnaryOpStub expects the argument to be in the |
| 2744 // accumulator register r0. | 2746 // accumulator register r0. |
| 2745 VisitForValue(expr->expression(), kAccumulator); | 2747 VisitForValue(expr->expression(), kAccumulator); |
| 2746 __ CallStub(&stub); | 2748 __ CallStub(&stub); |
| 2747 Apply(context_, r0); | 2749 Apply(context_, r0); |
| 2748 break; | 2750 break; |
| 2749 } | 2751 } |
| 2750 | 2752 |
| 2751 case Token::BIT_NOT: { | 2753 case Token::BIT_NOT: { |
| 2752 Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)"); | 2754 Comment cmt(masm_, "[ UnaryOperation (BIT_NOT)"); |
| 2753 bool overwrite = | 2755 bool can_overwrite = |
| 2754 (expr->expression()->AsBinaryOperation() != NULL && | 2756 (expr->expression()->AsBinaryOperation() != NULL && |
| 2755 expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); | 2757 expr->expression()->AsBinaryOperation()->ResultOverwriteAllowed()); |
| 2758 UnaryOverwriteMode overwrite = |
| 2759 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; |
| 2756 GenericUnaryOpStub stub(Token::BIT_NOT, overwrite); | 2760 GenericUnaryOpStub stub(Token::BIT_NOT, overwrite); |
| 2757 // GenericUnaryOpStub expects the argument to be in the | 2761 // GenericUnaryOpStub expects the argument to be in the |
| 2758 // accumulator register r0. | 2762 // accumulator register r0. |
| 2759 VisitForValue(expr->expression(), kAccumulator); | 2763 VisitForValue(expr->expression(), kAccumulator); |
| 2760 // Avoid calling the stub for Smis. | 2764 // Avoid calling the stub for Smis. |
| 2761 Label smi, done; | 2765 Label smi, done; |
| 2762 __ BranchOnSmi(result_register(), &smi); | 2766 __ BranchOnSmi(result_register(), &smi); |
| 2763 // Non-smi: call stub leaving result in accumulator register. | 2767 // Non-smi: call stub leaving result in accumulator register. |
| 2764 __ CallStub(&stub); | 2768 __ CallStub(&stub); |
| 2765 __ b(&done); | 2769 __ b(&done); |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3151 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3155 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
| 3152 __ add(pc, r1, Operand(masm_->CodeObject())); | 3156 __ add(pc, r1, Operand(masm_->CodeObject())); |
| 3153 } | 3157 } |
| 3154 | 3158 |
| 3155 | 3159 |
| 3156 #undef __ | 3160 #undef __ |
| 3157 | 3161 |
| 3158 } } // namespace v8::internal | 3162 } } // namespace v8::internal |
| 3159 | 3163 |
| 3160 #endif // V8_TARGET_ARCH_ARM | 3164 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |