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 3045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 context()->Plug(rax); | 3056 context()->Plug(rax); |
3057 break; | 3057 break; |
3058 } | 3058 } |
3059 | 3059 |
3060 case Token::ADD: { | 3060 case Token::ADD: { |
3061 Comment cmt(masm_, "[ UnaryOperation (ADD)"); | 3061 Comment cmt(masm_, "[ UnaryOperation (ADD)"); |
3062 VisitForAccumulatorValue(expr->expression()); | 3062 VisitForAccumulatorValue(expr->expression()); |
3063 Label no_conversion; | 3063 Label no_conversion; |
3064 Condition is_smi = masm_->CheckSmi(result_register()); | 3064 Condition is_smi = masm_->CheckSmi(result_register()); |
3065 __ j(is_smi, &no_conversion); | 3065 __ j(is_smi, &no_conversion); |
3066 __ push(result_register()); | 3066 ToNumberStub convert_stub; |
3067 __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION); | 3067 __ CallStub(&convert_stub); |
3068 __ bind(&no_conversion); | 3068 __ bind(&no_conversion); |
3069 context()->Plug(result_register()); | 3069 context()->Plug(result_register()); |
3070 break; | 3070 break; |
3071 } | 3071 } |
3072 | 3072 |
3073 case Token::SUB: { | 3073 case Token::SUB: { |
3074 Comment cmt(masm_, "[ UnaryOperation (SUB)"); | 3074 Comment cmt(masm_, "[ UnaryOperation (SUB)"); |
3075 bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); | 3075 bool can_overwrite = expr->expression()->ResultOverwriteAllowed(); |
3076 UnaryOverwriteMode overwrite = | 3076 UnaryOverwriteMode overwrite = |
3077 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; | 3077 can_overwrite ? UNARY_OVERWRITE : UNARY_NO_OVERWRITE; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3173 | 3173 |
3174 // We need a second deoptimization point after loading the value | 3174 // We need a second deoptimization point after loading the value |
3175 // in case evaluating the property load my have a side effect. | 3175 // in case evaluating the property load my have a side effect. |
3176 PrepareForBailout(expr->increment(), TOS_REG); | 3176 PrepareForBailout(expr->increment(), TOS_REG); |
3177 | 3177 |
3178 // Call ToNumber only if operand is not a smi. | 3178 // Call ToNumber only if operand is not a smi. |
3179 NearLabel no_conversion; | 3179 NearLabel no_conversion; |
3180 Condition is_smi; | 3180 Condition is_smi; |
3181 is_smi = masm_->CheckSmi(rax); | 3181 is_smi = masm_->CheckSmi(rax); |
3182 __ j(is_smi, &no_conversion); | 3182 __ j(is_smi, &no_conversion); |
3183 __ push(rax); | 3183 ToNumberStub convert_stub; |
3184 __ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION); | 3184 __ CallStub(&convert_stub); |
3185 __ bind(&no_conversion); | 3185 __ bind(&no_conversion); |
3186 | 3186 |
3187 // Save result for postfix expressions. | 3187 // Save result for postfix expressions. |
3188 if (expr->is_postfix()) { | 3188 if (expr->is_postfix()) { |
3189 if (!context()->IsEffect()) { | 3189 if (!context()->IsEffect()) { |
3190 // Save the result on the stack. If we have a named or keyed property | 3190 // Save the result on the stack. If we have a named or keyed property |
3191 // we store the result under the receiver that is currently on top | 3191 // we store the result under the receiver that is currently on top |
3192 // of the stack. | 3192 // of the stack. |
3193 switch (assign_type) { | 3193 switch (assign_type) { |
3194 case VARIABLE: | 3194 case VARIABLE: |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3644 __ ret(0); | 3644 __ ret(0); |
3645 } | 3645 } |
3646 | 3646 |
3647 | 3647 |
3648 #undef __ | 3648 #undef __ |
3649 | 3649 |
3650 | 3650 |
3651 } } // namespace v8::internal | 3651 } } // namespace v8::internal |
3652 | 3652 |
3653 #endif // V8_TARGET_ARCH_X64 | 3653 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |