OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3050 context()->Plug(r0); | 3050 context()->Plug(r0); |
3051 break; | 3051 break; |
3052 } | 3052 } |
3053 | 3053 |
3054 case Token::ADD: { | 3054 case Token::ADD: { |
3055 Comment cmt(masm_, "[ UnaryOperation (ADD)"); | 3055 Comment cmt(masm_, "[ UnaryOperation (ADD)"); |
3056 VisitForAccumulatorValue(expr->expression()); | 3056 VisitForAccumulatorValue(expr->expression()); |
3057 Label no_conversion; | 3057 Label no_conversion; |
3058 __ tst(result_register(), Operand(kSmiTagMask)); | 3058 __ tst(result_register(), Operand(kSmiTagMask)); |
3059 __ b(eq, &no_conversion); | 3059 __ b(eq, &no_conversion); |
3060 __ push(r0); | 3060 ToNumberStub convert_stub; |
3061 __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS); | 3061 __ CallStub(&convert_stub); |
3062 __ bind(&no_conversion); | 3062 __ bind(&no_conversion); |
3063 context()->Plug(result_register()); | 3063 context()->Plug(result_register()); |
3064 break; | 3064 break; |
3065 } | 3065 } |
3066 | 3066 |
3067 case Token::SUB: { | 3067 case Token::SUB: { |
3068 Comment cmt(masm_, "[ UnaryOperation (SUB)"); | 3068 Comment cmt(masm_, "[ UnaryOperation (SUB)"); |
3069 bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); | 3069 bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); |
3070 UnaryOverwriteMode overwrite = | 3070 UnaryOverwriteMode overwrite = |
3071 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; | 3071 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3170 } | 3170 } |
3171 } | 3171 } |
3172 | 3172 |
3173 // We need a second deoptimization point after loading the value | 3173 // We need a second deoptimization point after loading the value |
3174 // in case evaluating the property load my have a side effect. | 3174 // in case evaluating the property load my have a side effect. |
3175 PrepareForBailout(expr->increment(), TOS_REG); | 3175 PrepareForBailout(expr->increment(), TOS_REG); |
3176 | 3176 |
3177 // Call ToNumber only if operand is not a smi. | 3177 // Call ToNumber only if operand is not a smi. |
3178 Label no_conversion; | 3178 Label no_conversion; |
3179 __ JumpIfSmi(r0, &no_conversion); | 3179 __ JumpIfSmi(r0, &no_conversion); |
3180 __ push(r0); | 3180 ToNumberStub convert_stub; |
3181 __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS); | 3181 __ CallStub(&convert_stub); |
3182 __ bind(&no_conversion); | 3182 __ bind(&no_conversion); |
3183 | 3183 |
3184 // Save result for postfix expressions. | 3184 // Save result for postfix expressions. |
3185 if (expr->is_postfix()) { | 3185 if (expr->is_postfix()) { |
3186 if (!context()->IsEffect()) { | 3186 if (!context()->IsEffect()) { |
3187 // Save the result on the stack. If we have a named or keyed property | 3187 // Save the result on the stack. If we have a named or keyed property |
3188 // we store the result under the receiver that is currently on top | 3188 // we store the result under the receiver that is currently on top |
3189 // of the stack. | 3189 // of the stack. |
3190 switch (assign_type) { | 3190 switch (assign_type) { |
3191 case VARIABLE: | 3191 case VARIABLE: |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3618 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 3618 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
3619 __ add(pc, r1, Operand(masm_->CodeObject())); | 3619 __ add(pc, r1, Operand(masm_->CodeObject())); |
3620 } | 3620 } |
3621 | 3621 |
3622 | 3622 |
3623 #undef __ | 3623 #undef __ |
3624 | 3624 |
3625 } } // namespace v8::internal | 3625 } } // namespace v8::internal |
3626 | 3626 |
3627 #endif // V8_TARGET_ARCH_ARM | 3627 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |